diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 75 | ||||
-rwxr-xr-x | indra/newview/llfloaterpreference.h | 2 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 5 |
3 files changed, 47 insertions, 35 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c7b4ae8ddc..6e5b75e80b 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -864,13 +864,10 @@ void LLFloaterPreference::onBtnOK() pPathfindingConsole->onRegionBoundaryCross(); } - if (LLStartUp::getStartupState() == STATE_STARTED) - { - // Write settings to currently defined preset. This will recreate a missing preset file - // and ensure the preset file matches the current settings (which may have been changed - // via some other means). - LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); - } + // Write settings to currently defined preset. This will recreate a missing preset file + // and ensure the preset file matches the current settings (which may have been changed + // via some other means). + LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); } // static @@ -1208,6 +1205,7 @@ void LLFloaterPreference::refreshEnabledState() gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); /* Disabling this block of code because canUseAntiAliasing currently always returns true // anti-aliasing @@ -1408,19 +1406,19 @@ void LLFloaterPreference::refresh() // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes - updateSliderText(getChild<LLSliderCtrl>("ObjectMeshDetail", true), getChild<LLTextBox>("ObjectMeshDetailText", true), "ObjectMeshDetail"); - updateSliderText(getChild<LLSliderCtrl>("FlexibleMeshDetail", true), getChild<LLTextBox>("FlexibleMeshDetailText", true), "FlexibleMeshDetail"); - updateSliderText(getChild<LLSliderCtrl>("TreeMeshDetail", true), getChild<LLTextBox>("TreeMeshDetailText", true), "TreeMeshDetail"); - updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail", true), getChild<LLTextBox>("AvatarMeshDetailText", true), "AvatarMeshDetail"); - updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail2", true), getChild<LLTextBox>("AvatarMeshDetailText2", true), "AvatarMeshDetail2"); - updateSliderText(getChild<LLSliderCtrl>("AvatarPhysicsDetail", true), getChild<LLTextBox>("AvatarPhysicsDetailText", true), "AvatarPhysicsDetail"); - updateSliderText(getChild<LLSliderCtrl>("TerrainMeshDetail", true), getChild<LLTextBox>("TerrainMeshDetailText", true), "TerrainMeshDetail"); - updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess", true), getChild<LLTextBox>("PostProcessText", true), "RenderPostProcess"); - updateSliderText(getChild<LLSliderCtrl>("SkyMeshDetail", true), getChild<LLTextBox>("SkyMeshDetailText", true), "SkyMeshDetail"); - updateSliderText(getChild<LLSliderCtrl>("TerrainDetail", true), getChild<LLTextBox>("TerrainDetailText", true), "TerrainDetail"); - updateSliderText(getChild<LLSliderCtrl>("MaximumARC", true), getChild<LLTextBox>("MaximumARCText", true), "MaximumARC"); - updateSliderText(getChild<LLSliderCtrl>("Reflections", true), getChild<LLTextBox>("ReflectionsText", true), "Reflections"); - updateSliderText(getChild<LLSliderCtrl>("ShadowDetail", true), getChild<LLTextBox>("RenderShadowDetailText", true), "ShadowDetail"); + updateSliderText(getChild<LLSliderCtrl>("ObjectMeshDetail", true), getChild<LLTextBox>("ObjectMeshDetailText", true)); + updateSliderText(getChild<LLSliderCtrl>("FlexibleMeshDetail", true), getChild<LLTextBox>("FlexibleMeshDetailText", true)); + updateSliderText(getChild<LLSliderCtrl>("TreeMeshDetail", true), getChild<LLTextBox>("TreeMeshDetailText", true)); + updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail", true), getChild<LLTextBox>("AvatarMeshDetailText", true)); + updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail2", true), getChild<LLTextBox>("AvatarMeshDetailText2", true)); + updateSliderText(getChild<LLSliderCtrl>("AvatarPhysicsDetail", true), getChild<LLTextBox>("AvatarPhysicsDetailText", true)); + updateSliderText(getChild<LLSliderCtrl>("TerrainMeshDetail", true), getChild<LLTextBox>("TerrainMeshDetailText", true)); + 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)); + updateSliderText(getChild<LLSliderCtrl>("MaximumARC", true), getChild<LLTextBox>("MaximumARCText", true)); + updateSliderText(getChild<LLSliderCtrl>("Reflections", true), getChild<LLTextBox>("ReflectionsText", true)); + updateSliderText(getChild<LLSliderCtrl>("ShadowDetail", true), getChild<LLTextBox>("RenderShadowDetailText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1672,19 +1670,12 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name) +void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) { if (text_box == NULL || ctrl== NULL) return; - // get range and points when text should change - F32 value = (F32)ctrl->getValue().asReal(); - F32 min = ctrl->getMinValue(); - F32 max = ctrl->getMaxValue(); - F32 range = max - min; - llassert(range > 0); - F32 midPoint = min + range / 3.0f; - F32 highPoint = min + (2.0f * range / 3.0f); + std::string name = ctrl->getName(); if ("ShadowDetail" == name) { @@ -1700,6 +1691,15 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b return; } + // get range and points when text should change + F32 value = (F32)ctrl->getValue().asReal(); + F32 min = ctrl->getMinValue(); + F32 max = ctrl->getMaxValue(); + F32 range = max - min; + llassert(range > 0); + F32 midPoint = min + range / 3.0f; + F32 highPoint = min + (2.0f * range / 3.0f); + // choose the right text if (value < midPoint) { @@ -1723,8 +1723,21 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b } else { - // 13 is the maximum value of this control set in panel_preferences_graphics1.xml - control_value = exp(13.0f - control_value) + 20000.0f; + // 100 is the maximum value of this control set in panel_preferences_graphics1.xml + F32 minp = 0.0f; + F32 maxp = 100.0f; + + // The result should be between 20,000 and 500,000 + F32 minv = log(20000.0f); + F32 maxv = log(500000.0f); + + // calculate adjustment factor + F32 scale = (maxv - minv) / (maxp - minp); + + control_value = exp(minv + scale * (control_value - minp)); + + // Invert result + control_value = 500000.0f - control_value; } gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index eebc0849ee..12230c2877 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -156,7 +156,7 @@ public: // if the quality radio buttons are changed void onChangeQuality(const LLSD& data); - void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name); + void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); void refreshUI(); void onCommitParcelMediaAutoPlayEnable(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 43b9d6003f..4636313f94 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -550,13 +550,13 @@ follows="left|top" height="16" initial_value="0" - increment=".1" + increment="1" label="Maximum ARC:" label_width="185" layout="topleft" left="30" min_val="0" - max_val="13" + max_val="100" name="MaximumARC" show_text="false" top_delta="16" @@ -1158,6 +1158,5 @@ <button.commit_callback function="Pref.HardwareDefaults" /> </button> - </tab_container> </panel> |