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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun May 31 12:14:41 CEST 2009


Revision: 41063
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41063&view=rev
Author:   dreammaster
Date:     2009-05-31 10:14:41 +0000 (Sun, 31 May 2009)

Log Message:
-----------
Merged the wait for mouse press event loop into the main loop, fixing animation glitch and enabling pausing, player menu, and exiting the game when waiting for a mouse press

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

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2009-05-31 10:11:25 UTC (rev 41062)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2009-05-31 10:14:41 UTC (rev 41063)
@@ -1298,18 +1298,11 @@
 		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 @@
 		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 @@
 //      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 @@
 				PCFadeFlag = 0;
 
 			/*if (!PCFadeFlag)*/
-			{
+			if (userWait != 2) {
 				mainDraw(0);
 				flipScreen();
 			}
@@ -1840,11 +1855,16 @@
 				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 @@
 
 					// 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


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