aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2009-01-06 23:29:58 +0000
committerTorbjörn Andersson2009-01-06 23:29:58 +0000
commit9a9c1a40d9b9eb40747633eae8b8e242042626c9 (patch)
treefdfd49fcbbf590aa4333beb7afcb3390f36bd4d3
parent4b24b4d06fc36ed55222ed03b5dfa078eefadfeb (diff)
downloadscummvm-rg350-9a9c1a40d9b9eb40747633eae8b8e242042626c9.tar.gz
scummvm-rg350-9a9c1a40d9b9eb40747633eae8b8e242042626c9.tar.bz2
scummvm-rg350-9a9c1a40d9b9eb40747633eae8b8e242042626c9.zip
Added a few more shouldQuit() checks. It's now possible to quit while, for
instance, Leisure Suit Larry is waiting for you to enter your age. svn-id: r35761
-rw-r--r--engines/agi/keyboard.cpp8
-rw-r--r--engines/agi/op_cmd.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index b8cf14d0ec..c52767d0c2 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -365,7 +365,7 @@ void AgiEngine::handleKeys(int key) {
}
int AgiEngine::waitKey() {
- int key;
+ int key = 0;
/* clear key queue */
while (_gfx->keypress()) {
@@ -373,7 +373,7 @@ int AgiEngine::waitKey() {
}
debugC(3, kDebugLevelInput, "waiting...");
- for (;;) {
+ while (!shouldQuit()) {
_gfx->pollTimer(); /* msdos driver -> does nothing */
key = doPollKeyboard();
if (key == KEY_ENTER || key == KEY_ESCAPE || key == BUTTON_LEFT)
@@ -388,7 +388,7 @@ int AgiEngine::waitKey() {
}
int AgiEngine::waitAnyKey() {
- int key;
+ int key = 0;
/* clear key queue */
while (_gfx->keypress()) {
@@ -396,7 +396,7 @@ int AgiEngine::waitAnyKey() {
}
debugC(3, kDebugLevelInput, "waiting...");
- for (;;) {
+ while (!shouldQuit()) {
_gfx->pollTimer(); /* msdos driver -> does nothing */
key = doPollKeyboard();
if (key)
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 186002e8cc..70587820f7 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -1331,7 +1331,7 @@ cmd(get_string) {
do {
g_agi->mainCycle();
- } while (game.inputMode == INPUT_GETSTRING);
+ } while (game.inputMode == INPUT_GETSTRING && !g_agi->shouldQuit());
}
cmd(get_num) {
@@ -1349,7 +1349,7 @@ cmd(get_num) {
do {
g_agi->mainCycle();
- } while (game.inputMode == INPUT_GETSTRING);
+ } while (game.inputMode == INPUT_GETSTRING && !g_agi->shouldQuit());
_v[p1] = atoi(game.strings[MAX_STRINGS]);
debugC(4, kDebugLevelScripts, "[%s] -> %d", game.strings[MAX_STRINGS], _v[p1]);