diff --git a/sc2/ChangeLog b/sc2/ChangeLog index b0500d098..8c450c012 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.3: +- Removed the redundant "GameExiting" variable -Michael - Added quit options to ingame menu (bug #409), from Paxtez - Fix position of blinking save/load in melee (bug #406), from Paxtez - New packaging/io system. - SvdB diff --git a/sc2/src/sc2code/confirm.c b/sc2/src/sc2code/confirm.c index ade59ff1a..57a1061b6 100644 --- a/sc2/src/sc2code/confirm.c +++ b/sc2/src/sc2code/confirm.c @@ -167,13 +167,11 @@ DoConfirmExit (void) DestroyDrawable (ReleaseDrawable (s.frame)); if (response) { - GameExiting = TRUE; result = TRUE; } else { result = FALSE; - GameExiting = FALSE; GLOBAL (CurrentActivity) &= ~CHECK_ABORT; } ExitRequested = FALSE; diff --git a/sc2/src/sc2code/fmv.c b/sc2/src/sc2code/fmv.c index ec333cbd9..9276f3c33 100644 --- a/sc2/src/sc2code/fmv.c +++ b/sc2/src/sc2code/fmv.c @@ -102,7 +102,6 @@ Introduction (void) // } GLOBAL (CurrentActivity) &= ~CHECK_ABORT; - GameExiting = FALSE; xform_buf[0] = FadeAllToBlack; SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2)); diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index 4632a7292..bcace4bf8 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -597,7 +597,6 @@ DoQuitMenu (PMENU_STATE pMS) case YES_QUIT_MENU: GLOBAL (CurrentActivity) |= CHECK_ABORT; ExitRequested = FALSE; - GameExiting = TRUE; break; } FeedbackQuit (pMS->CurState); diff --git a/sc2/src/sc2code/libs/input/input_common.c b/sc2/src/sc2code/libs/input/input_common.c index 436a3447b..14b80d3f3 100644 --- a/sc2/src/sc2code/libs/input/input_common.c +++ b/sc2/src/sc2code/libs/input/input_common.c @@ -19,4 +19,4 @@ #include "input_common.h" #include "inpintrn.h" -volatile BOOLEAN ExitRequested, GameExiting, GamePaused; +volatile BOOLEAN ExitRequested, GamePaused; diff --git a/sc2/src/sc2code/libs/input/sdl/input.c b/sc2/src/sc2code/libs/input/sdl/input.c index 29b35ce0f..912a4d5b4 100644 --- a/sc2/src/sc2code/libs/input/sdl/input.c +++ b/sc2/src/sc2code/libs/input/sdl/input.c @@ -132,7 +132,7 @@ TFB_InitInput (int driver, int flags) (void)driver; (void)flags; - GamePaused = GameExiting = ExitRequested = FALSE; + GamePaused = ExitRequested = FALSE; SDL_EnableUNICODE(1); diff --git a/sc2/src/sc2code/melee.c b/sc2/src/sc2code/melee.c index 254d7c6f1..d60e77c3a 100644 --- a/sc2/src/sc2code/melee.c +++ b/sc2/src/sc2code/melee.c @@ -840,7 +840,7 @@ DoLoadTeam (PMELEE_STATE pMS) { SIZE index; - if (GameExiting) + if (GLOBAL (CurrentActivity) & CHECK_ABORT) return (FALSE); if (!pMS->Initialized) @@ -1163,7 +1163,7 @@ AdvanceCursor (PMELEE_STATE pMS) static BOOLEAN DoEdit (PMELEE_STATE pMS) { - if (GameExiting) + if (GLOBAL (CurrentActivity) & CHECK_ABORT) return (FALSE); if (!pMS->Initialized) { @@ -1306,7 +1306,7 @@ DoPickShip (PMELEE_STATE pMS) { STARSHIPPTR StarShipPtr; - if (GameExiting) + if (GLOBAL (CurrentActivity) & CHECK_ABORT) return (FALSE); if (pMS->Initialized <= 0) @@ -1585,7 +1585,7 @@ static BOOLEAN DoMelee (PMELEE_STATE pMS) { BOOLEAN force_select = FALSE; - if (GameExiting) + if (GLOBAL (CurrentActivity) & CHECK_ABORT) return (FALSE); if (!pMS->Initialized) diff --git a/sc2/src/sc2code/pickmele.c b/sc2/src/sc2code/pickmele.c index cc5ed5c63..24a0af2d4 100644 --- a/sc2/src/sc2code/pickmele.c +++ b/sc2/src/sc2code/pickmele.c @@ -184,10 +184,10 @@ GetMeleeStarShip (STARSHIPPTR LastStarShipPtr, COUNT which_player) else if (!(PlayerControl[1 - which_player] & PSYTRON_CONTROL) && NewTime - LastTime >= ONE_SECOND * 3) InputState = (*(PlayerInput[1 - which_player])) (); - if (GameExiting) + if (GLOBAL (CurrentActivity) & CHECK_ABORT) { hBattleShip = 0; - GameExiting = FALSE; + GLOBAL (CurrentActivity) &= ~CHECK_ABORT; break; } @@ -205,7 +205,6 @@ GetMeleeStarShip (STARSHIPPTR LastStarShipPtr, COUNT which_player) if (hBattleShip || (col == NUM_MELEE_COLS_ORIG && ConfirmExit ())) { GLOBAL (CurrentActivity) &= ~CHECK_ABORT; - GameExiting = FALSE; break; } } diff --git a/sc2/src/sc2code/restart.c b/sc2/src/sc2code/restart.c index d469773fd..f9f388c2f 100644 --- a/sc2/src/sc2code/restart.c +++ b/sc2/src/sc2code/restart.c @@ -101,7 +101,7 @@ DoRestart (PMENU_STATE pMS) #ifdef TESTING else if (InputState & DEVICE_EXIT) return (FALSE); #endif /* TESTING */ - else if (GameExiting) + else if (GLOBAL (CurrentActivity) & CHECK_ABORT) { return (FALSE); } @@ -251,7 +251,7 @@ LastActivity = WON_LAST_BATTLE; UnbatchGraphics (); FlushInput (); - GameExiting = FALSE; + GLOBAL (CurrentActivity) &= ~CHECK_ABORT; DoInput ((PVOID)&MenuState, TRUE); SetSemaphore (GraphicsSem); @@ -259,14 +259,14 @@ LastActivity = WON_LAST_BATTLE; ClearSemaphore (GraphicsSem); DestroyDrawable (ReleaseDrawable (s.frame)); - if (GameExiting) + if (GLOBAL (CurrentActivity) == (ACTIVITY)~0) + goto TimedOut; + + if (GLOBAL (CurrentActivity) & CHECK_ABORT) { TFB_Abort (); } - if (GLOBAL (CurrentActivity) == (ACTIVITY)~0) - goto TimedOut; - TimeOut = XFormColorMap ((COLORMAPPTR)black_buf, ONE_SECOND / 2); } diff --git a/sc2/src/sc2code/save.c b/sc2/src/sc2code/save.c index c88d334f0..73ca9cc6b 100644 --- a/sc2/src/sc2code/save.c +++ b/sc2/src/sc2code/save.c @@ -217,7 +217,6 @@ SaveProblem (void) SaveProblemMessage (&s); GLOBAL (CurrentActivity) |= CHECK_ABORT; - GameExiting = TRUE; while (AnyButtonPress (FALSE)); do @@ -233,7 +232,6 @@ SaveProblem (void) } while (cont); GLOBAL (CurrentActivity) &= ~CHECK_ABORT; - GameExiting = FALSE; BatchGraphics (); DrawStamp (&s); diff --git a/sc2/src/sc2code/starcon.h b/sc2/src/sc2code/starcon.h index 2f745892b..c1ffa1622 100644 --- a/sc2/src/sc2code/starcon.h +++ b/sc2/src/sc2code/starcon.h @@ -215,7 +215,7 @@ extern DRAWABLE CreatePixmapRegion (FRAME Frame, PPOINT pOrg, SIZE width, extern void SetPrimNextLink (PPRIMITIVE pPrim, COUNT Link); extern COUNT GetPrimNextLink (PPRIMITIVE pPrim); -extern volatile BOOLEAN GamePaused, GameExiting, ExitRequested; +extern volatile BOOLEAN GamePaused, ExitRequested; //Added by Chris