Ticket #5879: cruise_dont_block_during_userwait_updated.patch

File cruise_dont_block_during_userwait_updated.patch, 3.6 KB (added by digitall, 12 years ago)

Updated Patch For Git Master 2012-02-17

  • engines/cruise/cruise_main.cpp

    diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
    index 6e2847d..0501d10 100644
    a b void CruiseEngine::mainLoop() {  
    17991799                // Handle frame delay
    18001800                uint32 currentTick = g_system->getMillis();
    18011801
    1802                 if (!bFastMode) {
    1803                         // Delay for the specified amount of time, but still respond to events
    1804                         bool skipEvents = false;
     1802                // Delay for the specified amount of time, but still respond to events
     1803                bool skipEvents = false;
    18051804
    1806                         do {
    1807                                 g_system->updateScreen();
     1805                do {
     1806                        if (userEnabled && !userWait && !autoTrack) {
     1807                                if (currentActiveMenu == -1) {
     1808                                        static int16 oldMouseX = -1;
     1809                                        static int16 oldMouseY = -1;
    18081810
    1809                                 g_system->delayMillis(10);
    1810                                 currentTick = g_system->getMillis();
     1811                                        getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
    18111812
    1812                                 if (!skipEvents)
    1813                                         skipEvents = manageEvents();
     1813                                        if (mouseX != oldMouseX || mouseY != oldMouseY) {
     1814                                                int objectType;
     1815                                                int newCursor1;
     1816                                                int newCursor2;
    18141817
    1815                                 if (playerDontAskQuit)
    1816                                         break;
     1818                                                oldMouseX = mouseX;
     1819                                                oldMouseY = mouseY;
    18171820
    1818                                 _vm->getDebugger()->onFrame();
    1819                         } while (currentTick < lastTick + _gameSpeed);
    1820                 } else {
    1821                         manageEvents();
     1821                                                objectType = findObject(mouseX, mouseY, &newCursor1, &newCursor2);
    18221822
    1823                         if (currentTick >= (lastTickDebug + 10)) {
    1824                                 lastTickDebug = currentTick;
    1825                                 _vm->getDebugger()->onFrame();
     1823                                                if (objectType == 9) {
     1824                                                        changeCursor(CURSOR_EXIT);
     1825                                                } else if (objectType != -1) {
     1826                                                        changeCursor(CURSOR_MAGNIFYING_GLASS);
     1827                                                } else {
     1828                                                        changeCursor(CURSOR_WALK);
     1829                                                }
     1830                                        }
     1831                                } else {
     1832                                        changeCursor(CURSOR_NORMAL);
     1833                                }
     1834                        } else {
     1835                                changeCursor(CURSOR_NORMAL);
    18261836                        }
    1827                 }
     1837
     1838                        g_system->updateScreen();
     1839
     1840                        if (!skipEvents || bFastMode)
     1841                                skipEvents = manageEvents();
     1842
     1843                        if (bFastMode) {
     1844                                if (currentTick >= (lastTickDebug + 10))
     1845                                        lastTickDebug = currentTick;
     1846                        } else {
     1847                                g_system->delayMillis(10);
     1848                                currentTick = g_system->getMillis();
     1849                        }
     1850
     1851                        if (playerDontAskQuit)
     1852                                break;
     1853
     1854                        _vm->getDebugger()->onFrame();
     1855                } while (currentTick < lastTick + _gameSpeed && !bFastMode);
    18281856                if (playerDontAskQuit)
    18291857                        break;
    18301858
    void CruiseEngine::mainLoop() {  
    18441872//      readKeyboard();
    18451873
    18461874                bool isUserWait = userWait != 0;
     1875                if (userDelay) {
     1876                        currentMouseButton = 0;
     1877                }
    18471878                playerDontAskQuit = processInput();
    18481879                if (playerDontAskQuit)
    18491880                        break;
    void CruiseEngine::mainLoop() {  
    18551886
    18561887                if (userDelay && !userWait) {
    18571888                        userDelay--;
    1858                         continue;
    18591889                }
    18601890
    18611891                if (isUserWait & !userWait) {
    void CruiseEngine::mainLoop() {  
    19181948                        mainDraw(userWait);
    19191949                        flipScreen();
    19201950
    1921                         if (userEnabled && !userWait && !autoTrack) {
    1922                                 if (currentActiveMenu == -1) {
    1923                                         static int16 oldMouseX = -1;
    1924                                         static int16 oldMouseY = -1;
    1925 
    1926                                         getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
    1927 
    1928                                         if (mouseX != oldMouseX || mouseY != oldMouseY) {
    1929                                                 int objectType;
    1930                                                 int newCursor1;
    1931                                                 int newCursor2;
    1932 
    1933                                                 oldMouseX = mouseX;
    1934                                                 oldMouseY = mouseY;
    1935 
    1936                                                 objectType = findObject(mouseX, mouseY, &newCursor1, &newCursor2);
    1937 
    1938                                                 if (objectType == 9) {
    1939                                                         changeCursor(CURSOR_EXIT);
    1940                                                 } else if (objectType != -1) {
    1941                                                         changeCursor(CURSOR_MAGNIFYING_GLASS);
    1942                                                 } else {
    1943                                                         changeCursor(CURSOR_WALK);
    1944                                                 }
    1945                                         }
    1946                                 } else {
    1947                                         changeCursor(CURSOR_NORMAL);
    1948                                 }
    1949                         } else {
    1950                                 changeCursor(CURSOR_NORMAL);
    1951                         }
    1952 
    19531951                        if (userWait == 1) {
    19541952                                // Waiting for press - original wait loop has been integrated into the
    19551953                                // main event loop