enable weather splash particles serialization
This commit is contained in:
parent
fe503d1192
commit
7b1c03c208
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user