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_e2.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'engines/agos/script_e2.cpp') diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index 60158590fe..e443a91589 100644 --- a/engines/agos/script_e2.cpp +++ b/engines/agos/script_e2.cpp @@ -57,6 +57,7 @@ void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) { op[123] = &AGOSEngine::oe1_setTime; op[124] = &AGOSEngine::oe1_ifTime; op[127] = &AGOSEngine::os1_playTune; + op[135] = &AGOSEngine::oe2_pauseGame; op[144] = &AGOSEngine::oe2_setDoorOpen; op[145] = &AGOSEngine::oe2_setDoorClosed; op[146] = &AGOSEngine::oe2_setDoorLocked; @@ -171,6 +172,35 @@ void AGOSEngine::oe2_doTable() { } } +void AGOSEngine::oe2_pauseGame() { + // 135: pause game + HitArea *ha; + + time_t pauseTime = time(NULL); + haltAnimation(); + + for (;;) { + _lastHitArea = NULL; + _lastHitArea3 = NULL; + + for (;;) { + if (processSpecialKeys() != 0 || _lastHitArea3 != 0) + break; + delay(1); + } + + ha = _lastHitArea; + + if (ha == NULL) { + } else if (ha->id == 201) { + break; + } + } + + restartAnimation(); + _gameStoppedClock = time(NULL) - pauseTime + _gameStoppedClock; +} + void AGOSEngine::oe2_setDoorOpen() { // 144: set door open Item *i = getNextItemPtr(); -- cgit v1.2.3