aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/cycle.cpp
diff options
context:
space:
mode:
authorD G Turner2011-12-10 20:12:35 +0000
committerD G Turner2011-12-10 20:12:35 +0000
commitf722542ceea557e906699c60b10b3ace1f41c238 (patch)
treeb8ffb024108cf73963197c84e44e88daa70a887b /engines/agi/cycle.cpp
parent1cb4af9c4c16c37f5fb9b65d2076e17602ffee84 (diff)
downloadscummvm-rg350-f722542ceea557e906699c60b10b3ace1f41c238.tar.gz
scummvm-rg350-f722542ceea557e906699c60b10b3ace1f41c238.tar.bz2
scummvm-rg350-f722542ceea557e906699c60b10b3ace1f41c238.zip
AGI: Replace usage of 'goto'.
Diffstat (limited to 'engines/agi/cycle.cpp')
-rw-r--r--engines/agi/cycle.cpp75
1 files changed, 39 insertions, 36 deletions
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 99649fb437..5daadbd1df 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -248,44 +248,47 @@ int AgiEngine::mainCycle() {
if (kascii)
setvar(vKey, kascii);
-process_key:
-
- switch (_game.inputMode) {
- case INPUT_NORMAL:
- if (!handleController(key)) {
- if (key == 0 || !_game.inputEnabled)
- break;
- handleKeys(key);
-
- // if ESC pressed, activate menu before
- // accept.input from the interpreter cycle
- // sets the input mode to normal again
- // (closes: #540856)
- if (key == KEY_ESCAPE) {
- key = 0;
- goto process_key;
+ bool restartProcessKey;
+ do {
+ restartProcessKey = false;
+
+ switch (_game.inputMode) {
+ case INPUT_NORMAL:
+ if (!handleController(key)) {
+ if (key == 0 || !_game.inputEnabled)
+ break;
+ handleKeys(key);
+
+ // if ESC pressed, activate menu before
+ // accept.input from the interpreter cycle
+ // sets the input mode to normal again
+ // (closes: #540856)
+ if (key == KEY_ESCAPE) {
+ key = 0;
+ restartProcessKey = true;
+ }
+
+ // commented out to close Sarien bug #438872
+ //if (key)
+ // _game.keypress = key;
}
-
- // commented out to close Sarien bug #438872
- //if (key)
- // _game.keypress = key;
+ break;
+ case INPUT_GETSTRING:
+ handleController(key);
+ handleGetstring(key);
+ setvar(vKey, 0); // clear ENTER key
+ break;
+ case INPUT_MENU:
+ _menu->keyhandler(key);
+ _gfx->doUpdate();
+ return false;
+ case INPUT_NONE:
+ handleController(key);
+ if (key)
+ _game.keypress = key;
+ break;
}
- break;
- case INPUT_GETSTRING:
- handleController(key);
- handleGetstring(key);
- setvar(vKey, 0); // clear ENTER key
- break;
- case INPUT_MENU:
- _menu->keyhandler(key);
- _gfx->doUpdate();
- return false;
- case INPUT_NONE:
- handleController(key);
- if (key)
- _game.keypress = key;
- break;
- }
+ } while (restartProcessKey);
_gfx->doUpdate();
if (_game.msgBoxTicks > 0)