diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 6e2847d..0501d10 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->updateScreen(); |
| 1805 | do { |
| 1806 | if (userEnabled && !userWait && !autoTrack) { |
| 1807 | if (currentActiveMenu == -1) { |
| 1808 | static int16 oldMouseX = -1; |
| 1809 | static int16 oldMouseY = -1; |
1808 | 1810 | |
1809 | | g_system->delayMillis(10); |
1810 | | currentTick = g_system->getMillis(); |
| 1811 | getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY); |
1811 | 1812 | |
1812 | | if (!skipEvents) |
1813 | | skipEvents = manageEvents(); |
| 1813 | if (mouseX != oldMouseX || mouseY != oldMouseY) { |
| 1814 | int objectType; |
| 1815 | int newCursor1; |
| 1816 | int newCursor2; |
1814 | 1817 | |
1815 | | if (playerDontAskQuit) |
1816 | | break; |
| 1818 | oldMouseX = mouseX; |
| 1819 | oldMouseY = mouseY; |
1817 | 1820 | |
1818 | | _vm->getDebugger()->onFrame(); |
1819 | | } while (currentTick < lastTick + _gameSpeed); |
1820 | | } else { |
1821 | | manageEvents(); |
| 1821 | objectType = findObject(mouseX, mouseY, &newCursor1, &newCursor2); |
1822 | 1822 | |
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); |
1826 | 1836 | } |
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); |
1828 | 1856 | if (playerDontAskQuit) |
1829 | 1857 | break; |
1830 | 1858 | |
… |
… |
void CruiseEngine::mainLoop() {
|
1844 | 1872 | // readKeyboard(); |
1845 | 1873 | |
1846 | 1874 | bool isUserWait = userWait != 0; |
| 1875 | if (userDelay) { |
| 1876 | currentMouseButton = 0; |
| 1877 | } |
1847 | 1878 | playerDontAskQuit = processInput(); |
1848 | 1879 | if (playerDontAskQuit) |
1849 | 1880 | break; |
… |
… |
void CruiseEngine::mainLoop() {
|
1855 | 1886 | |
1856 | 1887 | if (userDelay && !userWait) { |
1857 | 1888 | userDelay--; |
1858 | | continue; |
1859 | 1889 | } |
1860 | 1890 | |
1861 | 1891 | if (isUserWait & !userWait) { |
… |
… |
void CruiseEngine::mainLoop() {
|
1918 | 1948 | mainDraw(userWait); |
1919 | 1949 | flipScreen(); |
1920 | 1950 | |
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 | | |
1953 | 1951 | if (userWait == 1) { |
1954 | 1952 | // Waiting for press - original wait loop has been integrated into the |
1955 | 1953 | // main event loop |