summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingssky.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-10-19 16:01:48 +0000
committerRider Linden <rider@lindenlab.com>2018-10-19 16:01:48 +0000
commit0343c59d4e1471283500c9004c365b6ccf58be9a (patch)
tree90fc365962f63da60b5ecdca14dc7f8ce2809526 /indra/llinventory/llsettingssky.cpp
parent8b7b22d236ff5fde6b1f031663af61a542c44f64 (diff)
parent0532c644a3507166582a44dcde3a6a36bea5a5bf (diff)
Merged in graham_linden/viewer-eep-graham (pull request #160)
Port sim-side changes to back-conversion of new settings to legacy.
Diffstat (limited to 'indra/llinventory/llsettingssky.cpp')
-rw-r--r--indra/llinventory/llsettingssky.cpp41
1 files changed, 25 insertions, 16 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 0ba40e5e3d..e2fd681039 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -510,9 +510,9 @@ LLSettingsSky::validation_list_t LLSettingsSky::validationList()
LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")),
LLSD(LLSDArray(3.0f)(3.0f)(3.0f)("*")))));
validation.push_back(Validator(SETTING_DENSITY_MULTIPLIER, false, LLSD::TypeReal,
- boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(2.0f)))));
+ boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0001f)(2.0f)))));
validation.push_back(Validator(SETTING_DISTANCE_MULTIPLIER, false, LLSD::TypeReal,
- boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1000.0f)))));
+ boost::bind(&Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0001f)(1000.0f)))));
validation.push_back(Validator(SETTING_BLOOM_TEXTUREID, true, LLSD::TypeUUID));
@@ -870,7 +870,7 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
// original WL moon dir was diametrically opposed to the sun dir
LLQuaternion moonquat = convert_azimuth_and_altitude_to_quat(azimuth + F_PI, -altitude);
- newsettings[SETTING_SUN_ROTATION] = sunquat.getValue();
+ newsettings[SETTING_SUN_ROTATION] = sunquat.getValue();
newsettings[SETTING_MOON_ROTATION] = moonquat.getValue();
}
@@ -943,6 +943,19 @@ LLVector3 LLSettingsSky::getLightDirection() const
return LLVector3::z_axis;
}
+LLColor3 LLSettingsSky::getAmbientColor() const
+{
+ if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_AMBIENT))
+ {
+ return LLColor3(mSettings[SETTING_LEGACY_HAZE][SETTING_AMBIENT]);
+ }
+ if (mSettings.has(SETTING_AMBIENT))
+ {
+ return LLColor3(mSettings[SETTING_AMBIENT]);
+ }
+ return LLColor3(0.25f, 0.25f, 0.25f);
+}
+
LLColor3 LLSettingsSky::getBlueDensity() const
{
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(SETTING_BLUE_DENSITY))
@@ -1025,17 +1038,23 @@ void LLSettingsSky::setMieAnisotropy(F32 aniso_factor)
void LLSettingsSky::setSkyMoistureLevel(F32 moisture_level)
{
- mSettings[SETTING_SKY_MOISTURE_LEVEL] = moisture_level;
+ setValue(SETTING_SKY_MOISTURE_LEVEL, moisture_level);
}
void LLSettingsSky::setSkyDropletRadius(F32 radius)
{
- mSettings[SETTING_SKY_DROPLET_RADIUS] = radius;
+ setValue(SETTING_SKY_DROPLET_RADIUS,radius);
}
void LLSettingsSky::setSkyIceLevel(F32 ice_level)
{
- mSettings[SETTING_SKY_ICE_LEVEL] = ice_level;
+ setValue(SETTING_SKY_ICE_LEVEL, ice_level);
+}
+
+void LLSettingsSky::setAmbientColor(const LLColor3 &val)
+{
+ mSettings[SETTING_LEGACY_HAZE][SETTING_AMBIENT] = val.getValue();
+ setDirtyFlag(true);
}
void LLSettingsSky::setBlueDensity(const LLColor3 &val)
@@ -1342,16 +1361,6 @@ LLUUID LLSettingsSky::getHaloTextureId() const
}
//---------------------------------------------------------------------
-LLColor3 LLSettingsSky::getAmbientColor() const
-{
- return LLColor3(mSettings[SETTING_AMBIENT]);
-}
-
-void LLSettingsSky::setAmbientColor(const LLColor3 &val)
-{
- setValue(SETTING_AMBIENT, val);
-}
-
LLColor3 LLSettingsSky::getCloudColor() const
{
return LLColor3(mSettings[SETTING_CLOUD_COLOR]);