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:
mcmartin
2003-07-07 02:51:42 +00:00
parent 66d523545c
commit e3dac2cd1f
6 changed files with 26 additions and 20 deletions
+1
View File
@@ -1,4 +1,5 @@
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
(Bug #22) -Michael
- Added a Menu-Delete key for the Super-Melee menu (#123) -Michael
+4 -1
View File
@@ -72,6 +72,7 @@ BOOLEAN
DoConfirmExit (void)
{
BOOLEAN result;
static BOOLEAN in_confirm = FALSE;
fprintf (stderr, "Confirming Exit!\n");
if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE)
SuspendGameClock ();
@@ -79,7 +80,7 @@ DoConfirmExit (void)
PauseTrack ();
SetSemaphore (GraphicsSem);
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
if (in_confirm)
{
result = FALSE;
ExitRequested = FALSE;
@@ -92,6 +93,7 @@ DoConfirmExit (void)
CONTEXT oldContext;
BOOLEAN response = TRUE, done;
in_confirm = TRUE;
oldContext = SetContext (ScreenContext);
r.extent.width = CONFIRM_WIN_WIDTH;
@@ -167,6 +169,7 @@ DoConfirmExit (void)
}
fprintf (stderr, "Exit was %sconfirmed.\n", result ? "" : "NOT ");
in_confirm = FALSE;
return (result);
}
+2 -1
View File
@@ -62,7 +62,8 @@ void SetMenuRepeatDelay (DWORD min, DWORD max, DWORD step, BOOLEAN gestalt);
void SetDefaultMenuRepeatDelay (void);
void ResetKeyRepeat (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 p2_combat_summary (void);
@@ -38,6 +38,7 @@ SDL_Surface *SDL_Screens[TFB_GFX_NUMSCREENS];
volatile int TransitionAmount = 255;
SDL_Rect TransitionClipRect;
static volatile BOOLEAN abortFlag = FALSE;
int GfxFlags = 0;
@@ -46,6 +47,12 @@ static TFB_Palette palette[256];
#define FPS_PERIOD 1000
int RenderedFrames = 0;
void
TFB_Abort (void)
{
abortFlag = TRUE;
}
int
TFB_InitGraphics (int driver, int flags, int width, int height, int bpp)
{
@@ -123,7 +130,7 @@ TFB_ProcessEvents ()
break;
}
}
if (ImmediateInputState.abort)
if (ImmediateInputState.abort || abortFlag)
exit (0);
if (ImmediateInputState.debug)
{
+1
View File
@@ -168,6 +168,7 @@ TFB_InitInput (int driver, int flags)
VControl_ResetInput ();
InputInitialized = TRUE;
atexit (TFB_UninitInput);
return 0;
}
+10 -17
View File
@@ -86,9 +86,6 @@ DoRestart (PMENU_STATE pMS)
{
/* Cancel any presses of the Pause or Exit keys. */
GamePaused = FALSE;
ExitRequested = FALSE;
GameExiting = FALSE;
if (!pMS->Initialized)
{
@@ -104,6 +101,10 @@ DoRestart (PMENU_STATE pMS)
#ifdef TESTING
else if (InputState & DEVICE_EXIT) return (FALSE);
#endif /* TESTING */
else if (GameExiting)
{
return (FALSE);
}
else if (!(CurrentMenuState.up || CurrentMenuState.down ||
CurrentMenuState.left || CurrentMenuState.right ||
CurrentMenuState.select))
@@ -250,6 +251,7 @@ LastActivity = WON_LAST_BATTLE;
UnbatchGraphics ();
FlushInput ();
GameExiting = FALSE;
DoInput ((PVOID)&MenuState, TRUE);
SetSemaphore (GraphicsSem);
@@ -257,22 +259,13 @@ LastActivity = WON_LAST_BATTLE;
ClearSemaphore (GraphicsSem);
DestroyDrawable (ReleaseDrawable (s.frame));
if (GameExiting)
{
TFB_Abort ();
}
if (GLOBAL (CurrentActivity) == (ACTIVITY)~0)
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);
}