diff options
-rw-r--r-- | engines/cruise/cruise_main.cpp | 59 |
1 files changed, 35 insertions, 24 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 891e4bc4e7..752c8ded50 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -1298,18 +1298,11 @@ int processInput(void) { buttonDown = 0; } - if (userDelay) { + if (userDelay && !userWait) { userDelay--; return 0; } - // Player Menu - test for both buttons or the F10 key - if (((button & MB_BOTH) == MB_BOTH) || (keyboardCode == Common::KEYCODE_F10)) { - changeCursor(CURSOR_NORMAL); - keyboardCode = Common::KEYCODE_INVALID; - return (playerMenu(mouseX, mouseY)); - } - // Check for Exit 'X' key if (keyboardCode == Common::KEYCODE_x) return 1; @@ -1344,6 +1337,20 @@ int processInput(void) { return 0; } + // Player Menu - test for both buttons or the F10 key + if (((button & MB_BOTH) == MB_BOTH) || (keyboardCode == Common::KEYCODE_F10)) { + changeCursor(CURSOR_NORMAL); + keyboardCode = Common::KEYCODE_INVALID; + return (playerMenu(mouseX, mouseY)); + } + + if (userWait) { + // Check for left mouse button click or Space to end user waiting + if ((keyboardCode == Common::KEYCODE_SPACE) || (button == MB_LEFT)) + userWait = 0; + return 0; + } + if (!userEnabled) { return 0; } @@ -1759,10 +1766,18 @@ void CruiseEngine::mainLoop(void) { // t_start=Osystem_GetTicks(); // readKeyboard(); + bool isUserWait = userWait != 0; + playerDontAskQuit = processInput(); if (playerDontAskQuit) break; + if (isUserWait && !userWait) { + // User waiting has ended + changeScriptParamInList(-1, -1, &procHead, 9999, 0); + changeScriptParamInList(-1, -1, &relHead, 9999, 0); + } + if (enableUser) { userEnabled = 1; enableUser = 0; @@ -1799,7 +1814,7 @@ void CruiseEngine::mainLoop(void) { PCFadeFlag = 0; /*if (!PCFadeFlag)*/ - { + if (userWait != 2) { mainDraw(0); flipScreen(); } @@ -1840,11 +1855,16 @@ void CruiseEngine::mainLoop(void) { changeCursor(CURSOR_NORMAL); } - if (userWait) { - int16 mouseButton = 0; - checkInput(&mouseButton); + if (isUserWait) { + // User Wait handling + if (userWait == 1) { + // Initial step + ++userWait; + mainDraw(0); + flipScreen(); + } else { + // Standard handling - while (!mouseButton) { manageScripts(&relHead); manageScripts(&procHead); @@ -1853,18 +1873,9 @@ void CruiseEngine::mainLoop(void) { // Draw the next screen processAnimation(); - mainDraw(0); - flipScreen(); - - // not exactly this - manageEvents(); - - checkInput(&mouseButton); + gfxModuleData_flipScreen(); } - - changeScriptParamInList(-1, -1, &procHead, 9999, 0); - changeScriptParamInList(-1, -1, &relHead, 9999, 0); - userWait = 0; + continue; } // wait for character to finish auto track |