summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterperformance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterperformance.cpp')
-rw-r--r--indra/newview/llfloaterperformance.cpp38
1 files changed, 32 insertions, 6 deletions
diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp
index 88319b170f..ba45648bd9 100644
--- a/indra/newview/llfloaterperformance.cpp
+++ b/indra/newview/llfloaterperformance.cpp
@@ -148,6 +148,15 @@ BOOL LLFloaterPerformance::postBuild()
gSavedSettings.setF32("AutoTuneRenderFarClipTarget", LLPipeline::RenderFarClip);
}
+ LLStringExplicit fps_limit(llformat("%d", gViewerWindow->getWindow()->getRefreshRate()));
+ mAutoadjustmentsPanel->getChild<LLTextBox>("vsync_desc_limit")->setTextArg("[FPS_LIMIT]", fps_limit);
+ mAutoadjustmentsPanel->getChild<LLTextBox>("display_desc")->setTextArg("[FPS_LIMIT]", fps_limit);
+
+ mStartAutotuneBtn = mAutoadjustmentsPanel->getChild<LLButton>("start_autotune");
+ mStopAutotuneBtn = mAutoadjustmentsPanel->getChild<LLButton>("stop_autotune");
+ mStartAutotuneBtn->setCommitCallback(boost::bind(&LLFloaterPerformance::startAutotune, this));
+ mStopAutotuneBtn->setCommitCallback(boost::bind(&LLFloaterPerformance::stopAutotune, this));
+
return TRUE;
}
@@ -195,14 +204,10 @@ void LLFloaterPerformance::draw()
populateObjectList();
}
- auto button = getChild<LLButton>("AutoTuneFPS");
- if((bool)button->getToggleState() != LLPerfStats::tunables.userAutoTuneEnabled)
- {
- button->toggleState();
- }
-
mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL);
}
+ updateAutotuneCtrls(LLPerfStats::tunables.userAutoTuneEnabled);
+
LLFloater::draw();
}
@@ -645,4 +650,25 @@ void LLFloaterPerformance::onClickShadows()
}
}
+
+void LLFloaterPerformance::startAutotune()
+{
+ LLPerfStats::tunables.userAutoTuneEnabled = true;
+}
+
+void LLFloaterPerformance::stopAutotune()
+{
+ LLPerfStats::tunables.userAutoTuneEnabled = false;
+}
+
+void LLFloaterPerformance::updateAutotuneCtrls(bool autotune_enabled)
+{
+ static LLCachedControl<bool> auto_tune_locked(gSavedSettings, "AutoTuneLock");
+ mStartAutotuneBtn->setEnabled(!autotune_enabled && !auto_tune_locked);
+ mStopAutotuneBtn->setEnabled(autotune_enabled && !auto_tune_locked);
+ getChild<LLCheckBoxCtrl>("AutoTuneContinuous")->setEnabled(!autotune_enabled || (autotune_enabled && auto_tune_locked));
+
+ getChild<LLTextBox>("wip_desc")->setVisible(autotune_enabled && !auto_tune_locked);
+ getChild<LLTextBox>("display_desc")->setVisible(LLPerfStats::tunables.vsyncEnabled);
+}
// EOF