diff options
| author | Graham Linden <graham@lindenlab.com> | 2018-10-18 21:18:40 +0100 | 
|---|---|---|
| committer | Graham Linden <graham@lindenlab.com> | 2018-10-18 21:18:40 +0100 | 
| commit | 3447621a15c14a6a23a9827cfbb2e244ce91e8c0 (patch) | |
| tree | 06d3c71c052c1776b0e6c103d919c835266f67d4 /indra/llinventory | |
| parent | d8ed800991feaa3264f36f8e62f054bf0fe4d448 (diff) | |
Port sim-side changes to back-conversion of new settings to legacy.
Fix validating of density multiplier to clamp >= 0.0001f.
Port fix to setter for ambient color in sky settings.
Diffstat (limited to 'indra/llinventory')
| -rw-r--r-- | indra/llinventory/llsettingssky.cpp | 41 | 
1 files changed, 25 insertions, 16 deletions
| diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 61e31df663..0093d84cef 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]); | 
