aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/cycle.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-01 01:34:36 +0100
committerMartin Kiewitz2016-02-01 01:34:36 +0100
commitc28e101cdbfcc28f080da245e49f5b764bb8fc44 (patch)
tree77e6025b13008783b0839e1e4a71246683e19235 /engines/agi/cycle.cpp
parent73242aa5bc15746572c183b24c77e7fb20c023a0 (diff)
downloadscummvm-rg350-c28e101cdbfcc28f080da245e49f5b764bb8fc44.tar.gz
scummvm-rg350-c28e101cdbfcc28f080da245e49f5b764bb8fc44.tar.bz2
scummvm-rg350-c28e101cdbfcc28f080da245e49f5b764bb8fc44.zip
AGI: implement predictive dialog
Diffstat (limited to 'engines/agi/cycle.cpp')
-rw-r--r--engines/agi/cycle.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 6506ee29eb..67a238df08 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -206,8 +206,8 @@ int AgiEngine::mainCycle(bool onlyCheckForEvents) {
//
// We run AGIMOUSE always as a side effect
//if (getFeatures() & GF_AGIMOUSE) {
- setVar(VM_VAR_MOUSE_X, _mouse.x / 2);
- setVar(VM_VAR_MOUSE_Y, _mouse.y);
+ setVar(VM_VAR_MOUSE_X, _mouse.pos.x / 2);
+ setVar(VM_VAR_MOUSE_Y, _mouse.pos.y);
//}
switch (_game.inputMode) {
@@ -245,21 +245,27 @@ int AgiEngine::mainCycle(bool onlyCheckForEvents) {
setVar(VM_VAR_KEY, keyAscii);
}
+ handleMouseClicks(key);
+
if (!cycleInnerLoopIsActive()) {
// no inner loop active at the moment, regular processing
switch (_game.inputMode) {
case INPUTMODE_NORMAL:
- if (!handleController(key)) {
- if (key == 0 || (!_text->promptIsEnabled()))
- break;
-
- _text->promptCharPress(key);
+ if (key) {
+ if (!handleController(key)) {
+ if ((key) && (_text->promptIsEnabled())) {
+ _text->promptCharPress(key);
+ }
+ }
}
break;
case INPUTMODE_NONE:
- handleController(key);
- if (key)
- _game.keypress = key;
+ if (key) {
+ handleController(key);
+ if (key) {
+ _game.keypress = key;
+ }
+ }
break;
default:
break;
@@ -274,7 +280,6 @@ int AgiEngine::mainCycle(bool onlyCheckForEvents) {
switch (_game.cycleInnerLoopType) {
case CYCLE_INNERLOOP_GETSTRING: // loop called from TextMgr::stringEdit()
case CYCLE_INNERLOOP_GETNUMBER:
- //handleController(key);
if (key) {
_text->stringCharPress(key);
}