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:
|
Changes towards version 0.3:
|
||||||
|
- Removed the redundant "GameExiting" variable -Michael
|
||||||
- Added quit options to ingame menu (bug #409), from Paxtez
|
- Added quit options to ingame menu (bug #409), from Paxtez
|
||||||
- Fix position of blinking save/load in melee (bug #406), from Paxtez
|
- Fix position of blinking save/load in melee (bug #406), from Paxtez
|
||||||
- New packaging/io system. - SvdB
|
- New packaging/io system. - SvdB
|
||||||
|
|||||||
@@ -167,13 +167,11 @@ DoConfirmExit (void)
|
|||||||
DestroyDrawable (ReleaseDrawable (s.frame));
|
DestroyDrawable (ReleaseDrawable (s.frame));
|
||||||
if (response)
|
if (response)
|
||||||
{
|
{
|
||||||
GameExiting = TRUE;
|
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = FALSE;
|
result = FALSE;
|
||||||
GameExiting = FALSE;
|
|
||||||
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||||
}
|
}
|
||||||
ExitRequested = FALSE;
|
ExitRequested = FALSE;
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ Introduction (void)
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||||
GameExiting = FALSE;
|
|
||||||
xform_buf[0] = FadeAllToBlack;
|
xform_buf[0] = FadeAllToBlack;
|
||||||
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2));
|
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2));
|
||||||
|
|
||||||
|
|||||||
@@ -597,7 +597,6 @@ DoQuitMenu (PMENU_STATE pMS)
|
|||||||
case YES_QUIT_MENU:
|
case YES_QUIT_MENU:
|
||||||
GLOBAL (CurrentActivity) |= CHECK_ABORT;
|
GLOBAL (CurrentActivity) |= CHECK_ABORT;
|
||||||
ExitRequested = FALSE;
|
ExitRequested = FALSE;
|
||||||
GameExiting = TRUE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
FeedbackQuit (pMS->CurState);
|
FeedbackQuit (pMS->CurState);
|
||||||
|
|||||||
@@ -19,4 +19,4 @@
|
|||||||
#include "input_common.h"
|
#include "input_common.h"
|
||||||
#include "inpintrn.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)driver;
|
||||||
(void)flags;
|
(void)flags;
|
||||||
|
|
||||||
GamePaused = GameExiting = ExitRequested = FALSE;
|
GamePaused = ExitRequested = FALSE;
|
||||||
|
|
||||||
SDL_EnableUNICODE(1);
|
SDL_EnableUNICODE(1);
|
||||||
|
|
||||||
|
|||||||
@@ -840,7 +840,7 @@ DoLoadTeam (PMELEE_STATE pMS)
|
|||||||
{
|
{
|
||||||
SIZE index;
|
SIZE index;
|
||||||
|
|
||||||
if (GameExiting)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
@@ -1163,7 +1163,7 @@ AdvanceCursor (PMELEE_STATE pMS)
|
|||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
DoEdit (PMELEE_STATE pMS)
|
DoEdit (PMELEE_STATE pMS)
|
||||||
{
|
{
|
||||||
if (GameExiting)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
@@ -1306,7 +1306,7 @@ DoPickShip (PMELEE_STATE pMS)
|
|||||||
{
|
{
|
||||||
STARSHIPPTR StarShipPtr;
|
STARSHIPPTR StarShipPtr;
|
||||||
|
|
||||||
if (GameExiting)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
if (pMS->Initialized <= 0)
|
if (pMS->Initialized <= 0)
|
||||||
@@ -1585,7 +1585,7 @@ static BOOLEAN
|
|||||||
DoMelee (PMELEE_STATE pMS)
|
DoMelee (PMELEE_STATE pMS)
|
||||||
{
|
{
|
||||||
BOOLEAN force_select = FALSE;
|
BOOLEAN force_select = FALSE;
|
||||||
if (GameExiting)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
|
|||||||
@@ -184,10 +184,10 @@ GetMeleeStarShip (STARSHIPPTR LastStarShipPtr, COUNT which_player)
|
|||||||
else if (!(PlayerControl[1 - which_player] & PSYTRON_CONTROL)
|
else if (!(PlayerControl[1 - which_player] & PSYTRON_CONTROL)
|
||||||
&& NewTime - LastTime >= ONE_SECOND * 3)
|
&& NewTime - LastTime >= ONE_SECOND * 3)
|
||||||
InputState = (*(PlayerInput[1 - which_player])) ();
|
InputState = (*(PlayerInput[1 - which_player])) ();
|
||||||
if (GameExiting)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
{
|
{
|
||||||
hBattleShip = 0;
|
hBattleShip = 0;
|
||||||
GameExiting = FALSE;
|
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +205,6 @@ GetMeleeStarShip (STARSHIPPTR LastStarShipPtr, COUNT which_player)
|
|||||||
if (hBattleShip || (col == NUM_MELEE_COLS_ORIG && ConfirmExit ()))
|
if (hBattleShip || (col == NUM_MELEE_COLS_ORIG && ConfirmExit ()))
|
||||||
{
|
{
|
||||||
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||||
GameExiting = FALSE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ DoRestart (PMENU_STATE pMS)
|
|||||||
#ifdef TESTING
|
#ifdef TESTING
|
||||||
else if (InputState & DEVICE_EXIT) return (FALSE);
|
else if (InputState & DEVICE_EXIT) return (FALSE);
|
||||||
#endif /* TESTING */
|
#endif /* TESTING */
|
||||||
else if (GameExiting)
|
else if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
{
|
{
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
@@ -251,7 +251,7 @@ LastActivity = WON_LAST_BATTLE;
|
|||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
|
|
||||||
FlushInput ();
|
FlushInput ();
|
||||||
GameExiting = FALSE;
|
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||||
DoInput ((PVOID)&MenuState, TRUE);
|
DoInput ((PVOID)&MenuState, TRUE);
|
||||||
|
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
@@ -259,14 +259,14 @@ LastActivity = WON_LAST_BATTLE;
|
|||||||
ClearSemaphore (GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
DestroyDrawable (ReleaseDrawable (s.frame));
|
DestroyDrawable (ReleaseDrawable (s.frame));
|
||||||
|
|
||||||
if (GameExiting)
|
if (GLOBAL (CurrentActivity) == (ACTIVITY)~0)
|
||||||
|
goto TimedOut;
|
||||||
|
|
||||||
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
{
|
{
|
||||||
TFB_Abort ();
|
TFB_Abort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) == (ACTIVITY)~0)
|
|
||||||
goto TimedOut;
|
|
||||||
|
|
||||||
TimeOut = XFormColorMap ((COLORMAPPTR)black_buf, ONE_SECOND / 2);
|
TimeOut = XFormColorMap ((COLORMAPPTR)black_buf, ONE_SECOND / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,6 @@ SaveProblem (void)
|
|||||||
SaveProblemMessage (&s);
|
SaveProblemMessage (&s);
|
||||||
|
|
||||||
GLOBAL (CurrentActivity) |= CHECK_ABORT;
|
GLOBAL (CurrentActivity) |= CHECK_ABORT;
|
||||||
GameExiting = TRUE;
|
|
||||||
|
|
||||||
while (AnyButtonPress (FALSE));
|
while (AnyButtonPress (FALSE));
|
||||||
do
|
do
|
||||||
@@ -233,7 +232,6 @@ SaveProblem (void)
|
|||||||
} while (cont);
|
} while (cont);
|
||||||
|
|
||||||
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||||
GameExiting = FALSE;
|
|
||||||
|
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ extern DRAWABLE CreatePixmapRegion (FRAME Frame, PPOINT pOrg, SIZE width,
|
|||||||
|
|
||||||
extern void SetPrimNextLink (PPRIMITIVE pPrim, COUNT Link);
|
extern void SetPrimNextLink (PPRIMITIVE pPrim, COUNT Link);
|
||||||
extern COUNT GetPrimNextLink (PPRIMITIVE pPrim);
|
extern COUNT GetPrimNextLink (PPRIMITIVE pPrim);
|
||||||
extern volatile BOOLEAN GamePaused, GameExiting, ExitRequested;
|
extern volatile BOOLEAN GamePaused, ExitRequested;
|
||||||
|
|
||||||
//Added by Chris
|
//Added by Chris
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user