diff options
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 227d0eac77..36bdcf4d89 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -362,6 +362,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable", boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this)); + mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreference::updateMaxComplexity, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); @@ -838,7 +839,7 @@ void LLFloaterPreference::setHardwareDefaults() LLFeatureManager::getInstance()->applyRecommendedSettings(); // reset indirects before refresh because we may have changed what they control - LLFloaterPreferenceGraphicsAdvanced::setIndirectControls(); + LLAvatarComplexityControls::setIndirectControls(); refreshEnabledGraphics(); gSavedSettings.setString("PresetGraphicActive", ""); @@ -1374,7 +1375,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() } // static -void LLFloaterPreferenceGraphicsAdvanced::setIndirectControls() +void LLAvatarComplexityControls::setIndirectControls() { /* * We have controls that have an indirect relationship between the control @@ -1390,7 +1391,7 @@ void LLFloaterPreferenceGraphicsAdvanced::setIndirectControls() } // static -void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxNonImpostors() +void LLAvatarComplexityControls::setIndirectMaxNonImpostors() { U32 max_non_impostors = gSavedSettings.getU32("RenderAvatarMaxNonImpostors"); // for this one, we just need to make zero, which means off, the max value of the slider @@ -1398,7 +1399,7 @@ void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxNonImpostors() gSavedSettings.setU32("IndirectMaxNonImpostors", indirect_max_non_impostors); } -void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxArc() +void LLAvatarComplexityControls::setIndirectMaxArc() { U32 max_arc = gSavedSettings.getU32("RenderAvatarMaxComplexity"); U32 indirect_max_arc; @@ -1567,6 +1568,9 @@ void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() void LLFloaterPreference::refresh() { LLPanel::refresh(); + LLAvatarComplexityControls::setText( + gSavedSettings.getU32("RenderAvatarMaxComplexity"), + getChild<LLTextBox>("IndirectMaxComplexityText", true)); refreshEnabledState(); LLFloater* advanced = LLFloaterReg::findTypedInstance<LLFloater>("prefs_graphics_advanced"); if (advanced) @@ -1591,9 +1595,13 @@ void LLFloaterPreferenceGraphicsAdvanced::refresh() updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess", true), getChild<LLTextBox>("PostProcessText", true)); updateSliderText(getChild<LLSliderCtrl>("SkyMeshDetail", true), getChild<LLTextBox>("SkyMeshDetailText", true)); updateSliderText(getChild<LLSliderCtrl>("TerrainDetail", true), getChild<LLTextBox>("TerrainDetailText", true)); - setIndirectControls(); - setMaxNonImpostorsText(gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),getChild<LLTextBox>("IndirectMaxNonImpostorsText", true)); - setMaxComplexityText(gSavedSettings.getU32("RenderAvatarMaxComplexity"),getChild<LLTextBox>("IndirectMaxComplexityText", true)); + LLAvatarComplexityControls::setIndirectControls(); + setMaxNonImpostorsText( + gSavedSettings.getU32("RenderAvatarMaxNonImpostors"), + getChild<LLTextBox>("IndirectMaxNonImpostorsText", true)); + LLAvatarComplexityControls::setText( + gSavedSettings.getU32("RenderAvatarMaxComplexity"), + getChild<LLTextBox>("IndirectMaxComplexityText", true)); refreshEnabledState(); } @@ -1904,12 +1912,11 @@ void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTe } } -void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() +void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label) { // Called when the IndirectMaxComplexity control changes // Responsible for fixing the slider label (IndirectMaxComplexityText) and setting RenderAvatarMaxComplexity - LLSliderCtrl* ctrl = getChild<LLSliderCtrl>("IndirectMaxComplexity"); - U32 indirect_value = ctrl->getValue().asInteger(); + U32 indirect_value = slider->getValue().asInteger(); U32 max_arc; if (INDIRECT_MAX_ARC_OFF == indirect_value) @@ -1927,10 +1934,10 @@ void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() } gSavedSettings.setU32("RenderAvatarMaxComplexity", (U32)max_arc); - setMaxComplexityText(max_arc, getChild<LLTextBox>("IndirectMaxComplexityText")); + setText(max_arc, value_label); } -void LLFloaterPreferenceGraphicsAdvanced::setMaxComplexityText(U32 value, LLTextBox* text_box) +void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box) { if (0 == value) { @@ -1942,6 +1949,22 @@ void LLFloaterPreferenceGraphicsAdvanced::setMaxComplexityText(U32 value, LLText } } +void LLFloaterPreference::updateMaxComplexity() +{ + // Called when the IndirectMaxComplexity control changes + LLAvatarComplexityControls::updateMax( + getChild<LLSliderCtrl>("IndirectMaxComplexity"), + getChild<LLTextBox>("IndirectMaxComplexityText")); +} + +void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() +{ + // Called when the IndirectMaxComplexity control changes + LLAvatarComplexityControls::updateMax( + getChild<LLSliderCtrl>("IndirectMaxComplexity"), + getChild<LLTextBox>("IndirectMaxComplexityText")); +} + void LLFloaterPreference::onChangeMaturity() { U8 sim_access = gSavedSettings.getU32("PreferredMaturity"); |