diff options
Diffstat (limited to 'engines/mohawk/riven_stacks/bspit.cpp')
-rw-r--r-- | engines/mohawk/riven_stacks/bspit.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/engines/mohawk/riven_stacks/bspit.cpp b/engines/mohawk/riven_stacks/bspit.cpp index f94098a398..acc24f24be 100644 --- a/engines/mohawk/riven_stacks/bspit.cpp +++ b/engines/mohawk/riven_stacks/bspit.cpp @@ -221,19 +221,12 @@ void BSpit::xbupdateboiler(uint16 argc, uint16 *argv) { } } -static void ytramTrapTimer(MohawkEngine_Riven *vm) { +void BSpit::ytramTrapTimer() { // Remove this timer - vm->removeTimer(); - - // FIXME: Improve the timer system (use a functor ?) + _vm->removeTimer(); // Check if we've caught a Ytram - BSpit *bspit = dynamic_cast<BSpit *>(vm->getStack()); - if (!bspit) { - error("Unexpected stack type in 'ytramTrapTimer'"); - } - - bspit->checkYtramCatch(true); + checkYtramCatch(true); } void BSpit::xbsettrap(uint16 argc, uint16 *argv) { @@ -244,7 +237,7 @@ void BSpit::xbsettrap(uint16 argc, uint16 *argv) { _vm->_vars["bytramtime"] = timeUntilCatch + _vm->getTotalPlayTime(); // And set the timer too - _vm->installTimer(&ytramTrapTimer, timeUntilCatch); + _vm->installTimer(TIMER(BSpit, ytramTrapTimer), timeUntilCatch); } void BSpit::checkYtramCatch(bool playSound) { @@ -255,7 +248,7 @@ void BSpit::checkYtramCatch(bool playSound) { // If the trap still has not gone off, reinstall our timer // This is in case you set the trap, walked away, and returned if (_vm->getTotalPlayTime() < ytramTime) { - _vm->installTimer(&ytramTrapTimer, ytramTime - _vm->getTotalPlayTime()); + _vm->installTimer(TIMER(BSpit, ytramTrapTimer), ytramTime - _vm->getTotalPlayTime()); return; } |