diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index ff46696..5aa3926 100644
a
|
b
|
void CruiseEngine::mainLoop() {
|
1799 | 1799 | // Handle frame delay |
1800 | 1800 | uint32 currentTick = g_system->getMillis(); |
1801 | 1801 | |
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; |
1805 | 1804 | |
1806 | | do { |
1807 | | g_system->delayMillis(10); |
1808 | | currentTick = g_system->getMillis(); |
| 1805 | do { |
| 1806 | if (userEnabled && !userWait && !autoTrack) { |
| 1807 | if (currentActiveMenu == -1) { |
| 1808 | static int16 oldMouseX = -1; |
| 1809 | static int16 oldMouseY = -1; |
1809 | 1810 | |
1810 | | if (!skipEvents) |
1811 | | skipEvents = manageEvents(); |
| 1811 | getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY); |
| 1812 | |
| 1813 | if (mouseX != oldMouseX || mouseY != oldMouseY) { |
| 1814 | int objectType; |
| 1815 | int newCursor1; |
| 1816 | int newCursor2; |
1812 | 1817 | |
1813 | | if (playerDontAskQuit) |
1814 | | break; |
| 1818 | oldMouseX = mouseX; |
| 1819 | oldMouseY = mouseY; |
1815 | 1820 | |
1816 | | _vm->getDebugger()->onFrame(); |
1817 | | } while (currentTick < lastTick + _gameSpeed); |
1818 | | } else { |
1819 | | manageEvents(); |
| 1821 | objectType = findObject(mouseX, mouseY, &newCursor1, &newCursor2); |
1820 | 1822 | |
1821 | | if (currentTick >= (lastTickDebug + 10)) { |
1822 | | lastTickDebug = currentTick; |
1823 | | _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); |
1824 | 1836 | } |
1825 | | } |
| 1837 | g_system->updateScreen(); |
| 1838 | |
| 1839 | if (!skipEvents || bFastMode) |
| 1840 | skipEvents = manageEvents(); |
| 1841 | |
| 1842 | if (bFastMode) { |
| 1843 | if (currentTick >= (lastTickDebug + 10)) |
| 1844 | lastTickDebug = currentTick; |
| 1845 | } else { |
| 1846 | g_system->delayMillis(10); |
| 1847 | currentTick = g_system->getMillis(); |
| 1848 | } |
| 1849 | |
| 1850 | if (playerDontAskQuit) |
| 1851 | break; |
| 1852 | |
| 1853 | _vm->getDebugger()->onFrame(); |
| 1854 | } while (currentTick < lastTick + _gameSpeed && !bFastMode); |
1826 | 1855 | if (playerDontAskQuit) |
1827 | 1856 | break; |
1828 | 1857 | |
… |
… |
void CruiseEngine::mainLoop() {
|
1842 | 1871 | // readKeyboard(); |
1843 | 1872 | |
1844 | 1873 | bool isUserWait = userWait != 0; |
| 1874 | if (userDelay) { |
| 1875 | currentMouseButton = 0; |
| 1876 | } |
1845 | 1877 | playerDontAskQuit = processInput(); |
1846 | 1878 | if (playerDontAskQuit) |
1847 | 1879 | break; |
… |
… |
void CruiseEngine::mainLoop() {
|
1853 | 1885 | |
1854 | 1886 | if (userDelay && !userWait) { |
1855 | 1887 | userDelay--; |
1856 | | continue; |
1857 | 1888 | } |
1858 | 1889 | |
1859 | 1890 | if (isUserWait & !userWait) { |
… |
… |
void CruiseEngine::mainLoop() {
|
1916 | 1947 | mainDraw(userWait); |
1917 | 1948 | flipScreen(); |
1918 | 1949 | |
1919 | | if (userEnabled && !userWait && !autoTrack) { |
1920 | | if (currentActiveMenu == -1) { |
1921 | | static int16 oldMouseX = -1; |
1922 | | static int16 oldMouseY = -1; |
1923 | | |
1924 | | getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY); |
1925 | | |
1926 | | if (mouseX != oldMouseX || mouseY != oldMouseY) { |
1927 | | int objectType; |
1928 | | int newCursor1; |
1929 | | int newCursor2; |
1930 | | |
1931 | | oldMouseX = mouseX; |
1932 | | oldMouseY = mouseY; |
1933 | | |
1934 | | objectType = findObject(mouseX, mouseY, &newCursor1, &newCursor2); |
1935 | | |
1936 | | if (objectType == 9) { |
1937 | | changeCursor(CURSOR_EXIT); |
1938 | | } else if (objectType != -1) { |
1939 | | changeCursor(CURSOR_MAGNIFYING_GLASS); |
1940 | | } else { |
1941 | | changeCursor(CURSOR_WALK); |
1942 | | } |
1943 | | } |
1944 | | } else { |
1945 | | changeCursor(CURSOR_NORMAL); |
1946 | | } |
1947 | | } else { |
1948 | | changeCursor(CURSOR_NORMAL); |
1949 | | } |
1950 | | |
1951 | 1950 | if (userWait == 1) { |
1952 | 1951 | // Waiting for press - original wait loop has been integrated into the |
1953 | 1952 | // main event loop |
… |
… |
void CruiseEngine::mainLoop() {
|
1976 | 1975 | removeCell(&cellHead, autoOvl, autoMsg, 5, masterScreen); |
1977 | 1976 | autoMsg = -1; |
1978 | 1977 | } |
1979 | | } else { |
1980 | | // Keep ScummVM being responsive even when displayOn is false |
1981 | | g_system->updateScreen(); |
1982 | 1978 | } |
1983 | 1979 | |
1984 | 1980 | } while (!playerDontAskQuit && quitValue2 && quitValue != 7); |