summaryrefslogtreecommitdiff
path: root/indra/newview/llstatusbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r--indra/newview/llstatusbar.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index ecbbc4b2c5..1bab602364 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -109,6 +109,7 @@ static void onClickVolume(void*);
LLStatusBar::LLStatusBar(const LLRect& rect)
: LLPanel(),
mTextTime(NULL),
+ mTextFps(NULL),
mSGBandwidth(NULL),
mSGPacketLoss(NULL),
mBtnVolume(NULL),
@@ -127,6 +128,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
mBalanceTimer = new LLFrameTimer();
mHealthTimer = new LLFrameTimer();
+ mFpsUpdateTimer = new LLFrameTimer();
buildFromFile("panel_status_bar.xml");
}
@@ -165,6 +167,9 @@ bool LLStatusBar::postBuild()
mTextTime = getChild<LLTextBox>("TimeText" );
+ mTextFps = getChild<LLButton>("FpsText");
+ mTextFps->setClickedCallback( &LLStatusBar::onClickFps, this );
+
getChild<LLUICtrl>("buyL")->setCommitCallback(
boost::bind(&LLStatusBar::onClickBuyCurrency, this));
@@ -297,6 +302,16 @@ void LLStatusBar::refresh()
//mSGBandwidth->setThreshold(2, bwtotal);
}
+ if(mFpsUpdateTimer->getElapsedTimeF32() >= 1.0f)
+ {
+ mFpsUpdateTimer->reset();
+
+ S32 fps = (S32) llround(LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS, 50));
+ std::string fpsStr = std::to_string(fps);
+ //mTextFps->setText(fpsStr);
+ mTextFps->setLabel(fpsStr);
+ }
+
// update clock every 10 seconds
if(mClockUpdateTimer.getElapsedTimeF32() > 10.f)
{
@@ -637,6 +652,12 @@ void LLStatusBar::onClickMediaToggle(void* data)
LLViewerMedia::getInstance()->setAllMediaPaused(pause);
}
+//static
+void LLStatusBar::onClickFps(void* data)
+{
+ LLFloaterReg::toggleInstance("mpv_performance");
+}
+
bool can_afford_transaction(S32 cost)
{
return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost)));