aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/op_test.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-03 02:21:07 +0100
committerMartin Kiewitz2016-02-03 02:21:07 +0100
commit778c1ddb69bb45b6992fdc9b8fff6b2c8d3e22ac (patch)
tree51c8437a6c8eab0bd70ef313d71a562f20fca22e /engines/agi/op_test.cpp
parentc2038e00d001c93a37028864ad661b89377686c9 (diff)
downloadscummvm-rg350-778c1ddb69bb45b6992fdc9b8fff6b2c8d3e22ac.tar.gz
scummvm-rg350-778c1ddb69bb45b6992fdc9b8fff6b2c8d3e22ac.tar.bz2
scummvm-rg350-778c1ddb69bb45b6992fdc9b8fff6b2c8d3e22ac.zip
AGI: Cycle event processing changed
processEvents() renamed to processScummVMEvents() mainCycle() renamed to processAGIEvents() have.key now sets up an inner loop and calls processAGIEvents() to avoid any further cycle work processing
Diffstat (limited to 'engines/agi/op_test.cpp')
-rw-r--r--engines/agi/op_test.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp
index 0ffd1f56e6..c99d2f92ac 100644
--- a/engines/agi/op_test.cpp
+++ b/engines/agi/op_test.cpp
@@ -120,19 +120,21 @@ void condController(AgiGame *state, AgiEngine *vm, uint8 *p) {
}
void condHaveKey(AgiGame *state, AgiEngine *vm, uint8 *p) {
+ // Only check for key when there is not already one set by scripts
if (vm->getVar(VM_VAR_KEY)) {
state->testResult = 1;
return;
}
- // Only check for key when there is not already one set by scripts
- uint16 key = vm->doPollKeyboard();
+ // we are not really an inner loop, but we stop processAGIEvents() from doing regular cycle work by setting it up
+ vm->cycleInnerLoopActive(CYCLE_INNERLOOP_HAVEKEY);
+ uint16 key = vm->processAGIEvents(false); // also no delay
+ vm->cycleInnerLoopInactive();
if (key) {
debugC(5, kDebugLevelScripts | kDebugLevelInput, "keypress = %02x", key);
vm->setVar(VM_VAR_KEY, key);
state->testResult = 1;
return;
}
- vm->_gfx->updateScreen(); // TODO: Solve this in a better way
state->testResult = 0;
}