aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/script_e2.cpp
diff options
context:
space:
mode:
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();