From 9b2c90c0b3323aac8d3fd49c20fa1121946996e2 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 6 Aug 2016 22:16:45 +0200 Subject: [PATCH] MOHAWK: The ignoreNextMouseUp workaround is not necessary anymore We now check the mouse up event happens on the same hotspot as the mouse down event. --- engines/mohawk/riven.cpp | 10 ++-------- engines/mohawk/riven.h | 2 -- engines/mohawk/riven_scripts.cpp | 7 ------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index f31f12de0ea..9ed7b22ac10 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -56,7 +56,6 @@ MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescriptio _gameOver = false; _activatedPLST = false; _activatedSLST = false; - _ignoreNextMouseUp = false; _extrasFile = nullptr; _curStack = kStackUnknown; _gfx = nullptr; @@ -230,13 +229,8 @@ void MohawkEngine_Riven::handleEvents() { _card->onMouseDown(_eventMan->getMousePos()); break; case Common::EVENT_LBUTTONUP: - // See RivenScript::switchCard() for more information on why we sometimes - // disable the next up event. - if (!_ignoreNextMouseUp) { - _card->onMouseUp(_eventMan->getMousePos()); - checkInventoryClick(); - } - _ignoreNextMouseUp = false; + _card->onMouseUp(_eventMan->getMousePos()); + checkInventoryClick(); break; case Common::EVENT_KEYDOWN: switch (event.kbd.keycode) { diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index 1c8f3f1509c..0e951b60766 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -155,7 +155,6 @@ private: // Miscellaneous bool _gameOver; - bool _ignoreNextMouseUp; void checkSunnerAlertClick(); public: @@ -183,7 +182,6 @@ public: // Miscellaneous void setGameOver() { _gameOver = true; } - void ignoreNextMouseUp() { _ignoreNextMouseUp = true; } Common::SeekableReadStream *getExtrasResource(uint32 tag, uint16 id); bool _activatedPLST; bool _activatedSLST; diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index 6a86a98c82f..d220045779e 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -303,13 +303,6 @@ void RivenSimpleCommand::drawBitmap(uint16 op, uint16 argc, uint16 *argv) { // Command 2: go to card (card id) void RivenSimpleCommand::switchCard(uint16 op, uint16 argc, uint16 *argv) { _vm->changeToCard(argv[0]); - - // WORKAROUND: If we changed card on a mouse down event, - // we want to ignore the next mouse up event so we don't - // change card when lifting the mouse on the next card. -// TODO: Restore -// if (_scriptType == kMouseDownScript) -// _vm->ignoreNextMouseUp(); } // Command 3: play an SLST from the script