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
This commit is contained in:
Filippos Karapetis 2007-06-02 15:26:05 +00:00
parent 9896ce253e
commit f4299e81c1
3 changed files with 15 additions and 1 deletions

View File

@ -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*();

View File

@ -326,6 +326,11 @@ public:
_sleepTime = sleepTime;
}
void waitFrames(int frames) {
wait(kWaitTypeWaitFrames);
_frameWait = frames;
}
ScriptThread() {
memset(this, 0xFE, sizeof(*this));
_stackBuf = NULL;

View File

@ -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) {