aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorTravis Howell2007-06-05 11:38:26 +0000
committerTravis Howell2007-06-05 11:38:26 +0000
commit56cde56d4b138bd840a6031e8dd8bd647b1296d8 (patch)
tree1865922397a6e9d7d80dc680243d033609c820e1 /engines/agos
parent3547c13e49f14e07a054f77f4cc6f92daa71dd87 (diff)
downloadscummvm-rg350-56cde56d4b138bd840a6031e8dd8bd647b1296d8.tar.gz
scummvm-rg350-56cde56d4b138bd840a6031e8dd8bd647b1296d8.tar.bz2
scummvm-rg350-56cde56d4b138bd840a6031e8dd8bd647b1296d8.zip
Fix input issues in earlier games, and split handleMouseMoved() due to difference in earlier games.
svn-id: r27103
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.cpp2
-rw-r--r--engines/agos/agos.h4
-rw-r--r--engines/agos/cursor.cpp74
-rw-r--r--engines/agos/event.cpp1
-rw-r--r--engines/agos/verb.cpp20
5 files changed, 74 insertions, 27 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 37e8c16c21..6ef573cafb 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -302,6 +302,8 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_leftButtonDown = 0;
_rightButtonDown = 0;
_clickOnly = 0;
+ _leftClick = 0;
+ _oneClick = 0;
_noRightClick = false;
_leftButton = 0;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index d043656eca..7d0c2d0d0a 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -383,7 +383,7 @@ protected:
byte _leftButtonDown;
byte _leftButton, _leftButtonCount, _leftButtonOld;
byte _rightButtonDown;
- bool _clickOnly;
+ bool _clickOnly, _leftClick, _oneClick;
bool _noRightClick;
Item *_dummyItem1;
@@ -1472,6 +1472,8 @@ protected:
virtual void drawIcon(WindowBlock *window, uint icon, uint x, uint y);
+ virtual void handleMouseMoved();
+
virtual void addArrows(WindowBlock *window);
virtual uint setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr);
diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp
index c43e243bf3..35bb8ea216 100644
--- a/engines/agos/cursor.cpp
+++ b/engines/agos/cursor.cpp
@@ -380,7 +380,7 @@ void AGOSEngine_PuzzlePack::handleMouseMoved() {
drawMousePointer();
}
-void AGOSEngine::handleMouseMoved() {
+void AGOSEngine_Simon1::handleMouseMoved() {
uint x;
if (_mouseHideCount) {
@@ -399,13 +399,6 @@ void AGOSEngine::handleMouseMoved() {
resetVerbs();
}
- if (_leftButton == 0) {
- if (_dragMode != 0) {
- _dragEnd = 1;
- }
- _dragCount = 0;
- }
-
if (getGameType() == GType_FF) {
if (getBitFlag(99)) { // Oracle
if (_mouse.x >= 10 && _mouse.x <= 635 && _mouse.y >= 5 && _mouse.y <= 475) {
@@ -449,7 +442,50 @@ void AGOSEngine::handleMouseMoved() {
get_out2:;
_vgaVar9 = 0;
}
- } else if (getGameType() == GType_WW) {
+ }
+
+ if (_mouse != _mouseOld)
+ _needHitAreaRecalc++;
+
+ if (_leftButtonOld == 0 && _leftButtonCount != 0) {
+ boxController(_mouse.x, _mouse.y, 3);
+ }
+ _leftButtonOld = _leftButton;
+
+ x = 0;
+ if (_lastHitArea3 == 0 && _leftButtonDown != 0) {
+ _leftButtonDown = 0;
+ x = 1;
+ } else {
+ if (_litBoxFlag == 0 && _needHitAreaRecalc == 0)
+ goto get_out;
+ }
+
+ boxController(_mouse.x, _mouse.y, x);
+ _lastHitArea3 = _lastHitArea;
+ if (x == 1 && _lastHitArea == NULL)
+ _lastHitArea3 = (HitArea *) -1;
+
+get_out:
+ _mouseOld = _mouse;
+ drawMousePointer();
+
+ _needHitAreaRecalc = 0;
+ _litBoxFlag = 0;
+}
+
+void AGOSEngine::handleMouseMoved() {
+ uint x;
+
+ if (_mouseHideCount) {
+ CursorMan.showMouse(false);
+ return;
+ }
+
+ CursorMan.showMouse(true);
+ _mouse = _eventMan->getMousePos();
+
+ if (getGameType() == GType_WW) {
if (_variableArray[51] != 0 && _mouseCursor != _variableArray[51]) {
_mouseCursor = _variableArray[51];
_needHitAreaRecalc++;
@@ -466,10 +502,20 @@ void AGOSEngine::handleMouseMoved() {
}
}
+ if (_leftClick == true) {
+ _leftClick = false;
+ if (_dragMode != 0) {
+ _dragEnd = 1;
+ } else {
+ _oneClick = true;
+ }
+ _dragCount = 0;
+ }
+
if (_mouse != _mouseOld)
_needHitAreaRecalc++;
- if (_leftButtonOld == 0 && _leftButtonCount != 0) {
+ if (_leftButtonOld == 0 && _leftButton != 0) {
_lastClickRem = 0;
boxController(_mouse.x, _mouse.y, 3);
}
@@ -493,8 +539,8 @@ void AGOSEngine::handleMouseMoved() {
}
x = 0;
- if (_lastHitArea3 == 0 && _leftButtonDown != 0) {
- _leftButtonDown = 0;
+ if (_oneClick == true) {
+ _oneClick = false;
x = 1;
} else {
if (_litBoxFlag == 0 && _needHitAreaRecalc == 0)
@@ -504,11 +550,7 @@ void AGOSEngine::handleMouseMoved() {
boxstuff:
boxController(_mouse.x, _mouse.y, x);
_lastHitArea3 = _lastHitArea;
- if (x == 1 && _lastHitArea == NULL)
- _lastHitArea3 = (HitArea *) -1;
-
get_out:
-
_mouseOld = _mouse;
drawMousePointer();
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index 8570859bb8..5c16679dc6 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -510,6 +510,7 @@ void AGOSEngine::delay(uint amount) {
_leftButton = 0;
_leftButtonCount = 0;
+ _leftClick = true;
break;
case Common::EVENT_RBUTTONDOWN:
if (getGameType() == GType_FF)
diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp
index ddb7398312..27c5b4012e 100644
--- a/engines/agos/verb.cpp
+++ b/engines/agos/verb.cpp
@@ -674,21 +674,21 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) {
if (mode != 0) {
if (mode == 3) {
- if (getGameType() == GType_ELVIRA1) {
+ if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2) {
if (best_ha->verb & 0x4000) {
- if (_variableArray[500] == 0) {
+ if (getGameType() == GType_ELVIRA1 && _variableArray[500] == 0) {
_variableArray[500] = best_ha->verb & 0xBFFF;
}
- }
- if (_clickOnly != 0 && best_ha->id < 8) {
- uint id = best_ha->id;
- if (id >= 4)
- id -= 4;
+ if (_clickOnly != 0 && best_ha->id < 8) {
+ uint id = best_ha->id;
+ if (id >= 4)
+ id -= 4;
- invertBox(findBox(id), 0, 0, 0, 0);
- _clickOnly = 0;
- return;
+ invertBox(findBox(id), 0, 0, 0, 0);
+ _clickOnly = 0;
+ return;
+ }
}
}