aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorPaul Gilbert2019-10-19 15:53:33 -0700
committerPaul Gilbert2019-10-26 11:13:29 -0700
commitd923ed3c5fbb1aad03c82f29cf93412215ae662e (patch)
treea9042841e64db91cbb96ead6fc89fcf0d630624e /engines/glk
parent0ecae64fdc00a7c874cc02a5cb4a1c37249687ef (diff)
downloadscummvm-rg350-d923ed3c5fbb1aad03c82f29cf93412215ae662e.tar.gz
scummvm-rg350-d923ed3c5fbb1aad03c82f29cf93412215ae662e.tar.bz2
scummvm-rg350-d923ed3c5fbb1aad03c82f29cf93412215ae662e.zip
GLK: LEVEL9: Fixes for exiting game by closing window
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/level9/level9_main.cpp4
-rw-r--r--engines/glk/level9/os_glk.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/engines/glk/level9/level9_main.cpp b/engines/glk/level9/level9_main.cpp
index 043266a178..2ce60a5fed 100644
--- a/engines/glk/level9/level9_main.cpp
+++ b/engines/glk/level9/level9_main.cpp
@@ -3559,6 +3559,10 @@ L9BOOL RunGame() {
code = *codeptr++;
/* printf("%d",code); */
executeinstruction();
+
+ if (g_vm->shouldQuit())
+ Running = false;
+
return Running;
}
diff --git a/engines/glk/level9/os_glk.cpp b/engines/glk/level9/os_glk.cpp
index 1b65ef1401..7722507c13 100644
--- a/engines/glk/level9/os_glk.cpp
+++ b/engines/glk/level9/os_glk.cpp
@@ -4844,6 +4844,11 @@ gln_bool os_input(char *buffer, int size) {
*/
g_vm->glk_request_line_event(gln_main_window, buffer, size - 1, 0);
gln_event_wait(evtype_LineInput, &event);
+ if (g_vm->shouldQuit()) {
+ g_vm->glk_cancel_line_event(gln_main_window, &event);
+ gln_stop_reason = STOP_EXIT;
+ return FALSE;
+ }
/* Terminate the input line with a NUL. */
assert((int)event.val1 <= size - 1);