MADS: Fix the setting/clearing of _mouseReleased flag

This commit is contained in:
Paul Gilbert 2014-03-23 21:52:18 -04:00
parent c57acfb154
commit ce9a15f010
3 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -141,6 +141,8 @@ public:
uint32 getFrameCounter() const { return _frameCounter; }
void initVars();
void resetMouseFlags();
};
} // End of namespace MADS

View File

@ -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) {