aboutsummaryrefslogtreecommitdiff
path: root/guilib/GUIMoverControl.cpp
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2009-09-23 10:03:22 +0000
committerjmarshallnz <jmarshallnz@svn>2009-09-23 10:03:22 +0000
commitc3018c6090df3c4cf3c5a96cc2310f931ef8f37f (patch)
treee22747627d63a591f15d9f87e15aa08cde10a563 /guilib/GUIMoverControl.cpp
parent59629d6966e46a99fc8e41a05f5e460d984997a4 (diff)
changed: DWORD -> unsigned int for frame-based timings, and moved to using CTimeUtils::Update/GetFrameTime() for UI timing.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23109 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIMoverControl.cpp')
-rw-r--r--guilib/GUIMoverControl.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/guilib/GUIMoverControl.cpp b/guilib/GUIMoverControl.cpp
index 098e890d8f..029df7fbb4 100644
--- a/guilib/GUIMoverControl.cpp
+++ b/guilib/GUIMoverControl.cpp
@@ -23,6 +23,7 @@
#include "GUIWindowManager.h"
#include "MouseStat.h"
#include "Key.h"
+#include "utils/TimeUtils.h"
// time to reset accelerated cursors (digital movement)
#define MOVE_TIME_OUT 500L
@@ -32,8 +33,8 @@ CGUIMoverControl::CGUIMoverControl(int parentID, int controlID, float posX, floa
, m_imgFocus(posX, posY, width, height, textureFocus)
, m_imgNoFocus(posX, posY, width, height, textureNoFocus)
{
- m_dwFrameCounter = 0;
- m_dwLastMoveTime = 0;
+ m_frameCounter = 0;
+ m_lastMoveTime = 0;
m_fSpeed = 1.0;
m_fAnalogSpeed = 2.0f; // TODO: implement correct analog speed
m_fAcceleration = 0.2f; // TODO: implement correct computation of acceleration
@@ -58,18 +59,18 @@ void CGUIMoverControl::Render()
}
if (HasFocus())
{
- DWORD dwAlphaCounter = m_dwFrameCounter + 2;
- DWORD dwAlphaChannel;
- if ((dwAlphaCounter % 128) >= 64)
- dwAlphaChannel = dwAlphaCounter % 64;
+ unsigned int alphaCounter = m_frameCounter + 2;
+ unsigned int alphaChannel;
+ if ((alphaCounter % 128) >= 64)
+ alphaChannel = alphaCounter % 64;
else
- dwAlphaChannel = 63 - (dwAlphaCounter % 64);
+ alphaChannel = 63 - (alphaCounter % 64);
- dwAlphaChannel += 192;
- SetAlpha( (unsigned char)dwAlphaChannel );
+ alphaChannel += 192;
+ SetAlpha( (unsigned char)alphaChannel );
m_imgFocus.SetVisible(true);
m_imgNoFocus.SetVisible(false);
- m_dwFrameCounter++;
+ m_frameCounter++;
}
else
{
@@ -151,12 +152,12 @@ bool CGUIMoverControl::OnMouseClick(int button, const CPoint &point)
void CGUIMoverControl::UpdateSpeed(int nDirection)
{
- if (timeGetTime() - m_dwLastMoveTime > MOVE_TIME_OUT)
+ if (CTimeUtils::GetFrameTime() - m_lastMoveTime > MOVE_TIME_OUT)
{
m_fSpeed = 1;
m_nDirection = DIRECTION_NONE;
}
- m_dwLastMoveTime = timeGetTime();
+ m_lastMoveTime = CTimeUtils::GetFrameTime();
if (nDirection == m_nDirection)
{ // accelerate
m_fSpeed += m_fAcceleration;
@@ -172,7 +173,7 @@ void CGUIMoverControl::UpdateSpeed(int nDirection)
void CGUIMoverControl::AllocResources()
{
CGUIControl::AllocResources();
- m_dwFrameCounter = 0;
+ m_frameCounter = 0;
m_imgFocus.AllocResources();
m_imgNoFocus.AllocResources();
float width = m_width ? m_width : m_imgFocus.GetWidth();