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.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp
index c89c58c401..ecacadee3e 100644
--- a/indra/newview/llfloaterperformance.cpp
+++ b/indra/newview/llfloaterperformance.cpp
@@ -43,6 +43,7 @@
#include "lltextbox.h"
#include "lltrans.h"
#include "llviewerobjectlist.h"
+#include "llviewerwindow.h"
#include "llvoavatar.h"
#include "llvoavatarself.h"
#include "llworld.h"
@@ -162,11 +163,9 @@ void LLFloaterPerformance::showSelectedPanel(LLPanel* selected_panel)
void LLFloaterPerformance::draw()
{
- const S32 NUM_PERIODS = 50;
-
if (mUpdateTimer->hasExpired())
{
- getChild<LLTextBox>("fps_value")->setValue((S32)llround(LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS, NUM_PERIODS)));
+ setFPSText();
if (mHUDsPanel->getVisible())
{
populateHUDList();
@@ -409,6 +408,21 @@ void LLFloaterPerformance::populateNearbyList()
mNearbyList->selectByID(prev_selected_id);
}
+void LLFloaterPerformance::setFPSText()
+{
+ const S32 NUM_PERIODS = 50;
+ S32 current_fps = (S32)llround(LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS, NUM_PERIODS));
+ getChild<LLTextBox>("fps_value")->setValue(current_fps);
+
+ std::string fps_text = getString("fps_text");
+ static LLCachedControl<bool> vsync_enabled(gSavedSettings, "RenderVSyncEnable", true);
+ if (vsync_enabled && (current_fps >= gViewerWindow->getWindow()->getRefreshRate()))
+ {
+ fps_text += getString("max_text");
+ }
+ getChild<LLTextBox>("fps_lbl")->setValue(fps_text);
+}
+
void LLFloaterPerformance::detachItem(const LLUUID& item_id)
{
LLAppearanceMgr::instance().removeItemFromAvatar(item_id);