From ba9bff5b9bdd7904916c3ae844840c87376498c3 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 8 Jun 2022 01:21:42 +0300 Subject: SL-17541 Show the message that user is currently at maximum FPS --- indra/newview/llfloaterperformance.cpp | 20 +++++++++++++++++--- indra/newview/llfloaterperformance.h | 1 + .../skins/default/xui/en/floater_performance.xml | 8 +++++++- 3 files changed, 25 insertions(+), 4 deletions(-) (limited to 'indra/newview') 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("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("fps_value")->setValue(current_fps); + + std::string fps_text = getString("fps_text"); + static LLCachedControl vsync_enabled(gSavedSettings, "RenderVSyncEnable", true); + if (vsync_enabled && (current_fps >= gViewerWindow->getWindow()->getRefreshRate())) + { + fps_text += getString("max_text"); + } + getChild("fps_lbl")->setValue(fps_text); +} + void LLFloaterPerformance::detachItem(const LLUUID& item_id) { LLAppearanceMgr::instance().removeItemFromAvatar(item_id); diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 9ccb29cd7b..e40eee162d 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -57,6 +57,7 @@ private: void populateHUDList(); void populateObjectList(); void populateNearbyList(); + void setFPSText(); void onClickAdvanced(); void onChangeQuality(const LLSD& data); diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 0107c59868..bf2623f356 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -6,6 +6,12 @@ save_rect="true" title="IMPROVE GRAPHICS SPEED" width="580"> + + -- cgit v1.2.3