aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan2/main.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-22 21:04:39 -0700
committerPaul Gilbert2019-06-22 22:03:06 -0700
commit3683e74d65273126afd3d7a101c656b7b52b8580 (patch)
tree2aad93fdfc6365a63b620c1e20527ac4b75a6354 /engines/glk/alan2/main.cpp
parent9aadb2726732e1fcd517088bdcaff60a8a49710d (diff)
downloadscummvm-rg350-3683e74d65273126afd3d7a101c656b7b52b8580.tar.gz
scummvm-rg350-3683e74d65273126afd3d7a101c656b7b52b8580.tar.bz2
scummvm-rg350-3683e74d65273126afd3d7a101c656b7b52b8580.zip
GLK: ALAN2: Set up main game loop for restarting game
Diffstat (limited to 'engines/glk/alan2/main.cpp')
-rw-r--r--engines/glk/alan2/main.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/engines/glk/alan2/main.cpp b/engines/glk/alan2/main.cpp
index 2dea4519f7..6e6133db87 100644
--- a/engines/glk/alan2/main.cpp
+++ b/engines/glk/alan2/main.cpp
@@ -1415,29 +1415,31 @@ void run() {
// Set default line and column
col = lin = 1;
- //setjmp(restart_label); /* Return here if he wanted to restart */
-
- init(); /* Load, initialise and start the adventure */
-
- Context ctx;
- for (;;) {
- if (!ctx._break) {
- if (dbgflg)
- debug();
-
- eventchk();
- cur.tick++;
- }
+ while (!g_vm->shouldQuit()) {
+ // Load, initialise and start the adventure
+ g_vm->setRestart(false);
+ init();
+
+ Context ctx;
+ while (!g_vm->shouldQuit()) {
+ if (!ctx._break) {
+ if (dbgflg)
+ debug();
+
+ eventchk();
+ cur.tick++;
+ }
- // Execution ends up here after calls to the error method
+ // Execution ends up here after calls to the error method
- // Move all characters
- ctx._break = false;
- for (cur.act = ACTMIN; cur.act <= (int)ACTMAX && !ctx._break; cur.act++) {
- movactor(ctx);
+ // Move all characters
+ ctx._break = false;
+ for (cur.act = ACTMIN; cur.act <= (int)ACTMAX && !ctx._break; cur.act++) {
+ movactor(ctx);
- if (g_vm->shouldQuit())
- return;
+ if (g_vm->shouldQuit())
+ return;
+ }
}
}
}