summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-03-06 20:16:49 +0000
committerGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-03-06 20:16:49 +0000
commit6e51714419a151dcc26e04319cc554187a905279 (patch)
tree04126f125c26e7e7c2664d64989910314c32317c /indra/newview
parent1d522aca8a5d5205f6d6150699ce5b9b8425c007 (diff)
Isolate atmospherics LLSD conversion code.
Fix translateLegacySettings to add an array where an array is expected.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llsettingsvo.cpp24
-rw-r--r--indra/newview/llsettingsvo.h3
2 files changed, 22 insertions, 5 deletions
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 4c10017a57..61e411496a 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -425,13 +425,10 @@ LLSettingsSky::ptr_t LLSettingsVOSky::buildClone()
return skyp;
}
-LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isAdvanced)
+void LLSettingsVOSky::convertAtmosphericsToLegacy(LLSD& legacy, LLSD& settings)
{
- LLSD legacy(LLSD::emptyMap());
- LLSD settings = psky->getSettings();
-
-// These will need to be inferred from new settings' density profiles
// LEGACY_ATMOSPHERICS
+ // These will need to be inferred from new settings' density profiles
legacy[SETTING_AMBIENT] = ensureArray4(settings[SETTING_AMBIENT], 1.0f);
legacy[SETTING_BLUE_DENSITY] = ensureArray4(settings[SETTING_BLUE_DENSITY], 1.0);
legacy[SETTING_BLUE_HORIZON] = ensureArray4(settings[SETTING_BLUE_HORIZON], 1.0);
@@ -440,6 +437,23 @@ LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isA
legacy[SETTING_HAZE_DENSITY] = LLSDArray(settings[SETTING_HAZE_DENSITY])(0.0f)(0.0f)(1.0f);
legacy[SETTING_HAZE_HORIZON] = LLSDArray(settings[SETTING_HAZE_HORIZON])(0.0f)(0.0f)(1.0f);
+ //legacy[SETTING_AMBIENT] = LLColor4::black.getValue();
+ //legacy[SETTING_BLUE_DENSITY] = LLColor4(0.2447, 0.4487, 0.7599, 0.0).getValue();
+ //legacy[SETTING_BLUE_HORIZON] = LLColor4(0.4954, 0.4954, 0.6399, 0.0).getValue();
+ //legacy[SETTING_HAZE_DENSITY] = LLSDArray(0.6999f)(0.0f)(0.0f)(1.0f);
+ //legacy[SETTING_HAZE_HORIZON] = LLSDArray(0.1899f)(0.0f)(0.0f)(1.0f);
+ //legacy[SETTING_DENSITY_MULTIPLIER] = LLSDArray(0.0001f)(0.0f)(0.0f)(1.0f);LLSD::Real(0.0001);
+ //legacy[SETTING_DISTANCE_MULTIPLIER] = LLSDArray(0.8f)(0.0f)(0.0f)(1.0f);
+}
+
+LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isAdvanced)
+{
+ LLSD legacy(LLSD::emptyMap());
+ LLSD settings = psky->getSettings();
+
+// LEGACY_ATMOSPHERICS
+ convertAtmosphericsToLegacy(legacy, settings);
+
legacy[SETTING_CLOUD_COLOR] = ensureArray4(settings[SETTING_CLOUD_COLOR], 1.0);
legacy[SETTING_CLOUD_POS_DENSITY1] = ensureArray4(settings[SETTING_CLOUD_POS_DENSITY1], 1.0);
legacy[SETTING_CLOUD_POS_DENSITY2] = ensureArray4(settings[SETTING_CLOUD_POS_DENSITY2], 1.0);
diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h
index 48b5cad168..3c47009d5f 100644
--- a/indra/newview/llsettingsvo.h
+++ b/indra/newview/llsettingsvo.h
@@ -94,6 +94,9 @@ public:
protected:
LLSettingsVOSky();
+ // Interpret new settings in terms of old atmospherics params
+ static void convertAtmosphericsToLegacy(LLSD& legacy, LLSD& settings);
+
virtual void updateSettings() override;
virtual void applySpecial(void *) override;