F10 at main menu quits game
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1031 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
Changes towards version 0.3:
|
Changes towards version 0.3:
|
||||||
|
- Exiting from the main menu with F10 now exits the game -Michael
|
||||||
- Changed lander speed to 35 FPS, which matches reported 3DO speed
|
- Changed lander speed to 35 FPS, which matches reported 3DO speed
|
||||||
(Bug #22) -Michael
|
(Bug #22) -Michael
|
||||||
- Added a Menu-Delete key for the Super-Melee menu (#123) -Michael
|
- Added a Menu-Delete key for the Super-Melee menu (#123) -Michael
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ BOOLEAN
|
|||||||
DoConfirmExit (void)
|
DoConfirmExit (void)
|
||||||
{
|
{
|
||||||
BOOLEAN result;
|
BOOLEAN result;
|
||||||
|
static BOOLEAN in_confirm = FALSE;
|
||||||
fprintf (stderr, "Confirming Exit!\n");
|
fprintf (stderr, "Confirming Exit!\n");
|
||||||
if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE)
|
if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE)
|
||||||
SuspendGameClock ();
|
SuspendGameClock ();
|
||||||
@@ -79,7 +80,7 @@ DoConfirmExit (void)
|
|||||||
PauseTrack ();
|
PauseTrack ();
|
||||||
|
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (in_confirm)
|
||||||
{
|
{
|
||||||
result = FALSE;
|
result = FALSE;
|
||||||
ExitRequested = FALSE;
|
ExitRequested = FALSE;
|
||||||
@@ -92,6 +93,7 @@ DoConfirmExit (void)
|
|||||||
CONTEXT oldContext;
|
CONTEXT oldContext;
|
||||||
BOOLEAN response = TRUE, done;
|
BOOLEAN response = TRUE, done;
|
||||||
|
|
||||||
|
in_confirm = TRUE;
|
||||||
oldContext = SetContext (ScreenContext);
|
oldContext = SetContext (ScreenContext);
|
||||||
|
|
||||||
r.extent.width = CONFIRM_WIN_WIDTH;
|
r.extent.width = CONFIRM_WIN_WIDTH;
|
||||||
@@ -167,6 +169,7 @@ DoConfirmExit (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf (stderr, "Exit was %sconfirmed.\n", result ? "" : "NOT ");
|
fprintf (stderr, "Exit was %sconfirmed.\n", result ? "" : "NOT ");
|
||||||
|
in_confirm = FALSE;
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ void SetMenuRepeatDelay (DWORD min, DWORD max, DWORD step, BOOLEAN gestalt);
|
|||||||
void SetDefaultMenuRepeatDelay (void);
|
void SetDefaultMenuRepeatDelay (void);
|
||||||
void ResetKeyRepeat (void);
|
void ResetKeyRepeat (void);
|
||||||
BOOLEAN PauseGame (void);
|
BOOLEAN PauseGame (void);
|
||||||
extern BOOLEAN DoConfirmExit (void);
|
BOOLEAN DoConfirmExit (void);
|
||||||
|
void TFB_Abort (void);
|
||||||
|
|
||||||
BATTLE_INPUT_STATE p1_combat_summary (void);
|
BATTLE_INPUT_STATE p1_combat_summary (void);
|
||||||
BATTLE_INPUT_STATE p2_combat_summary (void);
|
BATTLE_INPUT_STATE p2_combat_summary (void);
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ SDL_Surface *SDL_Screens[TFB_GFX_NUMSCREENS];
|
|||||||
|
|
||||||
volatile int TransitionAmount = 255;
|
volatile int TransitionAmount = 255;
|
||||||
SDL_Rect TransitionClipRect;
|
SDL_Rect TransitionClipRect;
|
||||||
|
static volatile BOOLEAN abortFlag = FALSE;
|
||||||
|
|
||||||
int GfxFlags = 0;
|
int GfxFlags = 0;
|
||||||
|
|
||||||
@@ -46,6 +47,12 @@ static TFB_Palette palette[256];
|
|||||||
#define FPS_PERIOD 1000
|
#define FPS_PERIOD 1000
|
||||||
int RenderedFrames = 0;
|
int RenderedFrames = 0;
|
||||||
|
|
||||||
|
void
|
||||||
|
TFB_Abort (void)
|
||||||
|
{
|
||||||
|
abortFlag = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
TFB_InitGraphics (int driver, int flags, int width, int height, int bpp)
|
TFB_InitGraphics (int driver, int flags, int width, int height, int bpp)
|
||||||
{
|
{
|
||||||
@@ -123,7 +130,7 @@ TFB_ProcessEvents ()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ImmediateInputState.abort)
|
if (ImmediateInputState.abort || abortFlag)
|
||||||
exit (0);
|
exit (0);
|
||||||
if (ImmediateInputState.debug)
|
if (ImmediateInputState.debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ TFB_InitInput (int driver, int flags)
|
|||||||
VControl_ResetInput ();
|
VControl_ResetInput ();
|
||||||
InputInitialized = TRUE;
|
InputInitialized = TRUE;
|
||||||
|
|
||||||
|
atexit (TFB_UninitInput);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-17
@@ -86,9 +86,6 @@ DoRestart (PMENU_STATE pMS)
|
|||||||
{
|
{
|
||||||
/* Cancel any presses of the Pause or Exit keys. */
|
/* Cancel any presses of the Pause or Exit keys. */
|
||||||
GamePaused = FALSE;
|
GamePaused = FALSE;
|
||||||
ExitRequested = FALSE;
|
|
||||||
GameExiting = FALSE;
|
|
||||||
|
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
@@ -104,6 +101,10 @@ 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)
|
||||||
|
{
|
||||||
|
return (FALSE);
|
||||||
|
}
|
||||||
else if (!(CurrentMenuState.up || CurrentMenuState.down ||
|
else if (!(CurrentMenuState.up || CurrentMenuState.down ||
|
||||||
CurrentMenuState.left || CurrentMenuState.right ||
|
CurrentMenuState.left || CurrentMenuState.right ||
|
||||||
CurrentMenuState.select))
|
CurrentMenuState.select))
|
||||||
@@ -250,6 +251,7 @@ LastActivity = WON_LAST_BATTLE;
|
|||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
|
|
||||||
FlushInput ();
|
FlushInput ();
|
||||||
|
GameExiting = FALSE;
|
||||||
DoInput ((PVOID)&MenuState, TRUE);
|
DoInput ((PVOID)&MenuState, TRUE);
|
||||||
|
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
@@ -257,22 +259,13 @@ LastActivity = WON_LAST_BATTLE;
|
|||||||
ClearSemaphore (GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
DestroyDrawable (ReleaseDrawable (s.frame));
|
DestroyDrawable (ReleaseDrawable (s.frame));
|
||||||
|
|
||||||
|
if (GameExiting)
|
||||||
|
{
|
||||||
|
TFB_Abort ();
|
||||||
|
}
|
||||||
|
|
||||||
if (GLOBAL (CurrentActivity) == (ACTIVITY)~0)
|
if (GLOBAL (CurrentActivity) == (ACTIVITY)~0)
|
||||||
goto TimedOut;
|
goto TimedOut;
|
||||||
#ifdef TESTING
|
|
||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
|
||||||
{
|
|
||||||
WaitForSoundEnd (WAIT_ALL_SOUNDS);
|
|
||||||
StopSound ();
|
|
||||||
|
|
||||||
FreeSC2Data ();
|
|
||||||
FreeLanderData ();
|
|
||||||
FreeIPData ();
|
|
||||||
FreeHyperData ();
|
|
||||||
FlushColorXForms ();
|
|
||||||
return (FALSE);
|
|
||||||
}
|
|
||||||
#endif /* TESTING */
|
|
||||||
|
|
||||||
TimeOut = XFormColorMap ((COLORMAPPTR)black_buf, ONE_SECOND / 2);
|
TimeOut = XFormColorMap ((COLORMAPPTR)black_buf, ONE_SECOND / 2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user