aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-10-27 22:19:38 -0700
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit998cf547eda31ac7b3c67c5dd0e2d1249ddf4741 (patch)
treebd13fb30276fd9867b318be118de731d4b160757 /engines
parentb23291b9777311d73363bd97f2392402d2b2eb6c (diff)
downloadscummvm-rg350-998cf547eda31ac7b3c67c5dd0e2d1249ddf4741.tar.gz
scummvm-rg350-998cf547eda31ac7b3c67c5dd0e2d1249ddf4741.tar.bz2
scummvm-rg350-998cf547eda31ac7b3c67c5dd0e2d1249ddf4741.zip
GLK: SCOTT: Exit game when ScummVM is closed
Diffstat (limited to 'engines')
-rw-r--r--engines/gargoyle/events.cpp4
-rw-r--r--engines/gargoyle/scott/scott.cpp11
2 files changed, 12 insertions, 3 deletions
diff --git a/engines/gargoyle/events.cpp b/engines/gargoyle/events.cpp
index b1f1823276..bba9df1c56 100644
--- a/engines/gargoyle/events.cpp
+++ b/engines/gargoyle/events.cpp
@@ -31,7 +31,6 @@ void Events::getEvent(event_t *event, bool polled) {
_currentEvent = event;
event->clear();
- Common::Event ev;
dispatchEvent(*_currentEvent, polled);
if (!polled) {
@@ -41,6 +40,9 @@ void Events::getEvent(event_t *event, bool polled) {
dispatchEvent(*_currentEvent, polled);
}
+
+ if (g_vm->shouldQuit())
+ _currentEvent->type = evtype_Quit;
}
if (_currentEvent->type == evtype_None && _timeouts) {
diff --git a/engines/gargoyle/scott/scott.cpp b/engines/gargoyle/scott/scott.cpp
index d533a7ea44..381239299c 100644
--- a/engines/gargoyle/scott/scott.cpp
+++ b/engines/gargoyle/scott/scott.cpp
@@ -92,6 +92,9 @@ Distributed under the GNU software license\n\n");
if (GetInput(&vb, &no) == -1)
continue;
+ if (g_vm->shouldQuit())
+ return;
+
switch (PerformActions(vb, no)) {
case -1:
Output("I don't understand your command. ");
@@ -567,8 +570,9 @@ void Scott::LineInput(char *buf, size_t n) {
do {
glk_select(&ev);
-
- if (ev.type == evtype_LineInput)
+ if (ev.type == evtype_Quit)
+ return;
+ else if (ev.type == evtype_LineInput)
break;
else if (ev.type == evtype_Arrange && split_screen)
Look();
@@ -654,6 +658,9 @@ int Scott::GetInput(int *vb, int *no) {
do {
Output("\nTell me what to do ? ");
LineInput(buf, sizeof buf);
+ if (g_vm->shouldQuit())
+ return 0;
+
num = sscanf(buf, "%9s %9s", verb, noun);
} while (num == 0 || *buf == '\n');