From 4b1f310f2ddf25a907bf45a36739c4ddeea7421c Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Sat, 17 Oct 2009 23:52:57 +0000 Subject: LOL: this (hopefully) fixes a minor glitch that might occur when using the freeze spell svn-id: r45210 --- engines/kyra/lol.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 9f50da5d50..d947346c4d 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -3206,24 +3206,30 @@ void LoLEngine::playSpellAnimation(WSAMovie_v2 *mov, int firstFrame, int lastFra _screen->updateScreen(); } - int del = (int)(delayTimer - _system->getMillis()); + uint32 tm = _system->getMillis(); + uint32 del = (delayTimer > tm) ? (delayTimer - tm) : 0; + do { - int step = del > _tickLength ? _tickLength : del; + uint32 step = del > _tickLength ? _tickLength : del; if (!pal1 || !pal2) { - if (del > 0) + if (del) { delay(step); - del -= step; + del -= step; + } continue; } - if (!_screen->fadePaletteStep(pal1, pal2, _system->getMillis() - startTime, _tickLength * fadeDelay) && !mov) + if (!_screen->fadePaletteStep(pal1, pal2, _system->getMillis() - startTime, _tickLength * fadeDelay) && !mov) { + updateInput(); return; + } - if (del > 0) + if (del) { delay(step); - del -= step; - } while (del > 0); + del -= step; + } + } while (del); if (!mov) continue; -- cgit v1.2.3