diff options
author | Paul Gilbert | 2014-03-23 21:52:18 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-03-23 21:52:18 -0400 |
commit | ce9a15f010d84c8596380eec5226ef22704022e5 (patch) | |
tree | 3f0a907b6447f181ccbdd965602d78734fa891a8 | |
parent | c57acfb154999b3976c07d6512657c02cc4ef468 (diff) | |
download | scummvm-rg350-ce9a15f010d84c8596380eec5226ef22704022e5.tar.gz scummvm-rg350-ce9a15f010d84c8596380eec5226ef22704022e5.tar.bz2 scummvm-rg350-ce9a15f010d84c8596380eec5226ef22704022e5.zip |
MADS: Fix the setting/clearing of _mouseReleased flag
-rw-r--r-- | engines/mads/events.cpp | 6 | ||||
-rw-r--r-- | engines/mads/events.h | 2 | ||||
-rw-r--r-- | engines/mads/scene.cpp | 9 |
3 files changed, 14 insertions, 3 deletions
diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index fe2a2532c5..a4e1a96a5a 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -132,6 +132,7 @@ void EventsManager::pollEvents() { case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: _mouseClicked = false; + _mouseReleased = true; _mouseMoved = true; return; case Common::EVENT_MOUSEMOVE: @@ -186,4 +187,9 @@ void EventsManager::initVars() { _vD2 = _vD8 = 0; } +void EventsManager::resetMouseFlags() { + _mouseClicked = false; + _mouseReleased = false; +} + } // End of namespace MADS diff --git a/engines/mads/events.h b/engines/mads/events.h index 219af20c2a..b7af148e7e 100644 --- a/engines/mads/events.h +++ b/engines/mads/events.h @@ -141,6 +141,8 @@ public: uint32 getFrameCounter() const { return _frameCounter; } void initVars(); + + void resetMouseFlags(); }; } // End of namespace MADS diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 00460a9d70..8360c1e396 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -272,6 +272,12 @@ void Scene::loop() { // Handle drawing a game frame doFrame(); + // Reset mouse flags + _vm->_events->resetMouseFlags(); + + // TODO: Verify correctness of frame wait + _vm->_events->waitForNextFrame(); + if (_vm->_dialogs->_pendingDialog != DIALOG_NONE && !_vm->_game->_abortTimers && _vm->_game->_player._stepEnabled) _reloadSceneFlag = true; @@ -421,9 +427,6 @@ void Scene::doFrame() { _activeAnimation->free(); _activeAnimation = nullptr; } - - // TODO: Verify correctness of frame wait - _vm->_events->waitForNextFrame(); } void Scene::drawElements(ScreenTransition transitionType, bool surfaceFlag) { |