Removed the redundant "GameExiting" variable
All such tests are done via checking the "CHECK_ABORT" flag in GLOBAL (CurrentActivity). The abort test in restart.c had to be done later because of this. At some point this assigning of ~0 to GLOBAL (CurrentActivity) should itself be excised. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1047 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -102,7 +102,6 @@ Introduction (void)
|
||||
//
|
||||
}
|
||||
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||
GameExiting = FALSE;
|
||||
xform_buf[0] = FadeAllToBlack;
|
||||
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2));
|
||||
|
||||
|
||||
@@ -597,7 +597,6 @@ DoQuitMenu (PMENU_STATE pMS)
|
||||
case YES_QUIT_MENU:
|
||||
GLOBAL (CurrentActivity) |= CHECK_ABORT;
|
||||
ExitRequested = FALSE;
|
||||
GameExiting = TRUE;
|
||||
break;
|
||||
}
|
||||
FeedbackQuit (pMS->CurState);
|
||||
|
||||
@@ -19,4 +19,4 @@
|
||||
#include "input_common.h"
|
||||
#include "inpintrn.h"
|
||||
|
||||
volatile BOOLEAN ExitRequested, GameExiting, GamePaused;
|
||||
volatile BOOLEAN ExitRequested, GamePaused;
|
||||
|
||||
@@ -132,7 +132,7 @@ TFB_InitInput (int driver, int flags)
|
||||
(void)driver;
|
||||
(void)flags;
|
||||
|
||||
GamePaused = GameExiting = ExitRequested = FALSE;
|
||||
GamePaused = ExitRequested = FALSE;
|
||||
|
||||
SDL_EnableUNICODE(1);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user