[Scummvm-cvs-logs] SF.net SVN: scummvm: [27103] scummvm/trunk/engines/agos
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Tue Jun 5 13:38:29 CEST 2007
Revision: 27103
http://scummvm.svn.sourceforge.net/scummvm/?rev=27103&view=rev
Author: Kirben
Date: 2007-06-05 04:38:26 -0700 (Tue, 05 Jun 2007)
Log Message:
-----------
Fix input issues in earlier games, and split handleMouseMoved() due to difference in earlier games.
Modified Paths:
--------------
scummvm/trunk/engines/agos/agos.cpp
scummvm/trunk/engines/agos/agos.h
scummvm/trunk/engines/agos/cursor.cpp
scummvm/trunk/engines/agos/event.cpp
scummvm/trunk/engines/agos/verb.cpp
Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp 2007-06-05 09:14:59 UTC (rev 27102)
+++ scummvm/trunk/engines/agos/agos.cpp 2007-06-05 11:38:26 UTC (rev 27103)
@@ -302,6 +302,8 @@
_leftButtonDown = 0;
_rightButtonDown = 0;
_clickOnly = 0;
+ _leftClick = 0;
+ _oneClick = 0;
_noRightClick = false;
_leftButton = 0;
Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h 2007-06-05 09:14:59 UTC (rev 27102)
+++ scummvm/trunk/engines/agos/agos.h 2007-06-05 11:38:26 UTC (rev 27103)
@@ -383,7 +383,7 @@
byte _leftButtonDown;
byte _leftButton, _leftButtonCount, _leftButtonOld;
byte _rightButtonDown;
- bool _clickOnly;
+ bool _clickOnly, _leftClick, _oneClick;
bool _noRightClick;
Item *_dummyItem1;
@@ -1472,6 +1472,8 @@
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);
Modified: scummvm/trunk/engines/agos/cursor.cpp
===================================================================
--- scummvm/trunk/engines/agos/cursor.cpp 2007-06-05 09:14:59 UTC (rev 27102)
+++ scummvm/trunk/engines/agos/cursor.cpp 2007-06-05 11:38:26 UTC (rev 27103)
@@ -380,7 +380,7 @@
drawMousePointer();
}
-void AGOSEngine::handleMouseMoved() {
+void AGOSEngine_Simon1::handleMouseMoved() {
uint x;
if (_mouseHideCount) {
@@ -399,13 +399,6 @@
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 @@
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 @@
}
}
+ 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 @@
}
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 @@
boxstuff:
boxController(_mouse.x, _mouse.y, x);
_lastHitArea3 = _lastHitArea;
- if (x == 1 && _lastHitArea == NULL)
- _lastHitArea3 = (HitArea *) -1;
-
get_out:
-
_mouseOld = _mouse;
drawMousePointer();
Modified: scummvm/trunk/engines/agos/event.cpp
===================================================================
--- scummvm/trunk/engines/agos/event.cpp 2007-06-05 09:14:59 UTC (rev 27102)
+++ scummvm/trunk/engines/agos/event.cpp 2007-06-05 11:38:26 UTC (rev 27103)
@@ -510,6 +510,7 @@
_leftButton = 0;
_leftButtonCount = 0;
+ _leftClick = true;
break;
case Common::EVENT_RBUTTONDOWN:
if (getGameType() == GType_FF)
Modified: scummvm/trunk/engines/agos/verb.cpp
===================================================================
--- scummvm/trunk/engines/agos/verb.cpp 2007-06-05 09:14:59 UTC (rev 27102)
+++ scummvm/trunk/engines/agos/verb.cpp 2007-06-05 11:38:26 UTC (rev 27103)
@@ -674,21 +674,21 @@
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;
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list