diff options
Diffstat (limited to 'engines/draci/script.cpp')
-rw-r--r-- | engines/draci/script.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index f7cf015c24..51df1fd2ef 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -624,6 +624,10 @@ void Script::execLook(const Common::Array<int> ¶ms) { int objID = params[0] - 1; const GameObject *obj = _vm->_game->getObject(objID); + + // We don't have to use runWrapper(), because the has already been + // wrapped due to the fact that these commands are only run from a GPL2 + // program but never from the core player. run(obj->_program, obj->_look); } @@ -1193,5 +1197,30 @@ void Script::run(const GPL2Program &program, uint16 offset) { _vm->_game->setEnableSpeedText(true); } +void Script::runWrapper(const GPL2Program &program, uint16 offset, bool disableCursor, bool releaseAnims) { + if (disableCursor) { + // Fetch the dedicated objects' title animation / current frame + Animation *titleAnim = _vm->_anims->getAnimation(kTitleText); + titleAnim->markDirtyRect(_vm->_screen->getSurface()); + Text *title = reinterpret_cast<Text *>(titleAnim->getCurrentFrame()); + title->setText(""); + + _vm->_mouse->cursorOff(); + } + + // Mark last animation + int lastAnimIndex = _vm->_anims->getLastIndex(); + + run(program, offset); + + if (releaseAnims) { + _vm->_game->deleteAnimationsAfterIndex(lastAnimIndex); + } + + if (disableCursor) { + _vm->_mouse->cursorOn(); + } +} + } // End of namespace Draci |