aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorD G Turner2012-04-20 21:50:26 +0100
committerD G Turner2012-04-21 01:55:03 +0100
commitc4b08c0b98331af3d92d3d2fce6b55b3b25adcc8 (patch)
treea44139027882ddadd54678b4f9a7b11812bdd89a /engines
parentc5363006edf0744adfd0b48a67389213b8bea9ba (diff)
downloadscummvm-rg350-c4b08c0b98331af3d92d3d2fce6b55b3b25adcc8.tar.gz
scummvm-rg350-c4b08c0b98331af3d92d3d2fce6b55b3b25adcc8.tar.bz2
scummvm-rg350-c4b08c0b98331af3d92d3d2fce6b55b3b25adcc8.zip
CRUISE: Move cursor update to upper "idle" loop in main function.
This is the first part of the patch supplied by Ignaz Forster on bug #3423955 ("CRUISE: Slow / unresponsive game behaviour") for avoiding blocking graphical updates during user wait loops. Hotspots passed during the idle loop do _not_ give any user feedback without this patch. The original patch has been split to allow for better understanding of the changes and to allow fine grained bisection if this introduces any regressions.
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/cruise_main.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 6e2847d6d7..4f202ca4f6 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -1804,6 +1804,38 @@ void CruiseEngine::mainLoop() {
bool skipEvents = false;
do {
+ if (userEnabled && !userWait && !autoTrack) {
+ if (currentActiveMenu == -1) {
+ static int16 oldMouseX = -1;
+ static int16 oldMouseY = -1;
+
+ getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
+
+ if (mouseX != oldMouseX || mouseY != oldMouseY) {
+ int objectType;
+ int newCursor1;
+ int newCursor2;
+
+ oldMouseX = mouseX;
+ oldMouseY = mouseY;
+
+ objectType = findObject(mouseX, mouseY, &newCursor1, &newCursor2);
+
+ if (objectType == 9) {
+ changeCursor(CURSOR_EXIT);
+ } else if (objectType != -1) {
+ changeCursor(CURSOR_MAGNIFYING_GLASS);
+ } else {
+ changeCursor(CURSOR_WALK);
+ }
+ }
+ } else {
+ changeCursor(CURSOR_NORMAL);
+ }
+ } else {
+ changeCursor(CURSOR_NORMAL);
+ }
+
g_system->updateScreen();
g_system->delayMillis(10);
@@ -1918,38 +1950,6 @@ void CruiseEngine::mainLoop() {
mainDraw(userWait);
flipScreen();
- if (userEnabled && !userWait && !autoTrack) {
- if (currentActiveMenu == -1) {
- static int16 oldMouseX = -1;
- static int16 oldMouseY = -1;
-
- getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
-
- if (mouseX != oldMouseX || mouseY != oldMouseY) {
- int objectType;
- int newCursor1;
- int newCursor2;
-
- oldMouseX = mouseX;
- oldMouseY = mouseY;
-
- objectType = findObject(mouseX, mouseY, &newCursor1, &newCursor2);
-
- if (objectType == 9) {
- changeCursor(CURSOR_EXIT);
- } else if (objectType != -1) {
- changeCursor(CURSOR_MAGNIFYING_GLASS);
- } else {
- changeCursor(CURSOR_WALK);
- }
- }
- } else {
- changeCursor(CURSOR_NORMAL);
- }
- } else {
- changeCursor(CURSOR_NORMAL);
- }
-
if (userWait == 1) {
// Waiting for press - original wait loop has been integrated into the
// main event loop