aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/lol.cpp22
1 files changed, 14 insertions, 8 deletions
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;