1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Separated timer updates from rendering in adventure map and town screen

This commit is contained in:
Ivan Savenko
2023-05-13 17:24:18 +03:00
parent 3ecdff2a21
commit fa496628f2
8 changed files with 27 additions and 13 deletions

View File

@@ -320,6 +320,8 @@ CShowableAnim::CShowableAnim(int x, int y, std::string name, ui8 Flags, ui32 fra
pos.h = anim->getImage(0, group)->height();
pos.x+= x;
pos.y+= y;
addUsedEvents(TIME);
}
CShowableAnim::~CShowableAnim()
@@ -391,11 +393,14 @@ void CShowableAnim::show(SDL_Surface * to)
if ( flags & BASE )// && frame != first) // FIXME: results in graphical glytch in Fortress, upgraded hydra's dwelling
blitImage(first, group, to);
blitImage(frame, group, to);
}
void CShowableAnim::tick(uint32_t msPassed)
{
if ((flags & PLAY_ONCE) && frame + 1 == last)
return;
frameTimePassed += GH.getFrameDeltaMilliseconds();
frameTimePassed += msPassed;
if(frameTimePassed >= frameTimeTotal)
{