aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-03-26 21:52:28 +0000
committerJohannes Schickel2008-03-26 21:52:28 +0000
commitdb1b4f0e140ba667ac1a1b0aa3f2ca2d110027db (patch)
tree6b0d7a2af80b58868e199dcf9feb1110b9790a3e
parentf919b26875033c41186b840b97752c72cab68f7f (diff)
downloadscummvm-rg350-db1b4f0e140ba667ac1a1b0aa3f2ca2d110027db.tar.gz
scummvm-rg350-db1b4f0e140ba667ac1a1b0aa3f2ca2d110027db.tar.bz2
scummvm-rg350-db1b4f0e140ba667ac1a1b0aa3f2ca2d110027db.zip
- reworked skip flag handling in some places again
- hopefully fixed tons of warnings related to stackPosString svn-id: r31253
-rw-r--r--engines/kyra/kyra_v2.cpp2
-rw-r--r--engines/kyra/script.h2
-rw-r--r--engines/kyra/script_v2.cpp46
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();