diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpaneleditsky.cpp | 32 | ||||
-rw-r--r-- | indra/newview/llpaneleditwater.cpp | 13 |
2 files changed, 43 insertions, 2 deletions
diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index aaa54ed2e9..8bcc546133 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -208,6 +208,7 @@ void LLPanelSettingsSkyAtmosTab::refresh() //------------------------------------------------------------------------- void LLPanelSettingsSkyAtmosTab::onAmbientLightChanged() { + if (!mSkySettings) return; mSkySettings->setAmbientColor(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_AMBIENT_LIGHT)->get() * SLIDER_SCALE_SUN_AMBIENT)); mSkySettings->update(); setIsDirty(); @@ -215,6 +216,7 @@ void LLPanelSettingsSkyAtmosTab::onAmbientLightChanged() void LLPanelSettingsSkyAtmosTab::onBlueHorizonChanged() { + if (!mSkySettings) return; mSkySettings->setBlueHorizon(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_HORIZON)->get() * SLIDER_SCALE_BLUE_HORIZON_DENSITY)); mSkySettings->update(); setIsDirty(); @@ -222,6 +224,7 @@ void LLPanelSettingsSkyAtmosTab::onBlueHorizonChanged() void LLPanelSettingsSkyAtmosTab::onBlueDensityChanged() { + if (!mSkySettings) return; mSkySettings->setBlueDensity(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_DENSITY)->get() * SLIDER_SCALE_BLUE_HORIZON_DENSITY)); mSkySettings->update(); setIsDirty(); @@ -229,6 +232,7 @@ void LLPanelSettingsSkyAtmosTab::onBlueDensityChanged() void LLPanelSettingsSkyAtmosTab::onHazeHorizonChanged() { + if (!mSkySettings) return; mSkySettings->setHazeHorizon(getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->getValue().asReal()); mSkySettings->update(); setIsDirty(); @@ -236,6 +240,7 @@ void LLPanelSettingsSkyAtmosTab::onHazeHorizonChanged() void LLPanelSettingsSkyAtmosTab::onHazeDensityChanged() { + if (!mSkySettings) return; mSkySettings->setHazeDensity(getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->getValue().asReal()); mSkySettings->update(); setIsDirty(); @@ -243,6 +248,7 @@ void LLPanelSettingsSkyAtmosTab::onHazeDensityChanged() void LLPanelSettingsSkyAtmosTab::onSceneGammaChanged() { + if (!mSkySettings) return; mSkySettings->setGamma(getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->getValue().asReal()); mSkySettings->update(); setIsDirty(); @@ -250,6 +256,7 @@ void LLPanelSettingsSkyAtmosTab::onSceneGammaChanged() void LLPanelSettingsSkyAtmosTab::onDensityMultipChanged() { + if (!mSkySettings) return; F32 density_mult = getChild<LLUICtrl>(FIELD_SKY_DENSITY_MULTIP)->getValue().asReal(); density_mult *= SLIDER_SCALE_DENSITY_MULTIPLIER; mSkySettings->setDensityMultiplier(density_mult); @@ -259,6 +266,7 @@ void LLPanelSettingsSkyAtmosTab::onDensityMultipChanged() void LLPanelSettingsSkyAtmosTab::onDistanceMultipChanged() { + if (!mSkySettings) return; mSkySettings->setDistanceMultiplier(getChild<LLUICtrl>(FIELD_SKY_DISTANCE_MULTIP)->getValue().asReal()); mSkySettings->update(); setIsDirty(); @@ -266,6 +274,7 @@ void LLPanelSettingsSkyAtmosTab::onDistanceMultipChanged() void LLPanelSettingsSkyAtmosTab::onMaxAltChanged() { + if (!mSkySettings) return; mSkySettings->setMaxY(getChild<LLUICtrl>(FIELD_SKY_MAX_ALT)->getValue().asReal()); mSkySettings->update(); setIsDirty(); @@ -273,6 +282,7 @@ void LLPanelSettingsSkyAtmosTab::onMaxAltChanged() void LLPanelSettingsSkyAtmosTab::onMoistureLevelChanged() { + if (!mSkySettings) return; F32 moisture_level = getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->getValue().asReal(); mSkySettings->setSkyMoistureLevel(moisture_level); mSkySettings->update(); @@ -280,7 +290,8 @@ void LLPanelSettingsSkyAtmosTab::onMoistureLevelChanged() } void LLPanelSettingsSkyAtmosTab::onDropletRadiusChanged() -{ +{ + if (!mSkySettings) return; F32 droplet_radius = getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->getValue().asReal(); mSkySettings->setSkyDropletRadius(droplet_radius); mSkySettings->update(); @@ -289,6 +300,7 @@ void LLPanelSettingsSkyAtmosTab::onDropletRadiusChanged() void LLPanelSettingsSkyAtmosTab::onIceLevelChanged() { + if (!mSkySettings) return; F32 ice_level = getChild<LLUICtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->getValue().asReal(); mSkySettings->setSkyIceLevel(ice_level); mSkySettings->update(); @@ -381,6 +393,7 @@ void LLPanelSettingsSkyCloudTab::refresh() //------------------------------------------------------------------------- void LLPanelSettingsSkyCloudTab::onCloudColorChanged() { + if (!mSkySettings) return; mSkySettings->setCloudColor(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_CLOUD_COLOR)->get())); mSkySettings->update(); setIsDirty(); @@ -388,6 +401,7 @@ void LLPanelSettingsSkyCloudTab::onCloudColorChanged() void LLPanelSettingsSkyCloudTab::onCloudCoverageChanged() { + if (!mSkySettings) return; mSkySettings->setCloudShadow(getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->getValue().asReal()); mSkySettings->update(); setIsDirty(); @@ -395,18 +409,21 @@ void LLPanelSettingsSkyCloudTab::onCloudCoverageChanged() void LLPanelSettingsSkyCloudTab::onCloudScaleChanged() { + if (!mSkySettings) return; mSkySettings->setCloudScale(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsSkyCloudTab::onCloudVarianceChanged() { + if (!mSkySettings) return; mSkySettings->setCloudVariance(getChild<LLUICtrl>(FIELD_SKY_CLOUD_VARIANCE)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsSkyCloudTab::onCloudScrollChanged() { + if (!mSkySettings) return; LLVector2 scroll(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_XY)->getValue()); mSkySettings->setCloudScrollRate(scroll); setIsDirty(); @@ -414,6 +431,7 @@ void LLPanelSettingsSkyCloudTab::onCloudScrollChanged() void LLPanelSettingsSkyCloudTab::onCloudMapChanged() { + if (!mSkySettings) return; LLTextureCtrl* ctrl = getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP); mSkySettings->setCloudNoiseTextureId(ctrl->getValue().asUUID()); setIsDirty(); @@ -421,6 +439,7 @@ void LLPanelSettingsSkyCloudTab::onCloudMapChanged() void LLPanelSettingsSkyCloudTab::onCloudDensityChanged() { + if (!mSkySettings) return; LLColor3 density(getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->getValue().asReal(), getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->getValue().asReal(), getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_D)->getValue().asReal()); @@ -431,6 +450,7 @@ void LLPanelSettingsSkyCloudTab::onCloudDensityChanged() void LLPanelSettingsSkyCloudTab::onCloudDetailChanged() { + if (!mSkySettings) return; LLColor3 detail(getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_X)->getValue().asReal(), getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_Y)->getValue().asReal(), getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_D)->getValue().asReal()); @@ -525,6 +545,7 @@ void LLPanelSettingsSkySunMoonTab::refresh() //------------------------------------------------------------------------- void LLPanelSettingsSkySunMoonTab::onSunMoonColorChanged() { + if (!mSkySettings) return; LLColor3 color(getChild<LLColorSwatchCtrl>(FIELD_SKY_SUN_MOON_COLOR)->get()); color *= SLIDER_SCALE_SUN_AMBIENT; @@ -536,6 +557,7 @@ void LLPanelSettingsSkySunMoonTab::onSunMoonColorChanged() void LLPanelSettingsSkySunMoonTab::onGlowChanged() { + if (!mSkySettings) return; LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal()); // takes 0 - 1.99 UI range -> 40 -> 0.2 range @@ -549,6 +571,7 @@ void LLPanelSettingsSkySunMoonTab::onGlowChanged() void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged() { + if (!mSkySettings) return; mSkySettings->setStarBrightness(getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal()); mSkySettings->update(); setIsDirty(); @@ -556,6 +579,7 @@ void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged() void LLPanelSettingsSkySunMoonTab::onSunRotationChanged() { + if (!mSkySettings) return; mSkySettings->setSunRotation(getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->getRotation()); mSkySettings->update(); setIsDirty(); @@ -563,6 +587,7 @@ void LLPanelSettingsSkySunMoonTab::onSunRotationChanged() void LLPanelSettingsSkySunMoonTab::onSunScaleChanged() { + if (!mSkySettings) return; mSkySettings->setSunScale((getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->getValue().asReal())); mSkySettings->update(); setIsDirty(); @@ -570,6 +595,7 @@ void LLPanelSettingsSkySunMoonTab::onSunScaleChanged() void LLPanelSettingsSkySunMoonTab::onSunImageChanged() { + if (!mSkySettings) return; mSkySettings->setSunTextureId(getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->getValue().asUUID()); mSkySettings->update(); setIsDirty(); @@ -577,6 +603,7 @@ void LLPanelSettingsSkySunMoonTab::onSunImageChanged() void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged() { + if (!mSkySettings) return; mSkySettings->setMoonRotation(getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->getRotation()); mSkySettings->update(); setIsDirty(); @@ -584,6 +611,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged() void LLPanelSettingsSkySunMoonTab::onMoonImageChanged() { + if (!mSkySettings) return; mSkySettings->setMoonTextureId(getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->getValue().asUUID()); mSkySettings->update(); setIsDirty(); @@ -591,6 +619,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonImageChanged() void LLPanelSettingsSkySunMoonTab::onMoonScaleChanged() { + if (!mSkySettings) return; mSkySettings->setMoonScale((getChild<LLUICtrl>(FIELD_SKY_MOON_SCALE)->getValue().asReal())); mSkySettings->update(); setIsDirty(); @@ -598,6 +627,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonScaleChanged() void LLPanelSettingsSkySunMoonTab::onMoonBrightnessChanged() { + if (!mSkySettings) return; mSkySettings->setMoonBrightness((getChild<LLUICtrl>(FIELD_SKY_MOON_BRIGHTNESS)->getValue().asReal())); mSkySettings->update(); setIsDirty(); diff --git a/indra/newview/llpaneleditwater.cpp b/indra/newview/llpaneleditwater.cpp index d8b97b714b..deba7f487f 100644 --- a/indra/newview/llpaneleditwater.cpp +++ b/indra/newview/llpaneleditwater.cpp @@ -162,31 +162,35 @@ void LLPanelSettingsWaterMainTab::refresh() void LLPanelSettingsWaterMainTab::onFogColorChanged() { + if (!mWaterSettings) return; mWaterSettings->setWaterFogColor(LLColor3(mClrFogColor->get())); setIsDirty(); } void LLPanelSettingsWaterMainTab::onFogDensityChanged() { + if (!mWaterSettings) return; mWaterSettings->setWaterFogDensity(getChild<LLUICtrl>(FIELD_WATER_FOG_DENSITY)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onFogUnderWaterChanged() { + if (!mWaterSettings) return; mWaterSettings->setFogMod(getChild<LLUICtrl>(FIELD_WATER_UNDERWATER_MOD)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onNormalMapChanged() { + if (!mWaterSettings) return; mWaterSettings->setNormalMapID(mTxtNormalMap->getImageAssetID()); setIsDirty(); } - void LLPanelSettingsWaterMainTab::onLargeWaveChanged() { + if (!mWaterSettings) return; LLVector2 vect(getChild<LLUICtrl>(FIELD_WATER_WAVE1_XY)->getValue()); vect *= -1.0; // Flip so that north and east are - mWaterSettings->setWave1Dir(vect); @@ -195,6 +199,7 @@ void LLPanelSettingsWaterMainTab::onLargeWaveChanged() void LLPanelSettingsWaterMainTab::onSmallWaveChanged() { + if (!mWaterSettings) return; LLVector2 vect(getChild<LLUICtrl>(FIELD_WATER_WAVE2_XY)->getValue()); vect *= -1.0; // Flip so that north and east are - mWaterSettings->setWave2Dir(vect); @@ -204,6 +209,7 @@ void LLPanelSettingsWaterMainTab::onSmallWaveChanged() void LLPanelSettingsWaterMainTab::onNormalScaleChanged() { + if (!mWaterSettings) return; LLVector3 vect(getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_X)->getValue().asReal(), getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_Y)->getValue().asReal(), getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_Z)->getValue().asReal()); mWaterSettings->setNormalScale(vect); setIsDirty(); @@ -211,30 +217,35 @@ void LLPanelSettingsWaterMainTab::onNormalScaleChanged() void LLPanelSettingsWaterMainTab::onFresnelScaleChanged() { + if (!mWaterSettings) return; mWaterSettings->setFresnelScale(getChild<LLUICtrl>(FIELD_WATER_FRESNEL_SCALE)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onFresnelOffsetChanged() { + if (!mWaterSettings) return; mWaterSettings->setFresnelOffset(getChild<LLUICtrl>(FIELD_WATER_FRESNEL_OFFSET)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onScaleAboveChanged() { + if (!mWaterSettings) return; mWaterSettings->setScaleAbove(getChild<LLUICtrl>(FIELD_WATER_SCALE_ABOVE)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onScaleBelowChanged() { + if (!mWaterSettings) return; mWaterSettings->setScaleBelow(getChild<LLUICtrl>(FIELD_WATER_SCALE_BELOW)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onBlurMultipChanged() { + if (!mWaterSettings) return; mWaterSettings->setBlurMultiplier(getChild<LLUICtrl>(FIELD_WATER_BLUR_MULTIP)->getValue().asReal()); setIsDirty(); } |