diff options
author | Filippos Karapetis | 2007-06-02 15:26:05 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-06-02 15:26:05 +0000 |
commit | f4299e81c13ae16d8c12c71192c9c195512ad1a2 (patch) | |
tree | 3551f28b9793006a4717ac5d91f49adecce9abc5 /engines | |
parent | 9896ce253e9eda4bb8bb612d269ef114541ec281 (diff) | |
download | scummvm-rg350-f4299e81c13ae16d8c12c71192c9c195512ad1a2.tar.gz scummvm-rg350-f4299e81c13ae16d8c12c71192c9c195512ad1a2.tar.bz2 scummvm-rg350-f4299e81c13ae16d8c12c71192c9c195512ad1a2.zip |
Implemented the sfWaitFrames script function for IHNM. Many animations should display more correctly now (e.g. actor "zapping" animations, Ben falling off the stairs). They're still not correct, as frameCount is not updated properly
svn-id: r27055
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/actor.cpp | 4 | ||||
-rw-r--r-- | engines/saga/script.h | 5 | ||||
-rw-r--r-- | engines/saga/sfuncs.cpp | 7 |
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) { |