diff options
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/script.h | 2 | ||||
-rw-r--r-- | engines/kyra/script_v2.cpp | 46 |
3 files changed, 30 insertions, 20 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 42209d34c3..3c1014a94b 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -1573,7 +1573,7 @@ void KyraEngine_v2::processNewShapes(int unk1, int unk2) { resetSkipFlag(); - while (_scriptInterpreter->validScript(&_temporaryScriptState) && !skipFlag()) { + while (_scriptInterpreter->validScript(&_temporaryScriptState)) { _temporaryScriptExecBit = false; while (_scriptInterpreter->validScript(&_temporaryScriptState) && !_temporaryScriptExecBit) _scriptInterpreter->runScript(&_temporaryScriptState); diff --git a/engines/kyra/script.h b/engines/kyra/script.h index 47390e69bb..fe6afcf80a 100644 --- a/engines/kyra/script.h +++ b/engines/kyra/script.h @@ -53,7 +53,7 @@ struct ScriptState { }; #define stackPos(x) (script->stack[script->sp+x]) -#define stackPosString(x) ((const char*)&script->dataPtr->text[READ_BE_UINT16(&((uint16 *)script->dataPtr->text)[stackPos(x)])]) +#define stackPosString(x) ((const char*)&script->dataPtr->text[READ_BE_UINT16(&script->dataPtr->text[stackPos(x)<<1])]) #define FORM_CHUNK 0x4D524F46 #define TEXT_CHUNK 0x54584554 diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 4986e25bea..72ced9d7de 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -283,27 +283,33 @@ int KyraEngine_v2::o2_displayWsaSequentialFramesLooping(ScriptState *script) { for (int i = startFrame; i <= endFrame; ++i) { uint32 endTime = _system->getMillis() + waitTime * _tickLength; _wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags, 0, 0); - _screen->updateScreen(); - do { - update(); + if (!skipFlag()) { + _screen->updateScreen(); - if (endTime - _system->getMillis() >= 10 && !skipFlag()) - delay(10); - } while (_system->getMillis() < endTime && !skipFlag()); + do { + update(); + + if (endTime - _system->getMillis() >= 10) + delay(10); + } while (_system->getMillis() < endTime); + } } } else { for (int i = startFrame; i >= endFrame; --i) { uint32 endTime = _system->getMillis() + waitTime * _tickLength; _wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags, 0, 0); - _screen->updateScreen(); - do { - update(); + if (!skipFlag()) { + _screen->updateScreen(); + + do { + update(); - if (endTime - _system->getMillis() >= 10 && !skipFlag()) - delay(10); - } while (_system->getMillis() < endTime && !skipFlag()); + if (endTime - _system->getMillis() >= 10 && !skipFlag()) + delay(10); + } while (_system->getMillis() < endTime && !skipFlag()); + } } } @@ -339,8 +345,10 @@ int KyraEngine_v2::o2_displayWsaSequentialFrames(ScriptState *script) { while (currentFrame <= lastFrame) { uint32 endTime = _system->getMillis() + frameDelay; _wsaSlots[index]->displayFrame(currentFrame++, copyParam, 0, 0); - _screen->updateScreen(); - delayUntil(endTime); + if (!skipFlag()) { + _screen->updateScreen(); + delayUntil(endTime); + } } resetSkipFlag(); @@ -369,10 +377,12 @@ int KyraEngine_v2::o2_displayWsaSequence(ScriptState *script) { while (currentFrame <= lastFrame) { uint32 endTime = _system->getMillis() + frameDelay; _wsaSlots[index]->displayFrame(currentFrame++, copyParam, 0, 0); - if (doUpdate) - update(); - _screen->updateScreen(); - delayUntil(endTime); + if (!skipFlag()) { + if (doUpdate) + update(); + _screen->updateScreen(); + delayUntil(endTime); + } } resetSkipFlag(); |