From 3abc1e8375989b21d47f383f9184d74ca504951c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 6 Jul 2009 12:33:05 +0000 Subject: Removed all the current special cases coding for user (mouse press) waiting, and reimplemented it exactly the way the original did svn-id: r42173 --- engines/cruise/cruise_main.cpp | 80 +++++++++++------------------------------- 1 file changed, 20 insertions(+), 60 deletions(-) (limited to 'engines/cruise/cruise_main.cpp') diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 26f66d4433..56f1c2c975 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -40,8 +40,6 @@ unsigned int timer = 0; gfxEntryStruct* linkedMsgList = NULL; -extern bool isBlack; - void drawBlackSolidBoxSmall() { // gfxModuleData.drawSolidBox(64,100,256,117,0); drawSolidBox(64, 100, 256, 117, 0); @@ -1343,6 +1341,8 @@ int CruiseEngine::processInput(void) { // Check for left mouse button click or Space to end user waiting if ((keyboardCode == Common::KEYCODE_SPACE) || (button == MB_LEFT)) userWait = 0; + + keyboardCode = Common::KEYCODE_INVALID; return 0; } @@ -1784,35 +1784,30 @@ void CruiseEngine::mainLoop(void) { // t_start=Osystem_GetTicks(); // readKeyboard(); - bool isUserWait = userWait != 0; + 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); - - mainDraw(0); - flipScreen(); - } - if (enableUser) { userEnabled = 1; enableUser = 0; } - if (userWait < 1) { - manageScripts(&relHead); - manageScripts(&procHead); + if (isUserWait & !userWait) { + // User waiting has ended + changeScriptParamInList(-1, -1, &procHead, 9999, 0); + changeScriptParamInList(-1, -1, &relHead, 9999, 0); + } - removeFinishedScripts(&relHead); - removeFinishedScripts(&procHead); + manageScripts(&relHead); + manageScripts(&procHead); - processAnimation(); - } + removeFinishedScripts(&relHead); + removeFinishedScripts(&procHead); + + processAnimation(); if (remdo) { // ASSERT(0); @@ -1837,10 +1832,8 @@ void CruiseEngine::mainLoop(void) { PCFadeFlag = 0; /*if (!PCFadeFlag)*/ - if (!isUserWait) { - mainDraw(0); - flipScreen(); - } + mainDraw(userWait); + flipScreen(); if (userEnabled && !userWait && !autoTrack) { if (currentActiveMenu == -1) { @@ -1874,38 +1867,9 @@ void CruiseEngine::mainLoop(void) { changeCursor(CURSOR_NORMAL); } - if (isUserWait) { - // User Wait handling - if (userWait == 1) { - // Initial step - do { - // Make sure any previous mouse press is released - getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY); - } while (mouseButton != 0); - - ++userWait; -// mainDraw(0); -// flipScreen(); - } else { - // Standard handling -/* - manageScripts(&relHead); - manageScripts(&procHead); - - removeFinishedScripts(&relHead); - removeFinishedScripts(&procHead); -*/ - if (isBlack) { - // This is a bit of a hack to ensure that user waits directly after a palette fade - // have time to restore the palette before waiting starts - mainDraw(0); - flipScreen(); - } else { - // Draw the next screen - processAnimation(); - gfxModuleData_flipScreen(); - } - } + if (userWait == 1) { + // Waiting for press - original wait loop has been integrated into the + // main event loop continue; } @@ -1917,12 +1881,8 @@ void CruiseEngine::mainLoop(void) { char* pText = getText(autoMsg, autoOvl); - if (strlen(pText)) { + if (strlen(pText)) userWait = 1; - - mainDraw(0); - flipScreen(); - } } changeScriptParamInList(-1, -1, &relHead, 9998, 0); -- cgit v1.2.3