Skip to content

Commit

Permalink
Fix slow cursor animation with high framerates
Browse files Browse the repository at this point in the history
  • Loading branch information
dscharrer committed Mar 8, 2015
1 parent 7f87481 commit 8a52b15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/gui/MenuWidgets.cpp
Expand Up @@ -2822,7 +2822,7 @@ MenuCursor::MenuCursor()
bMouseOver=false;

m_currentFrame=0;
lFrameDiff=0;
lFrameDiff = 0.f;
}

MenuCursor::~MenuCursor()
Expand Down Expand Up @@ -2981,9 +2981,9 @@ void MenuCursor::DrawCursor() {
DrawOneCursor(GInput->getMousePosAbs());
GRenderer->SetRenderState(Renderer::DepthTest, true);

lFrameDiff += checked_range_cast<long>(ARXDiffTimeMenu);
lFrameDiff += ARXDiffTimeMenu;

if(lFrameDiff > 70) {
if(lFrameDiff > 70.f) {
if(bMouseOver) {
if(m_currentFrame < 4) {
m_currentFrame++;
Expand All @@ -3004,7 +3004,7 @@ void MenuCursor::DrawCursor() {
}
}

lFrameDiff=0;
lFrameDiff = 0.f;
}

GRenderer->SetRenderState(Renderer::AlphaBlending, false);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/MenuWidgets.h
Expand Up @@ -573,7 +573,7 @@ class MenuCursor {
float m_storedTime;

// Cursor
long lFrameDiff;
float lFrameDiff;
CURSORSTATE eNumTex;
int m_currentFrame;
bool bMouseOver;
Expand Down

0 comments on commit 8a52b15

Please sign in to comment.