[Scummvm-cvs-logs] SF.net SVN: scummvm:[42173] scummvm/trunk/engines/cruise

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Mon Jul 6 14:33:05 CEST 2009


Revision: 42173
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42173&view=rev
Author:   dreammaster
Date:     2009-07-06 12:33:05 +0000 (Mon, 06 Jul 2009)

Log Message:
-----------
Removed all the current special cases coding for user (mouse press) waiting, and reimplemented it exactly the way the original did

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/gfxModule.cpp

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2009-07-06 11:33:28 UTC (rev 42172)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2009-07-06 12:33:05 UTC (rev 42173)
@@ -40,8 +40,6 @@
 
 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 @@
 		// 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,36 +1784,31 @@
 //      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);
 			/*    main3 = 0;
@@ -1837,10 +1832,8 @@
 				PCFadeFlag = 0;
 
 			/*if (!PCFadeFlag)*/
-			if (!isUserWait) {
-				mainDraw(0);
-				flipScreen();
-			}
+			mainDraw(userWait);
+			flipScreen();
 
 			if (userEnabled && !userWait && !autoTrack) {
 				if (currentActiveMenu == -1) {
@@ -1874,38 +1867,9 @@
 				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 @@
 
 						char* pText = getText(autoMsg, autoOvl);
 
-						if (strlen(pText)) {
+						if (strlen(pText))
 							userWait = 1;
-
-							mainDraw(0);
-							flipScreen();
-						}
 					}
 
 					changeScriptParamInList(-1, -1, &relHead, 9998, 0);

Modified: scummvm/trunk/engines/cruise/gfxModule.cpp
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.cpp	2009-07-06 11:33:28 UTC (rev 42172)
+++ scummvm/trunk/engines/cruise/gfxModule.cpp	2009-07-06 12:33:05 UTC (rev 42173)
@@ -40,7 +40,6 @@
 
 int palDirtyMin = 256;
 int palDirtyMax = -1;
-bool isBlack = false;
 
 gfxModuleDataStruct gfxModuleData = {
 	0,			// use Tandy
@@ -238,12 +237,6 @@
 		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);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list