aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/cycle.cpp
diff options
context:
space:
mode:
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)