From f55320f988a481ee7d92bcce39dfcbbf31d4151a Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Wed, 15 Nov 2006 13:11:53 +0000 Subject: Add inital pause code for Elvira 1/2 & WW, and cleanup svn-id: r24723 --- engines/agos/script_ww.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'engines/agos/script_ww.cpp') diff --git a/engines/agos/script_ww.cpp b/engines/agos/script_ww.cpp index deac387041..5b192a4199 100644 --- a/engines/agos/script_ww.cpp +++ b/engines/agos/script_ww.cpp @@ -59,6 +59,7 @@ void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) { op[105] = &AGOSEngine::oww_menu; op[106] = &AGOSEngine::oww_textMenu; op[127] = &AGOSEngine::os1_playTune; + op[135] = &AGOSEngine::oww_pauseGame; op[144] = &AGOSEngine::oe2_setDoorOpen; op[145] = &AGOSEngine::oe2_setDoorClosed; op[146] = &AGOSEngine::oe2_setDoorLocked; @@ -168,6 +169,37 @@ void AGOSEngine::oww_textMenu() { _textMenu[slot] = getVarOrByte(); } +void AGOSEngine::oww_pauseGame() { + // 135: pause game + HitArea *ha; + + time_t pauseTime = time(NULL); + haltAnimation(); + + for (;;) { + _lastHitArea = NULL; + _lastHitArea3 = NULL; + + for (;;) { + if (_lastHitArea3 != 0) + break; + delay(1); + } + + ha = _lastHitArea; + + if (ha == NULL) { + } else if (ha->id == 200) { + break; + } else if (ha->id == 201) { + break; + } + } + + restartAnimation(); + _gameStoppedClock = time(NULL) - pauseTime + _gameStoppedClock; +} + void AGOSEngine::oww_boxMessage() { // 184: print message to box boxTextMessage((const char *)getStringPtrByID(getNextStringID())); -- cgit v1.2.3