enable weather splash particles serialization

This commit is contained in:
MihailRis 2025-02-26 03:02:50 +03:00
parent fe503d1192
commit 7b1c03c208

View File

@ -11,7 +11,11 @@ dv::value WeatherPreset::serialize() const {
froot["hspeed"] = fall.hspeed;
froot["scale"] = fall.scale;
froot["noise"] = fall.noise;
if (fall.splash) {
froot["splash"] = fall.splash->serialize();
}
root["fall"] = froot;
root["fog_opacity"] = fogOpacity;
root["fog_dencity"] = fogDencity;
root["clouds"] = clouds;
@ -27,8 +31,14 @@ void WeatherPreset::deserialize(const dv::value& src) {
froot.at("hspeed").get(fall.hspeed);
froot.at("scale").get(fall.scale);
froot.at("noise").get(fall.noise);
src.at("fog_opacity").get(fogOpacity);
src.at("fog_dencity").get(fogDencity);
src.at("clouds").get(clouds);
if (froot.has("splash")) {
const auto& sroot = froot["splash"];
fall.splash = ParticlesPreset {};
fall.splash->deserialize(sroot);
}
}
src.at("fog_opacity").get(fogOpacity);
src.at("fog_dencity").get(fogDencity);
src.at("clouds").get(clouds);
}