summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorJonathan Yap <jhwelch@gmail.com>2015-01-14 19:55:58 -0500
committerJonathan Yap <jhwelch@gmail.com>2015-01-14 19:55:58 -0500
commitd1bc2fe292edcea60b49ce8111a495974e9415a2 (patch)
tree130d327294f0ab9cab983b012f0bf9a456c1e0c7 /indra/newview/llfloaterpreference.cpp
parentf6a1980c256474b96d5fe7943bfe1bd582826860 (diff)
STORM-2082 Assorted UI tweaks, better MaximumARC formula, pulldowns disappear faster
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rwxr-xr-xindra/newview/llfloaterpreference.cpp54
1 files changed, 30 insertions, 24 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 6e340864bc..4b83b104fd 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1475,7 +1475,7 @@ void LLFloaterPreference::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));
- updateSliderText(getChild<LLSliderCtrl>("MaximumARC", true), getChild<LLTextBox>("MaximumARCText", true));
+ updateMaximumArcText(getChild<LLSliderCtrl>("MaximumARC", true), getChild<LLTextBox>("MaximumARCText", true));
}
void LLFloaterPreference::onCommitWindowedMode()
@@ -1731,8 +1731,6 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b
{
if (text_box == NULL || ctrl== NULL)
return;
-
- std::string name = ctrl->getName();
// get range and points when text should change
F32 value = (F32)ctrl->getValue().asReal();
@@ -1756,35 +1754,43 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b
{
text_box->setText(LLTrans::getString("GraphicsQualityHigh"));
}
+}
+
+void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box)
+{
+ F32 min_result = 20000.0f;
+ F32 max_result = 300000.0f;
- if ("MaximumARC" == name)
+ F32 value = (F32)ctrl->getValue().asReal();
+
+ if (0.0f == value)
+ {
+ text_box->setText(LLTrans::getString("Off"));
+ }
+ else
{
- F32 control_value = value;
- if (0.0f == control_value)
- {
- text_box->setText(LLTrans::getString("Off"));
- }
- else
- {
- // 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);
+ // Invert value because a higher value on the slider control needs a decreasing final
+ // value in order to obtain larger numbers of imposters
+ value = 100.0f - value;
- // calculate adjustment factor
- F32 scale = (maxv - minv) / (maxp - minp);
+ // 100 is the maximum value of this control set in panel_preferences_graphics1.xml
+ F32 minp = 0.0f;
+ F32 maxp = 99.0f;
- control_value = exp(minv + scale * (control_value - minp));
+ // The result should be between min_result and max_result
+ F32 minv = log(min_result);
+ F32 maxv = log(max_result);
- // Invert result
- control_value = 500000.0f - control_value;
- }
+ // calculate adjustment factor
+ F32 scale = (maxv - minv) / (maxp - minp);
- gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value);
+ value = exp(minv + scale * (value - minp));
+
+ text_box->setText(llformat("%0.0f", value));
}
+
+ gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)value);
}
void LLFloaterPreference::onChangeMaturity()