summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2019-01-30 14:36:46 -0800
committerRider Linden <rider@lindenlab.com>2019-01-30 14:36:46 -0800
commitc7e02b0835cbb50777c677f618c4a957e69fabee (patch)
tree54148a3075642a666dec0b606c43eedf8c4c75b3 /indra/llinventory
parent9246be072101e4e09f6ab2655eb78939242bac3f (diff)
SL-9925: Viewer now shows an error message if import from legacy windlight fails.
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llsettingssky.cpp21
-rw-r--r--indra/llinventory/llsettingswater.cpp15
2 files changed, 36 insertions, 0 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 86c8393499..f3519dc7cb 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -809,6 +809,7 @@ LLSD LLSettingsSky::translateLegacyHazeSettings(const LLSD& legacy)
LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
{
+ bool converted_something(false);
LLSD newsettings(defaults());
// Move legacy haze parameters to an inner map
@@ -818,23 +819,28 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
if (legacyhazesettings.size() > 0)
{
newsettings[SETTING_LEGACY_HAZE] = legacyhazesettings;
+ converted_something |= true;
}
if (legacy.has(SETTING_CLOUD_COLOR))
{
newsettings[SETTING_CLOUD_COLOR] = LLColor3(legacy[SETTING_CLOUD_COLOR]).getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_CLOUD_POS_DENSITY1))
{
newsettings[SETTING_CLOUD_POS_DENSITY1] = LLColor3(legacy[SETTING_CLOUD_POS_DENSITY1]).getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_CLOUD_POS_DENSITY2))
{
newsettings[SETTING_CLOUD_POS_DENSITY2] = LLColor3(legacy[SETTING_CLOUD_POS_DENSITY2]).getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_CLOUD_SCALE))
{
newsettings[SETTING_CLOUD_SCALE] = LLSD::Real(legacy[SETTING_CLOUD_SCALE][0].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_CLOUD_SCROLL_RATE))
{
@@ -851,53 +857,64 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
}
newsettings[SETTING_CLOUD_SCROLL_RATE] = cloud_scroll.getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_CLOUD_SHADOW))
{
newsettings[SETTING_CLOUD_SHADOW] = LLSD::Real(legacy[SETTING_CLOUD_SHADOW][0].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_GAMMA))
{
newsettings[SETTING_GAMMA] = legacy[SETTING_GAMMA][0].asReal();
+ converted_something |= true;
}
if (legacy.has(SETTING_GLOW))
{
newsettings[SETTING_GLOW] = LLColor3(legacy[SETTING_GLOW]).getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_MAX_Y))
{
newsettings[SETTING_MAX_Y] = LLSD::Real(legacy[SETTING_MAX_Y][0].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_STAR_BRIGHTNESS))
{
newsettings[SETTING_STAR_BRIGHTNESS] = LLSD::Real(legacy[SETTING_STAR_BRIGHTNESS].asReal() * 250.0f);
+ converted_something |= true;
}
if (legacy.has(SETTING_SUNLIGHT_COLOR))
{
newsettings[SETTING_SUNLIGHT_COLOR] = LLColor4(legacy[SETTING_SUNLIGHT_COLOR]).getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_PLANET_RADIUS))
{
newsettings[SETTING_PLANET_RADIUS] = LLSD::Real(legacy[SETTING_PLANET_RADIUS].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_SKY_BOTTOM_RADIUS))
{
newsettings[SETTING_SKY_BOTTOM_RADIUS] = LLSD::Real(legacy[SETTING_SKY_BOTTOM_RADIUS].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_SKY_TOP_RADIUS))
{
newsettings[SETTING_SKY_TOP_RADIUS] = LLSD::Real(legacy[SETTING_SKY_TOP_RADIUS].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_SUN_ARC_RADIANS))
{
newsettings[SETTING_SUN_ARC_RADIANS] = LLSD::Real(legacy[SETTING_SUN_ARC_RADIANS].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_EAST_ANGLE) && legacy.has(SETTING_LEGACY_SUN_ANGLE))
@@ -912,8 +929,12 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
newsettings[SETTING_SUN_ROTATION] = sunquat.getValue();
newsettings[SETTING_MOON_ROTATION] = moonquat.getValue();
+ converted_something |= true;
}
+ if (!converted_something)
+ return LLSD();
+
return newsettings;
}
diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp
index 1780948f0a..d160a4ae0e 100644
--- a/indra/llinventory/llsettingswater.cpp
+++ b/indra/llinventory/llsettingswater.cpp
@@ -119,57 +119,72 @@ LLSD LLSettingsWater::defaults(const LLSettingsBase::TrackPosition& position)
LLSD LLSettingsWater::translateLegacySettings(LLSD legacy)
{
+ bool converted_something(false);
LLSD newsettings(defaults());
if (legacy.has(SETTING_LEGACY_BLUR_MULTIPLIER))
{
newsettings[SETTING_BLUR_MULTIPLIER] = LLSD::Real(legacy[SETTING_LEGACY_BLUR_MULTIPLIER].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_FOG_COLOR))
{
newsettings[SETTING_FOG_COLOR] = LLColor3(legacy[SETTING_LEGACY_FOG_COLOR]).getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_FOG_DENSITY))
{
newsettings[SETTING_FOG_DENSITY] = LLSD::Real(legacy[SETTING_LEGACY_FOG_DENSITY]);
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_FOG_MOD))
{
newsettings[SETTING_FOG_MOD] = LLSD::Real(legacy[SETTING_LEGACY_FOG_MOD].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_FRESNEL_OFFSET))
{
newsettings[SETTING_FRESNEL_OFFSET] = LLSD::Real(legacy[SETTING_LEGACY_FRESNEL_OFFSET].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_FRESNEL_SCALE))
{
newsettings[SETTING_FRESNEL_SCALE] = LLSD::Real(legacy[SETTING_LEGACY_FRESNEL_SCALE].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_NORMAL_MAP))
{
newsettings[SETTING_NORMAL_MAP] = LLSD::UUID(legacy[SETTING_LEGACY_NORMAL_MAP].asUUID());
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_NORMAL_SCALE))
{
newsettings[SETTING_NORMAL_SCALE] = LLVector3(legacy[SETTING_LEGACY_NORMAL_SCALE]).getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_SCALE_ABOVE))
{
newsettings[SETTING_SCALE_ABOVE] = LLSD::Real(legacy[SETTING_LEGACY_SCALE_ABOVE].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_SCALE_BELOW))
{
newsettings[SETTING_SCALE_BELOW] = LLSD::Real(legacy[SETTING_LEGACY_SCALE_BELOW].asReal());
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_WAVE1_DIR))
{
newsettings[SETTING_WAVE1_DIR] = LLVector2(legacy[SETTING_LEGACY_WAVE1_DIR]).getValue();
+ converted_something |= true;
}
if (legacy.has(SETTING_LEGACY_WAVE2_DIR))
{
newsettings[SETTING_WAVE2_DIR] = LLVector2(legacy[SETTING_LEGACY_WAVE2_DIR]).getValue();
+ converted_something |= true;
}
+ if (!converted_something)
+ return LLSD();
return newsettings;
}