From 90d3241f50233eeed79a6ee295203a98bc02b53d Mon Sep 17 00:00:00 2001 From: "Guilherme M. Miranda" Date: Wed, 18 Dec 2024 10:23:56 -0300 Subject: [PATCH 1/2] add PWAD ENDOOM option setting --- src/d_main.c | 21 ++++++++++++++------- src/mn_setup.c | 4 +++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 9600eaf3d..7d0c54010 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -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) @@ -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(); } @@ -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)"); diff --git a/src/mn_setup.c b/src/mn_setup.c index befda5a1e..1eb8d7b65 100644 --- a/src/mn_setup.c +++ b/src/mn_setup.c @@ -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[] = { @@ -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 }; From 38be5b084116093df40c12f16a09ff382181282d Mon Sep 17 00:00:00 2001 From: "Guilherme M. Miranda" Date: Wed, 18 Dec 2024 13:43:32 -0300 Subject: [PATCH 2/2] cleaned redundant parentheses --- src/d_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 7d0c54010..6b473b375 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1646,7 +1646,7 @@ static boolean endoom_pwad_only; boolean D_AllowQuitSound(void) { return (exit_sequence == EXIT_SEQUENCE_FULL - || (exit_sequence == EXIT_SEQUENCE_SOUND_ONLY)); + || exit_sequence == EXIT_SEQUENCE_SOUND_ONLY); } static void D_ShowEndDoom(void) @@ -1663,7 +1663,7 @@ static boolean AllowEndDoom(void) { return (!disable_endoom && (exit_sequence == EXIT_SEQUENCE_FULL - || (exit_sequence == EXIT_SEQUENCE_ENDOOM_ONLY))); + || exit_sequence == EXIT_SEQUENCE_ENDOOM_ONLY)); } static boolean AllowEndDoomPWADOnly() {