diff options
| author | Erik Kundiman <erik@megapahit.org> | 2025-09-09 12:51:38 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2025-09-09 12:51:38 +0800 |
| commit | 8a9a3dc9d760db37bb963d3e5bfadafdd94ee08d (patch) | |
| tree | 22f2533527d63df3736c638c4b9c7a8059ecb4ec /indra/newview/llstatusbar.cpp | |
| parent | 50fb526c1011d0dd623e312ff70365e32a6d50a7 (diff) | |
| parent | 12743eca6958b897d7eb3f0cf791ad8ada3fc790 (diff) | |
Merge branch 'main' into 2025.06
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
| -rw-r--r-- | indra/newview/llstatusbar.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index bf4ec14487..8793541e80 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -304,9 +304,21 @@ void LLStatusBar::refresh() mFpsUpdateTimer->reset(); S32 fps = (S32) llround(LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS, 50)); + if(fps < 1) fps = 1; + + S32 minFps = (S32) llround(LLTrace::get_frame_recording().getPeriodMinPerSec(LLStatViewer::FPS, 50)); + S32 maxFps = (S32) llround(LLTrace::get_frame_recording().getPeriodMaxPerSec(LLStatViewer::FPS, 50)); + + F32 fpsQuality = (F32)minFps / (F32)fps; + std::string fpsStr = std::to_string(fps); - //mTextFps->setText(fpsStr); + mTextFps->setLabel(fpsStr); + + if(fpsQuality < 0.5) mTextFps->setColor(LLColor4(0.6,0.0,0.0)); + else if(fpsQuality < 0.7) mTextFps->setColor(LLColor4(0.7,0.5,0.0)); + else if(fpsQuality < 0.9) mTextFps->setColor(LLColor4(0.5,0.7,0.0)); + else mTextFps->setColor(LLColor4(0.0, 0.7, 0.15)); } // update clock every 10 seconds |
