aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/script_e2.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-11-15 13:11:53 +0000
committerTravis Howell2006-11-15 13:11:53 +0000
commitf55320f988a481ee7d92bcce39dfcbbf31d4151a (patch)
tree6579897990f22da2f1386c501613c81df988b89b /engines/agos/script_e2.cpp
parent7b0e6f1489878a4a45b1327f2d1733f561757c0b (diff)
downloadscummvm-rg350-f55320f988a481ee7d92bcce39dfcbbf31d4151a.tar.gz
scummvm-rg350-f55320f988a481ee7d92bcce39dfcbbf31d4151a.tar.bz2
scummvm-rg350-f55320f988a481ee7d92bcce39dfcbbf31d4151a.zip
Add inital pause code for Elvira 1/2 & WW, and cleanup
svn-id: r24723
Diffstat (limited to 'engines/agos/script_e2.cpp')
-rw-r--r--engines/agos/script_e2.cpp30
1 files changed, 30 insertions, 0 deletions
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();