aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sword2/build_display.cpp18
-rw-r--r--sword2/console.cpp38
-rw-r--r--sword2/driver/render.cpp3
-rw-r--r--sword2/logic.cpp14
-rw-r--r--sword2/mem_view.cpp13
-rw-r--r--sword2/resman.cpp55
-rw-r--r--sword2/startup.cpp14
-rw-r--r--sword2/sword2.cpp15
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