summaryrefslogtreecommitdiff
path: root/indra/llui/llflashtimer.cpp
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2012-11-21 01:41:49 +0200
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2012-11-21 01:41:49 +0200
commitedeeed95416be2679e1ad3d29bab5396dbcccaa2 (patch)
tree14699bebd00d0a4330fed43c3aa47f83259cf9f2 /indra/llui/llflashtimer.cpp
parent7f19e6de5c55c1a28d329fbd6dea728f48b99495 (diff)
CHUI-531 FIXED Poor fps in CHUI viewer
Diffstat (limited to 'indra/llui/llflashtimer.cpp')
-rw-r--r--indra/llui/llflashtimer.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp
index c572a83ff5..2ad86b5751 100644
--- a/indra/llui/llflashtimer.cpp
+++ b/indra/llui/llflashtimer.cpp
@@ -33,15 +33,15 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
: LLEventTimer(period)
, mCallback(cb)
, mCurrentTickCount(0)
- , mIsFlashing(false)
+ , mIsFlashingInProgress(false)
{
mEventTimer.stop();
// By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973.
// Due to Timer is implemented as derived class from EventTimer it is impossible to change period
// in runtime. So, both settings are made as required restart.
- mFlashCount = 2 * ((count>0)? count : gSavedSettings.getS32("FlashCount"));
- if (mPeriod<=0)
+ mFlashCount = 2 * ((count > 0) ? count : gSavedSettings.getS32("FlashCount"));
+ if (mPeriod <= 0)
{
mPeriod = gSavedSettings.getF32("FlashPeriod");
}
@@ -49,15 +49,18 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
BOOL LLFlashTimer::tick()
{
- mIsHighlight = !(mCurrentTickCount % 2);
+ mIsCurrentlyHighlighted = !mIsCurrentlyHighlighted;
+
if (mCallback)
{
- mCallback(mIsHighlight);
+ mCallback(mIsCurrentlyHighlighted);
}
if (++mCurrentTickCount >= mFlashCount)
{
mEventTimer.stop();
+ mCurrentTickCount = 0;
+ mIsFlashingInProgress = false;
}
return FALSE;
@@ -65,15 +68,14 @@ BOOL LLFlashTimer::tick()
void LLFlashTimer::startFlashing()
{
- mCurrentTickCount = 0;
- mIsFlashing = true;
+ mIsFlashingInProgress = true;
mEventTimer.start();
}
void LLFlashTimer::stopFlashing()
{
- mIsFlashing = false;
- mIsHighlight = false;
+ mIsFlashingInProgress = false;
+ mIsCurrentlyHighlighted = false;
mEventTimer.stop();
}