diff options
author | Nipun Garg | 2019-06-28 23:36:43 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:04 +0200 |
commit | f41e1999fb6397a8feeb7c105a40d77072ce1123 (patch) | |
tree | fa20a263034536409088687ee54c501634c4a30e /engines | |
parent | 037400ed1bae31704ea7421420ed0686a9af180d (diff) | |
download | scummvm-rg350-f41e1999fb6397a8feeb7c105a40d77072ce1123.tar.gz scummvm-rg350-f41e1999fb6397a8feeb7c105a40d77072ce1123.tar.bz2 scummvm-rg350-f41e1999fb6397a8feeb7c105a40d77072ce1123.zip |
HDB: Add updateMouse() and call it in game loop
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/hdb.cpp | 3 | ||||
-rw-r--r-- | engines/hdb/input.cpp | 24 | ||||
-rw-r--r-- | engines/hdb/input.h | 2 |
3 files changed, 29 insertions, 0 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index d73228d39c..d0c65b5c0a 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -451,6 +451,9 @@ Common::Error HDBGame::run() { case Common::EVENT_QUIT: case Common::EVENT_RTL: break; + case Common::EVENT_MOUSEMOVE: + _input->updateMouse(event.mouse.x, event.mouse.y); + break; case Common::EVENT_KEYDOWN: debug("Key was pressed."); break; diff --git a/engines/hdb/input.cpp b/engines/hdb/input.cpp index c421b12a25..41dbc9d8cb 100644 --- a/engines/hdb/input.cpp +++ b/engines/hdb/input.cpp @@ -152,4 +152,28 @@ void Input::stylusMove(int x, int y) { } } +void Input::updateMouse(int newX, int newY) { + _lastMouseX = _mouseX; + _lastMouseY = _mouseY; + _mouseX = newX; + _mouseY = newY; + + if (_mouseX < 0) + _mouseX = 0; + else if (_mouseX >= kScreenWidth) + _mouseX = kScreenWidth - 1; + + if (_mouseY < 0) + _mouseY = 0; + else if (_mouseY >= kScreenHeight) + _mouseY = kScreenHeight - 1; + + // Turn Cursor back on? + if ((_lastMouseX != _mouseX || _lastMouseY != _mouseY) && !g_hdb->_drawMan->getPointer()) { + g_hdb->_drawMan->showPointer(true); + } + + warning("STUB: updateMouse: Update Mouse buttons"); +} + } // End of Namespace diff --git a/engines/hdb/input.h b/engines/hdb/input.h index 0b6a3db2b4..211d9d4cb9 100644 --- a/engines/hdb/input.h +++ b/engines/hdb/input.h @@ -53,6 +53,8 @@ public: void stylusUp(int x, int y); void stylusMove(int x, int y); + void updateMouse(int newX, int newY); + int getMouseX() { return _mouseX; } |