diff options
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; } |