aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/cruise_main.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2009-07-06 12:33:05 +0000
committerPaul Gilbert2009-07-06 12:33:05 +0000
commit3abc1e8375989b21d47f383f9184d74ca504951c (patch)
treed0a415e0cd41647135d01cc994966a63f10406e4 /engines/cruise/cruise_main.cpp
parent250a1a915a6645baa5586aebfe5978730bca9b5b (diff)
downloadscummvm-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
Diffstat (limited to 'engines/cruise/cruise_main.cpp')
-rw-r--r--engines/cruise/cruise_main.cpp80
1 files changed, 20 insertions, 60 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);