[Scummvm-cvs-logs] CVS: scummvm/bs2 build_display.cpp,1.18,1.19 console.cpp,1.8,1.9 logic.cpp,1.7,1.8 mem_view.cpp,1.4,1.5 resman.cpp,1.19,1.20 startup.cpp,1.8,1.9 sword2.cpp,1.25,1.26

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Tue Sep 9 05:46:12 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv843

Modified Files:
	build_display.cpp console.cpp logic.cpp mem_view.cpp 
	resman.cpp startup.cpp sword2.cpp 
Log Message:
Our ServiceWindows() never returns RDERR_APPCLOSED, and we always behave as
if we have the focus, so there's no need to check.


Index: build_display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/build_display.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- build_display.cpp	9 Sep 2003 12:14:08 -0000	1.18
+++ build_display.cpp	9 Sep 2003 12:45:33 -0000	1.19
@@ -272,9 +272,7 @@
  			// ---------------------------------------------------
 			// ready - blit to screen
 
-			// if the game is being shut down, drop out
-			if (ServiceWindows() == RDERR_APPCLOSED)
-				break;
+			ServiceWindows();
 
  			//----------------------------------------------------
 			// update our fps reading
@@ -406,19 +404,7 @@
 	uint32 targetTime = SVM_timeGetTime() + (time * 1000);
 
 	while (SVM_timeGetTime() < targetTime) {
-		//--------------------------------------------------
-		// Service windows
-		while (!gotTheFocus)
-			if (ServiceWindows() == RDERR_APPCLOSED)
-				break;
-
-		// if we pressed Ctrl-Q
-		if (ServiceWindows() == RDERR_APPCLOSED) {
-			Close_game();	//close engine systems down
-			CloseAppWindow();
-			exit(0);	//quit the game
-		}
- 		//--------------------------------------------------
+		ServiceWindows();
 
 		EraseBackBuffer();		// for hardware rendering
 		EraseSoftwareScreenBuffer();	// for software rendering

Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/console.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- console.cpp	23 Aug 2003 14:42:37 -0000	1.8
+++ console.cpp	9 Sep 2003 12:45:33 -0000	1.9
@@ -252,20 +252,8 @@
 
 	while (TRUE)
 	{
-		if (ServiceWindows() == RDERR_APPCLOSED)
-		{
-			break;
-		}
-
-		while (!gotTheFocus)
-		{
-			if (ServiceWindows() == RDERR_APPCLOSED)
-			{
-				breakOut = 1;
-				break;
-			}
+		ServiceWindows();
 
-		}
 		if (breakOut)
 		{
 			break;
@@ -903,19 +891,9 @@
 
 				do
 				{
-			 		//--------------------------------------------------
 					// Service windows
-					while (!gotTheFocus)
-						if (ServiceWindows() == RDERR_APPCLOSED)
-							break;
 
-				  	if (ServiceWindows() == RDERR_APPCLOSED)	// if we pressed Ctrl-Q
-					{
-						Close_game();	//close engine systems down
-						CloseAppWindow();
-						exit(0);	//quit the game
-					}
- 					//--------------------------------------------------
+				  	ServiceWindows();
 				}
 				while(!KeyWaiting());
 
@@ -1133,19 +1111,9 @@
 
 				do
 				{
-			 		//--------------------------------------------------
 					// Service windows
-					while (!gotTheFocus)
-						if (ServiceWindows() == RDERR_APPCLOSED)
-							break;
 
-				  	if (ServiceWindows() == RDERR_APPCLOSED)	// if we pressed Ctrl-Q
-					{
-						Close_game();	//close engine systems down
-						CloseAppWindow();
-						exit(0);	//quit the game
-					}
- 					//--------------------------------------------------
+					ServiceWindows();
 				}
 				while(!KeyWaiting());
 

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/logic.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- logic.cpp	8 Sep 2003 15:38:29 -0000	1.7
+++ logic.cpp	9 Sep 2003 12:45:33 -0000	1.8
@@ -314,19 +314,7 @@
 
 				do
 				{
-			 		//--------------------------------------------------
-					// Service windows
-					while (!gotTheFocus)
-						if (ServiceWindows() == RDERR_APPCLOSED)
-							break;
-
-				  	if (ServiceWindows() == RDERR_APPCLOSED)	// if we pressed Ctrl-Q
-					{
-						Close_game();	//close engine systems down
-						CloseAppWindow();
-						exit(0);	//quit the game
-					}
- 					//--------------------------------------------------
+					ServiceWindows();
 				}
 				while(!KeyWaiting());
 

Index: mem_view.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/mem_view.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mem_view.cpp	19 Aug 2003 14:57:26 -0000	1.4
+++ mem_view.cpp	9 Sep 2003 12:45:33 -0000	1.5
@@ -130,19 +130,8 @@
 
 			do
 			{
-			 	//--------------------------------------------------
 				// Service windows
-				while (!gotTheFocus)
-					if (ServiceWindows() == RDERR_APPCLOSED)
-						break;
-
-				if (ServiceWindows() == RDERR_APPCLOSED)	// if we pressed Ctrl-Q
-				{
-					Close_game();	//close engine systems down
-					CloseAppWindow();
-					exit(0);	//quit the game
-				}
- 				//--------------------------------------------------
+				ServiceWindows();
 			}
 			while(!KeyWaiting());
 

Index: resman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/resman.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- resman.cpp	9 Sep 2003 12:14:08 -0000	1.19
+++ resman.cpp	9 Sep 2003 12:45:33 -0000	1.20
@@ -790,16 +790,7 @@
 						Build_display();
 
 						do {
-							// if we pressed Ctrl-Q
-				  			if (ServiceWindows() == RDERR_APPCLOSED) {
-								Close_game();	//close engine systems down
-								CloseAppWindow();
-								exit(0);	//quit the game
-							}
-
- 							while (!gotTheFocus)
-								if (ServiceWindows() == RDERR_APPCLOSED)
-									break;
+							ServiceWindows();
 						} while(!KeyWaiting());
 
 						ReadKey(&c);	//kill the key we just pressed
@@ -871,16 +862,7 @@
 							Build_display();
 
 							do {
-								// if we pressed Ctrl-Q
-				  				if (ServiceWindows() == RDERR_APPCLOSED) {
-									Close_game();	//close engine systems down
-									CloseAppWindow();
-									exit(0);	//quit the game
-								}
-
-								while (!gotTheFocus)
-									if (ServiceWindows() == RDERR_APPCLOSED)
-										break;
+								ServiceWindows();
 							} while(!KeyWaiting());
 
 
@@ -1105,14 +1087,8 @@
 
 		//--------------------------------------------------
 		// Service windows
-		// NOTE: Carry on even when not got the focus!!!
 
-		// if we pressed Ctrl-Q
-		if (ServiceWindows() == RDERR_APPCLOSED) {
-			Close_game();	//close engine systems down
-			CloseAppWindow();
-			exit(0);	//quit the game
-		}
+		ServiceWindows();
  		//--------------------------------------------------
 	} while ((read % BUFFERSIZE) == 0);
 
@@ -1312,27 +1288,16 @@
 		//--------------------------------------------------
 		// Service windows
 
-		// if we pressed Ctrl-Q
-		if (ServiceWindows() == RDERR_APPCLOSED) {
-			Close_game();	//close engine systems down
-			CloseAppWindow();
-			exit(0);	//quit the game
-		}
-
- 		while (!gotTheFocus)
-			if (ServiceWindows() == RDERR_APPCLOSED)
-				break;
+		ServiceWindows();
 
 		//--------------------------------------------------
 	
-		if (gotTheFocus) {
-			EraseBackBuffer();		// for hardware rendering
-			EraseSoftwareScreenBuffer();	// for software rendering
-			DrawSprite(&spriteInfo);	// Keep the message there even when the user task swaps.
-			spriteInfo.y = oldY;		// Drivers change the y co-ordinate, don't know why...
-			spriteInfo.x = oldX;
-			CopyScreenBuffer();
-		}
+		EraseBackBuffer();		// for hardware rendering
+		EraseSoftwareScreenBuffer();	// for software rendering
+		DrawSprite(&spriteInfo);	// Keep the message there even when the user task swaps.
+		spriteInfo.y = oldY;		// Drivers change the y co-ordinate, don't know why...
+		spriteInfo.x = oldX;
+		CopyScreenBuffer();
 	} while (!done);
 
 	Free_mem(text_spr);

Index: startup.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/startup.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- startup.cpp	19 Aug 2003 14:57:26 -0000	1.8
+++ startup.cpp	9 Sep 2003 12:45:33 -0000	1.9
@@ -213,19 +213,9 @@
 
 				do
 				{
-			 		//--------------------------------------------------
 					// Service windows
-					while (!gotTheFocus)
-						if (ServiceWindows() == RDERR_APPCLOSED)
-							break;
 
-					if (ServiceWindows() == RDERR_APPCLOSED)	// if we pressed Ctrl-Q
-					{
-						Close_game();	//close engine systems down
-						CloseAppWindow();
-						exit(0);	//quit the game
-					}
- 					//--------------------------------------------------
+					ServiceWindows();
 				}
 				while(!KeyWaiting());
 

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- sword2.cpp	8 Sep 2003 15:38:29 -0000	1.25
+++ sword2.cpp	9 Sep 2003 12:45:33 -0000	1.26
@@ -336,11 +336,7 @@
 
 	while (TRUE)
 	{
-		if (ServiceWindows() == RDERR_APPCLOSED)
-		{
-			break;		// break out of main game loop
-		}
-
+		ServiceWindows();
 		
 		// check for events
 		parseEvents();
@@ -348,15 +344,6 @@
 		if (grabbingSequences && (!console_status))
 			GrabScreenShot();
 #endif
-
-		while (!gotTheFocus)
-		{
-			if (ServiceWindows() == RDERR_APPCLOSED)
-			{
-				breakOut = 1;
-				break;	// break out of this while-loop
-			}
-		}
 
 		if (breakOut)	// if we are closing down the game
 			break;		// break out of main game loop





More information about the Scummvm-git-logs mailing list