diff options
author | Johannes Schickel | 2008-03-16 18:24:45 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-03-16 18:24:45 +0000 |
commit | 18fa238cd34e83a39a7a889f5a3ae928e783df29 (patch) | |
tree | ab206e3f8590d6c9a1c5129c48ee4807203fd90d /engines | |
parent | 6444a3c3d858db18d34fcc5b404cd7bc89a7fd59 (diff) | |
download | scummvm-rg350-18fa238cd34e83a39a7a889f5a3ae928e783df29.tar.gz scummvm-rg350-18fa238cd34e83a39a7a889f5a3ae928e783df29.tar.bz2 scummvm-rg350-18fa238cd34e83a39a7a889f5a3ae928e783df29.zip |
- implemented skip flag handling in wsa related opcodes
- implemented skip flag handling in o2_isVoicePlaying
- fixed skip flag handling when making the cauldron appear.
svn-id: r31149
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 9 | ||||
-rw-r--r-- | engines/kyra/script_v2.cpp | 15 |
2 files changed, 16 insertions, 8 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index d2a578186d..3f2cc3a76d 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -821,7 +821,7 @@ void KyraEngine_v2::delay(uint32 amount, bool updateGame, bool isMainLoop) { updateInput(); } - if (amount > 0 ) + if (amount > 0) _system->delayMillis(amount > 10 ? 10 : amount); } while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag); } @@ -1763,7 +1763,12 @@ void KyraEngine_v2::loadInvWsa(const char *filename, int run, int delayTime, int if (run) { while (_invWsa.running && !skipFlag() && !_quitFlag) { update(); - //XXX delay? + _system->delayMillis(10); + } + + if (skipFlag()) { + resetSkipFlag(); + displayInvWsaLastFrame(); } } } diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 9b2ac9017c..5d4f3c2cb7 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -231,9 +231,9 @@ int KyraEngine_v2::o2_displayWsaSequentialFramesLooping(ScriptState *script) { _screen->hideMouse(); int curTime = 0; - while (curTime < maxTimes) { + while (curTime < maxTimes && !skipFlag()) { if (startFrame < endFrame) { - for (int i = startFrame; i <= endFrame; ++i) { + for (int i = startFrame; i <= endFrame && !skipFlag(); ++i) { uint32 endTime = _system->getMillis() + waitTime * _tickLength; _wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags); _screen->updateScreen(); @@ -246,7 +246,7 @@ int KyraEngine_v2::o2_displayWsaSequentialFramesLooping(ScriptState *script) { } while (_system->getMillis() < endTime); } } else { - for (int i = startFrame; i >= endFrame; --i) { + for (int i = startFrame; i >= endFrame && !skipFlag(); --i) { uint32 endTime = _system->getMillis() + waitTime * _tickLength; _wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags); _screen->updateScreen(); @@ -262,6 +262,7 @@ int KyraEngine_v2::o2_displayWsaSequentialFramesLooping(ScriptState *script) { ++curTime; } + resetSkipFlag(); _screen->showMouse(); return 0; } @@ -288,13 +289,14 @@ int KyraEngine_v2::o2_displayWsaSequentialFrames(ScriptState *script) { _screen->hideMouse(); - while (currentFrame <= lastFrame) { + while (currentFrame <= lastFrame && !skipFlag()) { uint32 endTime = _system->getMillis() + frameDelay; _wsaSlots[index]->displayFrame(currentFrame++, copyParam); _screen->updateScreen(); delayUntil(endTime); } + resetSkipFlag(); _screen->showMouse(); return 0; @@ -317,7 +319,7 @@ int KyraEngine_v2::o2_displayWsaSequence(ScriptState *script) { int currentFrame = 0; const int lastFrame = _wsaSlots[index]->frames(); - while (currentFrame <= lastFrame) { + while (currentFrame <= lastFrame && !skipFlag()) { uint32 endTime = _system->getMillis() + frameDelay; _wsaSlots[index]->displayFrame(currentFrame++, copyParam); if (doUpdate) @@ -326,6 +328,7 @@ int KyraEngine_v2::o2_displayWsaSequence(ScriptState *script) { delayUntil(endTime); } + resetSkipFlag(); _screen->showMouse(); return 0; @@ -1293,7 +1296,7 @@ int KyraEngine_v2::o2_isVoiceEnabled(ScriptState *script) { int KyraEngine_v2::o2_isVoicePlaying(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "o2_isVoicePlaying(%p) ()", (const void *)script); - return snd_voiceIsPlaying() ? 1 : 0; + return (snd_voiceIsPlaying() && !skipFlag()) ? 1 : 0; } int KyraEngine_v2::o2_stopVoicePlaying(ScriptState *script) { |