From ce9a15f010d84c8596380eec5226ef22704022e5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 23 Mar 2014 21:52:18 -0400 Subject: MADS: Fix the setting/clearing of _mouseReleased flag --- engines/mads/events.cpp | 6 ++++++ engines/mads/events.h | 2 ++ 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) { -- cgit v1.2.3