aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/actor.cpp4
-rw-r--r--engines/saga/script.h5
-rw-r--r--engines/saga/sfuncs.cpp7
3 files changed, 15 insertions, 1 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index 6ea8674e8e..5b9b05f908 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -1811,6 +1811,10 @@ void Actor::drawActors() {
createDrawOrderList();
+ // Update frameCount for sfWaitFrames in IHNM
+ // TODO: is this the correct place to do this?
+ _vm->_frameCount++;
+
for (drawOrderIterator = _drawOrderList.begin(); drawOrderIterator != _drawOrderList.end(); ++drawOrderIterator) {
drawObject = drawOrderIterator.operator*();
diff --git a/engines/saga/script.h b/engines/saga/script.h
index a8a0cd762b..b358a00966 100644
--- a/engines/saga/script.h
+++ b/engines/saga/script.h
@@ -326,6 +326,11 @@ public:
_sleepTime = sleepTime;
}
+ void waitFrames(int frames) {
+ wait(kWaitTypeWaitFrames);
+ _frameWait = frames;
+ }
+
ScriptThread() {
memset(this, 0xFE, sizeof(*this));
_stackBuf = NULL;
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index d759c9c2e7..06ea9da77b 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -1887,8 +1887,13 @@ void Script::sfResetMouseClicks(SCRIPTFUNC_PARAMS) {
SF_stub("sfResetMouseClicks", thread, nArgs);
}
+// Param1: frames
void Script::sfWaitFrames(SCRIPTFUNC_PARAMS) {
- SF_stub("sfWaitFrames", thread, nArgs);
+ int16 frames;
+ frames = thread->pop();
+
+ if (!_skipSpeeches)
+ thread->waitFrames(_vm->_frameCount + frames);
}
void Script::sfScriptFade(SCRIPTFUNC_PARAMS) {