aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorFlorian Kagerer2009-10-17 23:52:57 +0000
committerFlorian Kagerer2009-10-17 23:52:57 +0000
commit4b1f310f2ddf25a907bf45a36739c4ddeea7421c (patch)
treeba56fb316316e6b62a145482d40cfb58951173e4 /engines/kyra
parentbcac203098a0d706724bcfba4789570220d10706 (diff)
downloadscummvm-rg350-4b1f310f2ddf25a907bf45a36739c4ddeea7421c.tar.gz
scummvm-rg350-4b1f310f2ddf25a907bf45a36739c4ddeea7421c.tar.bz2
scummvm-rg350-4b1f310f2ddf25a907bf45a36739c4ddeea7421c.zip
LOL: this (hopefully) fixes a minor glitch that might occur when using the freeze spell
svn-id: r45210
Diffstat (limited to 'engines/kyra')
-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;