aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/cycle.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-03 00:26:35 +0100
committerMartin Kiewitz2016-02-03 00:26:35 +0100
commit563d890991026b268b420ad65cc55508f1a4c622 (patch)
treeee287e70ac27a965a90db92765ed752a0868ff20 /engines/agi/cycle.cpp
parent920bea0fd9a161eba08c4057871177010c79ac1f (diff)
downloadscummvm-rg350-563d890991026b268b420ad65cc55508f1a4c622.tar.gz
scummvm-rg350-563d890991026b268b420ad65cc55508f1a4c622.tar.bz2
scummvm-rg350-563d890991026b268b420ad65cc55508f1a4c622.zip
AGI: Fix regression of have.key changes
original commit 8269a94bcd55200f7ae8aba00c7b6fd0d37b9a37 Now hopefully properly implemented. Adjusted a few more inaccuracies (we set v19 to 0, where we shouldn't have)
Diffstat (limited to 'engines/agi/cycle.cpp')
-rw-r--r--engines/agi/cycle.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index e2b6e0a065..c9f109b8b3 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -176,7 +176,6 @@ void AgiEngine::interpretCycle() {
// If main_cycle returns false, don't process more events!
int AgiEngine::mainCycle(bool onlyCheckForEvents) {
uint16 key;
- byte keyAscii;
ScreenObjEntry *screenObjEgo = &_game.screenObjTable[SCREENOBJECTS_EGO_ENTRY];
if (!onlyCheckForEvents) {
@@ -219,19 +218,18 @@ int AgiEngine::mainCycle(bool onlyCheckForEvents) {
}
}
- keyAscii = key & 0xFF;
- if (keyAscii) {
- setVar(VM_VAR_KEY, keyAscii);
- }
-
handleMouseClicks(key);
if (!cycleInnerLoopIsActive()) {
// no inner loop active at the moment, regular processing
+
if (key) {
+ setVar(VM_VAR_KEY, key & 0xFF);
if (!handleController(key)) {
- if ((key) && (_text->promptIsEnabled())) {
- _text->promptCharPress(key);
+ if (key) {
+ if (_text->promptIsEnabled()) {
+ _text->promptCharPress(key);
+ }
}
}
}
@@ -239,7 +237,6 @@ int AgiEngine::mainCycle(bool onlyCheckForEvents) {
} else {
// inner loop active
// call specific workers
- setVar(VM_VAR_KEY, 0); // clear keys, they must not be passed to the scripts
_game.keypress = 0;
switch (_game.cycleInnerLoopType) {
@@ -272,22 +269,16 @@ int AgiEngine::mainCycle(bool onlyCheckForEvents) {
}
break;
- case CYCLE_INNERLOOP_HAVEKEY:
- if (key) {
- testHaveKeyCharPress(key);
- }
- break;
-
default:
break;
}
}
- if (_menu->delayedExecuteActive()) {
- _menu->execute();
- }
-
if (!onlyCheckForEvents) {
+ if (_menu->delayedExecuteActive()) {
+ _menu->execute();
+ }
+
if (_game.msgBoxTicks > 0)
_game.msgBoxTicks--;
}