Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expand exit sequence support to include PWAD endoom + no sound #2095

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1636,15 +1636,17 @@ void D_SetBloodColor(void)
typedef enum {
EXIT_SEQUENCE_OFF, // Skip sound, skip ENDOOM.
EXIT_SEQUENCE_SOUND_ONLY, // Play sound, skip ENDOOM.
EXIT_SEQUENCE_PWAD_ENDOOM, // Play sound, show ENDOOM for PWADs only.
EXIT_SEQUENCE_ENDOOM_ONLY, // Skip sound, show ENDOOM.
EXIT_SEQUENCE_FULL // Play sound, show ENDOOM.
} exit_sequence_t;

static exit_sequence_t exit_sequence;
static boolean endoom_pwad_only;

boolean D_AllowQuitSound(void)
{
return (exit_sequence != EXIT_SEQUENCE_OFF);
return (exit_sequence == EXIT_SEQUENCE_FULL
|| exit_sequence == EXIT_SEQUENCE_SOUND_ONLY);
}

static void D_ShowEndDoom(void)
Expand All @@ -1659,14 +1661,18 @@ boolean disable_endoom = false;

static boolean AllowEndDoom(void)
{
return !disable_endoom && (exit_sequence == EXIT_SEQUENCE_FULL
|| (exit_sequence == EXIT_SEQUENCE_PWAD_ENDOOM
&& !W_IsIWADLump(W_CheckNumForName("ENDOOM"))));
return (!disable_endoom
&& (exit_sequence == EXIT_SEQUENCE_FULL
|| exit_sequence == EXIT_SEQUENCE_ENDOOM_ONLY));
}

static boolean AllowEndDoomPWADOnly() {
return (!W_IsIWADLump(W_CheckNumForName("ENDOOM")) && endoom_pwad_only);
}

static void D_EndDoom(void)
{
if (AllowEndDoom())
if (AllowEndDoom() && AllowEndDoomPWADOnly())
{
D_ShowEndDoom();
}
Expand Down Expand Up @@ -2694,7 +2700,8 @@ void D_DoomMain(void)
void D_BindMiscVariables(void)
{
BIND_NUM_GENERAL(exit_sequence, 0, 0, EXIT_SEQUENCE_FULL,
"Exit sequence (0 = Off; 1 = Sound Only; 2 = PWAD ENDOOM; 3 = Full)");
"Exit sequence (0 = Off; 1 = Sound Only; 2 = ENDOOM Only; 3 = Full)");
BIND_BOOL_GENERAL(endoom_pwad_only, false, "Show only ENDOOM from PWAD");
BIND_BOOL_GENERAL(demobar, false, "Show demo progress bar");
BIND_NUM_GENERAL(screen_melt, wipe_Melt, wipe_None, wipe_Fizzle,
"Screen wipe effect (0 = None; 1 = Melt; 2 = Crossfade; 3 = Fizzlefade)");
Expand Down
4 changes: 3 additions & 1 deletion src/mn_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -3229,7 +3229,7 @@ static void SmoothLight(void)
}

static const char *exit_sequence_strings[] = {
"Off", "Sound Only", "PWAD ENDOOM", "Full"
"Off", "Sound Only", "ENDOOM Only", "Full"
};

static const char *fuzzmode_strings[] = {
Expand Down Expand Up @@ -3317,6 +3317,8 @@ static setup_menu_t gen_settings6[] = {
{"Exit Sequence", S_CHOICE, OFF_CNTR_X, M_SPC, {"exit_sequence"},
.strings_id = str_exit_sequence},

{"PWAD ENDOOM Only", S_ONOFF, OFF_CNTR_X, M_SPC, {"endoom_pwad_only"}},

MI_END
};

Expand Down