[Scummvm-cvs-logs] CVS: scummvm/scumm input.cpp,2.38,2.39
Max Horn
fingolfin at users.sourceforge.net
Sat Oct 15 03:33:15 CEST 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28247
Modified Files:
input.cpp
Log Message:
Unified mouse pos update code
Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/input.cpp,v
retrieving revision 2.38
retrieving revision 2.39
diff -u -d -r2.38 -r2.39
--- input.cpp 14 Oct 2005 20:52:57 -0000 2.38
+++ input.cpp 15 Oct 2005 10:31:55 -0000 2.39
@@ -137,34 +137,16 @@
_keyDownMap[event.kbd.ascii] = false;
break;
- case OSystem::EVENT_MOUSEMOVE:
- _mouse.x = event.mouse.x;
- _mouse.y = event.mouse.y;
-
- if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
- _mouse.x -= (Common::kHercW - _screenWidth * 2) / 2;
- _mouse.x /= 2;
- _mouse.y = _mouse.y * 4 / 7;
- }
- break;
+ // We update the mouse position whenever the mouse moves or a click occurs.
+ // The latter is done to accomodate systems with a touchpad / pen controller.
case OSystem::EVENT_LBUTTONDOWN:
- _leftBtnPressed |= msClicked|msDown;
-#if defined(_WIN32_WCE) || defined(PALMOS_MODE) || defined (__SYMBIAN32__)
- _mouse.x = event.mouse.x;
- _mouse.y = event.mouse.y;
-
- if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
- _mouse.x -= (Common::kHercW - _screenWidth * 2) / 2;
- _mouse.x /= 2;
- _mouse.y = _mouse.y * 4 / 7;
- }
-#endif
- break;
-
case OSystem::EVENT_RBUTTONDOWN:
- _rightBtnPressed |= msClicked|msDown;
-#if defined(_WIN32_WCE) || defined(PALMOS_MODE) || defined (__SYMBIAN32__)
+ case OSystem::EVENT_MOUSEMOVE:
+ if (event.type == OSystem::EVENT_LBUTTONDOWN)
+ _leftBtnPressed |= msClicked|msDown;
+ else if (event.type == OSystem::EVENT_RBUTTONDOWN)
+ _rightBtnPressed |= msClicked|msDown;
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
@@ -173,9 +155,7 @@
_mouse.x /= 2;
_mouse.y = _mouse.y * 4 / 7;
}
-#endif
break;
-
case OSystem::EVENT_LBUTTONUP:
_leftBtnPressed &= ~msDown;
break;
More information about the Scummvm-git-logs
mailing list