diff options
author | Nipun Garg | 2019-06-29 00:42:48 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:04 +0200 |
commit | ff25a0f4dd69ebe38867366b60a60f4b49633af8 (patch) | |
tree | 4d16247b3ef085efcf334038b51c3829d0dabe03 | |
parent | 5e0e12531b51fc3f904ec11849f62aa73a928c22 (diff) | |
download | scummvm-rg350-ff25a0f4dd69ebe38867366b60a60f4b49633af8.tar.gz scummvm-rg350-ff25a0f4dd69ebe38867366b60a60f4b49633af8.tar.bz2 scummvm-rg350-ff25a0f4dd69ebe38867366b60a60f4b49633af8.zip |
HDB: Add updateMouseButtons and update updateMouse
-rw-r--r-- | engines/hdb/hdb.cpp | 18 | ||||
-rw-r--r-- | engines/hdb/input.cpp | 40 | ||||
-rw-r--r-- | engines/hdb/input.h | 1 |
3 files changed, 58 insertions, 1 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index d0c65b5c0a..0edad42ce5 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -454,6 +454,24 @@ Common::Error HDBGame::run() { case Common::EVENT_MOUSEMOVE: _input->updateMouse(event.mouse.x, event.mouse.y); break; + case Common::EVENT_LBUTTONDOWN: + _input->updateMouseButtons(1, 0, 0); + break; + case Common::EVENT_LBUTTONUP: + _input->updateMouseButtons(-1, 0, 0); + break; + case Common::EVENT_MBUTTONDOWN: + _input->updateMouseButtons(0, 1, 0); + break; + case Common::EVENT_MBUTTONUP: + _input->updateMouseButtons(0, -1, 0); + break; + case Common::EVENT_RBUTTONDOWN: + _input->updateMouseButtons(0, 0, 1); + break; + case Common::EVENT_RBUTTONUP: + _input->updateMouseButtons(0, 0, -1); + break; case Common::EVENT_KEYDOWN: debug("Key was pressed."); break; diff --git a/engines/hdb/input.cpp b/engines/hdb/input.cpp index 462c65cafa..e19b5ee83c 100644 --- a/engines/hdb/input.cpp +++ b/engines/hdb/input.cpp @@ -171,7 +171,45 @@ void Input::updateMouse(int newX, int newY) { g_hdb->_drawMan->showPointer(true); } - warning("STUB: updateMouse: Update Mouse buttons"); + // Check if LButton is being dragged + if (_mouseLButton) { + stylusMove(_mouseX, _mouseY); + } +} + +void Input::updateMouseButtons(int l, int m, int r) { + _mouseLButton += l; + _mouseMButton += m; + _mouseRButton += r; + + // Check if LButton has been pressed + // Check if LButton has been lifted + if (_mouseLButton) { + if (_mouseX > (kScreenWidth - 32 * 5) && _mouseY < 240) { + g_hdb->_window->checkInvSelect(_mouseX, _mouseY); + } else if (_mouseX > (kScreenWidth - 32 * 5) && _mouseY >= 240) { + warning("STUB: updateMouseButtons: checkDeliveriesSelect() required"); + } else { + warning("STUB: updateMouseButtons: Add pause check"); + stylusDown(_mouseX, _mouseY); + } + } else if (!_mouseLButton) { + stylusUp(_mouseX, _mouseY); + } + + // Check if MButton has been pressed + if (_mouseMButton) { + warning("STUB: updateMouseButtons: Add pause check"); + g_hdb->_ai->clearWaypoints(); + warning("STUB: Play SND_POP"); + } + + // Check if RButton has been pressed + if (_mouseRButton) { + warning("STUB: updateMouseButtons: Add pause check"); + uint16 buttons = getButtons() | kButtonB; + setButtons(buttons); + } } } // End of Namespace diff --git a/engines/hdb/input.h b/engines/hdb/input.h index d649c21928..a296bba391 100644 --- a/engines/hdb/input.h +++ b/engines/hdb/input.h @@ -51,6 +51,7 @@ public: void stylusMove(int x, int y); void updateMouse(int newX, int newY); + void updateMouseButtons(int l, int m, int r); int getMouseX() { return _mouseX; |