From ef8597d806611060162459d1b3b865cb24df2fcf Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 31 Jul 2009 23:27:19 +0000 Subject: Fix bug with the event loop that was discarding pending events rather than leaving them to be processed in the following frame svn-id: r42965 --- engines/cruise/cruise_main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 19495ff931..94dfc95cb5 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -1625,11 +1625,10 @@ bool bFastMode = false; bool manageEvents() { Common::Event event; - bool result = false; Common::EventManager * eventMan = g_system->getEventManager(); - while (eventMan->pollEvent(event) && !result) { - result = true; + while (eventMan->pollEvent(event)) { + bool abortFlag = true; switch (event.type) { case Common::EVENT_LBUTTONDOWN: @@ -1647,7 +1646,7 @@ bool manageEvents() { case Common::EVENT_MOUSEMOVE: currentMouseX = event.mouse.x; currentMouseY = event.mouse.y; - result = false; + abortFlag = false; break; case Common::EVENT_QUIT: case Common::EVENT_RTL: @@ -1686,9 +1685,12 @@ bool manageEvents() { default: break; } + + if (abortFlag) + return true; } - return result; + return false; } void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton, int16 *pMouseY) { -- cgit v1.2.3