diff options
| author | Torbjörn Andersson | 2003-09-09 12:45:33 +0000 | 
|---|---|---|
| committer | Torbjörn Andersson | 2003-09-09 12:45:33 +0000 | 
| commit | 5bf1974a0853f9b1d303f74f45c23e6d409ecb5d (patch) | |
| tree | 5318ff58394c04d5dbb72e3c5baad28c4e5340bb | |
| parent | 555dae9feeaaf2559dfe4c9fb4fb5dbcb19404c0 (diff) | |
| download | scummvm-rg350-5bf1974a0853f9b1d303f74f45c23e6d409ecb5d.tar.gz scummvm-rg350-5bf1974a0853f9b1d303f74f45c23e6d409ecb5d.tar.bz2 scummvm-rg350-5bf1974a0853f9b1d303f74f45c23e6d409ecb5d.zip | |
Our ServiceWindows() never returns RDERR_APPCLOSED, and we always behave as
if we have the focus, so there's no need to check.
svn-id: r10130
| -rw-r--r-- | sword2/build_display.cpp | 18 | ||||
| -rw-r--r-- | sword2/console.cpp | 38 | ||||
| -rw-r--r-- | sword2/driver/render.cpp | 3 | ||||
| -rw-r--r-- | sword2/logic.cpp | 14 | ||||
| -rw-r--r-- | sword2/mem_view.cpp | 13 | ||||
| -rw-r--r-- | sword2/resman.cpp | 55 | ||||
| -rw-r--r-- | sword2/startup.cpp | 14 | ||||
| -rw-r--r-- | sword2/sword2.cpp | 15 | 
8 files changed, 21 insertions, 149 deletions
| diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp index c71deb0829..c388bfde19 100644 --- a/sword2/build_display.cpp +++ b/sword2/build_display.cpp @@ -272,9 +272,7 @@ void Build_display(void) {	//Tony21Sept96   			// ---------------------------------------------------  			// 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 @@ void DisplayMsg(uint8 *text, int time) { 	// Chris 15May97  	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 diff --git a/sword2/console.cpp b/sword2/console.cpp index 5fe5034535..e1ecbc8d4b 100644 --- a/sword2/console.cpp +++ b/sword2/console.cpp @@ -252,20 +252,8 @@ uint32	Tconsole(uint32	mode)	//Tony9Oct96  	while (TRUE)  	{ -		if (ServiceWindows() == RDERR_APPCLOSED) -		{ -			break; -		} - -		while (!gotTheFocus) -		{ -			if (ServiceWindows() == RDERR_APPCLOSED) -			{ -				breakOut = 1; -				break; -			} +		ServiceWindows(); -		}  		if (breakOut)  		{  			break; @@ -903,19 +891,9 @@ void	Con_help(void)	//Tony13Aug96  				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 @@ void	Con_list_savegames(void)	// (James05feb97)	Tony1Apr97  				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()); diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp index e2bade672e..80e801d837 100644 --- a/sword2/driver/render.cpp +++ b/sword2/driver/render.cpp @@ -1027,8 +1027,7 @@ void sleepUntil(int32 time) {  		// Make sure menu animations and fades don't suffer  		ProcessMenu(); -		if (ServiceWindows() == RDERR_APPCLOSED) -			break; +		ServiceWindows();  		g_system->delay_msecs(10);  	} diff --git a/sword2/logic.cpp b/sword2/logic.cpp index 61a6ba8367..1642ed8ed9 100644 --- a/sword2/logic.cpp +++ b/sword2/logic.cpp @@ -314,19 +314,7 @@ uint32	logic::Examine_run_list(void)	//Tony25Oct96  				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()); diff --git a/sword2/mem_view.cpp b/sword2/mem_view.cpp index 7930ae6fcd..3f50b04b9d 100644 --- a/sword2/mem_view.cpp +++ b/sword2/mem_view.cpp @@ -130,19 +130,8 @@ void	Console_mem_display(void)	//Tony13Aug96  			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()); diff --git a/sword2/resman.cpp b/sword2/resman.cpp index c1a064d3e7..14f5b3acc6 100644 --- a/sword2/resman.cpp +++ b/sword2/resman.cpp @@ -790,16 +790,7 @@ void resMan::Kill_all_res(uint8 wantInfo) {	//Tony29Nov96  						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 @@ void resMan::Kill_all_objects(uint8 wantInfo) {		// James17jan97  							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 @@ void resMan::CacheNewCluster(uint32 newCluster) {  		//--------------------------------------------------  		// 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 @@ void resMan::GetCd(int cd) {  		//--------------------------------------------------  		// 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); diff --git a/sword2/startup.cpp b/sword2/startup.cpp index 43056a1f53..073955e286 100644 --- a/sword2/startup.cpp +++ b/sword2/startup.cpp @@ -213,19 +213,9 @@ uint32	Con_print_start_menu(void)	//Tony14Oct96  				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()); diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp index 5889613a1a..be72bbc020 100644 --- a/sword2/sword2.cpp +++ b/sword2/sword2.cpp @@ -336,11 +336,7 @@ void Sword2State::go()  	while (TRUE)  	{ -		if (ServiceWindows() == RDERR_APPCLOSED) -		{ -			break;		// break out of main game loop -		} - +		ServiceWindows();  		// check for events  		parseEvents(); @@ -349,15 +345,6 @@ void Sword2State::go()  			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 | 
