mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
fast exit with Alt-F4 or pressing the close button (#2017)
* disable ENDOOM
This commit is contained in:
parent
58dcc9da3c
commit
01b4cbbeea
@ -40,11 +40,7 @@ typedef enum evtype_e
|
||||
ev_joyb_up,
|
||||
ev_joystick,
|
||||
ev_joystick_state,
|
||||
ev_gyro,
|
||||
|
||||
// Quit event. Triggered when the user clicks the "close" button
|
||||
// to terminate the application.
|
||||
ev_quit,
|
||||
ev_gyro
|
||||
} evtype_t;
|
||||
|
||||
typedef union evdata_u
|
||||
|
@ -1701,9 +1701,11 @@ static void D_ShowEndDoom(void)
|
||||
I_Endoom(endoom);
|
||||
}
|
||||
|
||||
boolean disable_endoom = false;
|
||||
|
||||
static boolean AllowEndDoom(void)
|
||||
{
|
||||
return (exit_sequence == EXIT_SEQUENCE_FULL
|
||||
return !disable_endoom && (exit_sequence == EXIT_SEQUENCE_FULL
|
||||
|| (exit_sequence == EXIT_SEQUENCE_PWAD_ENDOOM
|
||||
&& !W_IsIWADLump(W_CheckNumForName("ENDOOM"))));
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ extern boolean clfastparm; // checkparm of -fast
|
||||
void D_SetMaxHealth(void);
|
||||
void D_SetBloodColor(void);
|
||||
|
||||
extern boolean disable_endoom;
|
||||
boolean D_AllowQuitSound(void);
|
||||
|
||||
// Called by IO functions when input is detected.
|
||||
|
@ -509,11 +509,8 @@ static void ProcessEvent(SDL_Event *ev)
|
||||
break;
|
||||
|
||||
case SDL_QUIT:
|
||||
{
|
||||
static event_t event;
|
||||
event.type = ev_quit;
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
disable_endoom = true;
|
||||
I_SafeExit(0);
|
||||
break;
|
||||
|
||||
case SDL_WINDOWEVENT:
|
||||
|
@ -2892,22 +2892,6 @@ boolean M_Responder(event_t *ev)
|
||||
|
||||
switch (ev->type)
|
||||
{
|
||||
// "close" button pressed on window?
|
||||
case ev_quit:
|
||||
// First click on close button = bring up quit confirm message.
|
||||
// Second click on close button = confirm quit
|
||||
if (menuactive && messageToPrint
|
||||
&& messageRoutine == M_QuitResponse)
|
||||
{
|
||||
M_QuitResponse('y');
|
||||
}
|
||||
else
|
||||
{
|
||||
M_StartSound(sfx_swtchn);
|
||||
M_QuitDOOM(0);
|
||||
}
|
||||
return true;
|
||||
|
||||
case ev_joystick_state:
|
||||
if (menu_input == pad_mode && repeat != MENU_NULL
|
||||
&& joywait < I_GetTime())
|
||||
|
Loading…
x
Reference in New Issue
Block a user