Skip to content

Commit

Permalink
Hud: Use platform time for spell icon flicking
Browse files Browse the repository at this point in the history
Fix wrong time used in 5f14c26.
  • Loading branch information
bsxf-47 committed Apr 19, 2017
1 parent 10cad0c commit d38aca1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/gui/Hud.cpp
Expand Up @@ -1106,16 +1106,16 @@ void ActiveSpellsGui::init() {
m_spacerSize = Vec2f(60.f, 50.f);
m_slotSpacerSize = Vec2f(0.f, 9.f);
m_flickNow = false;
m_flickTime = ArxDuration_ZERO;
m_flickInterval = ArxDurationMs(1000.0f / 60.0f);
m_flickTime = PlatformDuration_ZERO;
m_flickInterval = PlatformDurationMs(1000.0f / 60.0f);
}

void ActiveSpellsGui::update(Rectf parent) {

float intensity = 1.f - PULSATE * 0.5f;
intensity = glm::clamp(intensity, 0.f, 1.f);

m_flickTime += ArxDurationMs(g_framedelay);
m_flickTime += g_platformTime.lastFrameDuration();

if(m_flickTime >= m_flickInterval) {
m_flickNow = !m_flickNow;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/Hud.h
Expand Up @@ -324,8 +324,8 @@ class ActiveSpellsGui : public HudItem {
Vec2f m_spacerSize;
Vec2f m_slotSpacerSize;
bool m_flickNow;
ArxDuration m_flickTime;
ArxDuration m_flickInterval;
PlatformDuration m_flickTime;
PlatformDuration m_flickInterval;

std::vector<ActiveSpellIconSlot> m_slots;

Expand Down

0 comments on commit d38aca1

Please sign in to comment.