diff options
author | Paul Gilbert | 2009-07-06 12:33:05 +0000 |
---|---|---|
committer | Paul Gilbert | 2009-07-06 12:33:05 +0000 |
commit | 3abc1e8375989b21d47f383f9184d74ca504951c (patch) | |
tree | d0a415e0cd41647135d01cc994966a63f10406e4 | |
parent | 250a1a915a6645baa5586aebfe5978730bca9b5b (diff) | |
download | scummvm-rg350-3abc1e8375989b21d47f383f9184d74ca504951c.tar.gz scummvm-rg350-3abc1e8375989b21d47f383f9184d74ca504951c.tar.bz2 scummvm-rg350-3abc1e8375989b21d47f383f9184d74ca504951c.zip |
Removed all the current special cases coding for user (mouse press) waiting, and reimplemented it exactly the way the original did
svn-id: r42173
-rw-r--r-- | engines/cruise/cruise_main.cpp | 80 | ||||
-rw-r--r-- | engines/cruise/gfxModule.cpp | 7 |
2 files changed, 20 insertions, 67 deletions
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); diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index 50e6587d90..47d3f49204 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -40,7 +40,6 @@ palEntry lpalette[256]; int palDirtyMin = 256; int palDirtyMax = -1; -bool isBlack = false; gfxModuleDataStruct gfxModuleData = { 0, // use Tandy @@ -238,12 +237,6 @@ void flip() { g_system->setPalette(paletteRGBA + palDirtyMin*4, palDirtyMin, palDirtyMax - palDirtyMin + 1); palDirtyMin = 256; palDirtyMax = -1; - - isBlack = true; - for (i = 0; i < 256; ++i) { - isBlack = (lpalette[i].R == 0) && (lpalette[i].G == 0) && (lpalette[i].B == 0); - if (!isBlack) break; - } } g_system->copyRectToScreen(globalScreen, 320, 0, 0, 320, 200); |