diff options
author | Max Horn | 2005-10-15 10:31:55 +0000 |
---|---|---|
committer | Max Horn | 2005-10-15 10:31:55 +0000 |
commit | dca6f248eea71c2674a8475860c6c2129cf58a4d (patch) | |
tree | e2d27a8e2af4e6abf94db6fc664cb0ce4d329dda | |
parent | 6e446ad46f1608bf8918e3e4f0184eb931d5aefe (diff) | |
download | scummvm-rg350-dca6f248eea71c2674a8475860c6c2129cf58a4d.tar.gz scummvm-rg350-dca6f248eea71c2674a8475860c6c2129cf58a4d.tar.bz2 scummvm-rg350-dca6f248eea71c2674a8475860c6c2129cf58a4d.zip |
Unified mouse pos update code
svn-id: r19097
-rw-r--r-- | scumm/input.cpp | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/scumm/input.cpp b/scumm/input.cpp index 51a9d739a2..e8bb3018bd 100644 --- a/scumm/input.cpp +++ b/scumm/input.cpp @@ -137,34 +137,16 @@ void ScummEngine::parseEvents() { _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 @@ void ScummEngine::parseEvents() { _mouse.x /= 2; _mouse.y = _mouse.y * 4 / 7; } -#endif break; - case OSystem::EVENT_LBUTTONUP: _leftBtnPressed &= ~msDown; break; |