summaryrefslogtreecommitdiff
path: root/indra
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
parent1d522aca8a5d5205f6d6150699ce5b9b8425c007 (diff)
Isolate atmospherics LLSD conversion code.
Fix translateLegacySettings to add an array where an array is expected.
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llsettingssky.cpp8
-rw-r--r--indra/newview/llsettingsvo.cpp24
-rw-r--r--indra/newview/llsettingsvo.h3
3 files changed, 25 insertions, 10 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 5d38deb229..cac363b510 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -616,17 +616,17 @@ LLSD LLSettingsSky::translateLegacySettings(LLSD legacy)
if (!legacy.has(SETTING_RAYLEIGH_CONFIG))
{
- newsettings[SETTING_RAYLEIGH_CONFIG] = rayleighConfigDefault();
+ newsettings[SETTING_RAYLEIGH_CONFIG].append(rayleighConfigDefault());
}
if (!legacy.has(SETTING_ABSORPTION_CONFIG))
{
- newsettings[SETTING_ABSORPTION_CONFIG] = absorptionConfigDefault();
+ newsettings[SETTING_ABSORPTION_CONFIG].append(absorptionConfigDefault());
}
if (!legacy.has(SETTING_MIE_CONFIG))
{
- newsettings[SETTING_MIE_CONFIG] = mieConfigDefault();
+ newsettings[SETTING_MIE_CONFIG].append(mieConfigDefault());
}
if (legacy.has(SETTING_CLOUD_COLOR))
@@ -728,8 +728,6 @@ LLSD LLSettingsSky::translateLegacySettings(LLSD legacy)
newsettings[SETTING_SUN_ARC_RADIANS] = 0.00935f / 2.0f;
}
-
-
if (legacy.has(SETTING_LEGACY_EAST_ANGLE) && legacy.has(SETTING_LEGACY_SUN_ANGLE))
{ // convert the east and sun angles into a quaternion.
F32 azimuth = legacy[SETTING_LEGACY_EAST_ANGLE].asReal();
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;