From bb93268ee21a216162ef077c64462e0ac360df0a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 27 Nov 2014 16:56:03 -0500 Subject: ACCESS: Fix left button flag beig stuck after saving & loading games --- engines/access/access.cpp | 1 + engines/access/events.cpp | 5 +++++ engines/access/events.h | 2 ++ engines/access/room.cpp | 1 + 4 files changed, 9 insertions(+) (limited to 'engines/access') diff --git a/engines/access/access.cpp b/engines/access/access.cpp index 4d326acff6..82c405c48e 100644 --- a/engines/access/access.cpp +++ b/engines/access/access.cpp @@ -491,6 +491,7 @@ Common::Error AccessEngine::loadGameState(int slot) { // Set extra post-load state _room->_function = 1; _timers._timersSavedFlag = false; + _events->clearEvents(); return Common::kNoError; } diff --git a/engines/access/events.cpp b/engines/access/events.cpp index d911e666ea..327fb06dd1 100644 --- a/engines/access/events.cpp +++ b/engines/access/events.cpp @@ -236,6 +236,11 @@ void EventsManager::debounceLeft() { } } +void EventsManager::clearEvents() { + _leftButton = _rightButton = false; + _keypresses.clear(); +} + void EventsManager::waitKeyMouse() { while (!_vm->shouldQuit() && !_leftButton && _keypresses.size() == 0) { pollEvents(); diff --git a/engines/access/events.h b/engines/access/events.h index 0a2a541de9..c72f245412 100644 --- a/engines/access/events.h +++ b/engines/access/events.h @@ -117,6 +117,8 @@ public: void debounceLeft(); + void clearEvents(); + void waitKeyMouse(); bool checkForNextFrameCounter(); diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 57a5c4a88e..9251db4af4 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -494,6 +494,7 @@ void Room::handleCommand(int commandId) { --commandId; if (commandId == 9) { + _vm->_events->debounceLeft(); _vm->_canSaveLoad = true; _vm->openMainMenuDialog(); _vm->_canSaveLoad = false; -- cgit v1.2.3