From 7bbc40800cf8b59dd71141b219c226bf1fe587db Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Tue, 4 Jul 2023 17:40:11 +0700 Subject: [PATCH] don't save `-nouncapped`/`-uncapped` to config, disable menu item (#1128) * don't save `-nouncapped`/`-uncapped` to config, disable menu item * remove -hires/-nohires, run docgen -a --- src/i_video.c | 21 ++------------------- src/i_video.h | 2 +- src/m_menu.c | 16 +++++++--------- src/m_misc.c | 2 +- src/params.h | 8 +++----- 5 files changed, 14 insertions(+), 35 deletions(-) diff --git a/src/i_video.c b/src/i_video.c index f4b573d9..93a778b5 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -48,7 +48,7 @@ int WIDESCREENDELTA; // [crispy] horizontal widescreen offset boolean use_vsync; // killough 2/8/98: controls whether vsync is called boolean hires, default_hires; // killough 11/98 boolean use_aspect; -boolean uncapped; // [FG] uncapped rendering frame rate +boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate int fpslimit; // when uncapped, limit framerate to this value boolean fullscreen; boolean exclusive_fullscreen; @@ -1177,24 +1177,7 @@ static void I_InitVideoParms(void) I_ResetInvalidDisplayIndex(); hires = default_hires; - - //! - // @category video - // - // Enables 640x400 resolution for internal video buffer. - // - - if (M_CheckParm("-hires")) - hires = true; - - //! - // @category video - // - // Enables original 320x200 resolution for internal video buffer. - // - - else if (M_CheckParm("-nohires")) - hires = false; + uncapped = default_uncapped; //! // @category video diff --git a/src/i_video.h b/src/i_video.h index 821d01c7..6c3e1b7e 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -66,7 +66,7 @@ extern boolean disk_icon; // killough 10/98 extern boolean hires, default_hires; // killough 11/98 extern boolean use_aspect; -extern boolean uncapped; // [FG] uncapped rendering frame rate +extern boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate extern boolean fullscreen; extern boolean exclusive_fullscreen; diff --git a/src/m_menu.c b/src/m_menu.c index 7d8f37cf..4aebc0f5 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3932,14 +3932,7 @@ static void M_SetMidiPlayer(void) static void M_EnableDisableFPSLimit(void) { - if (!uncapped) - { - gen_settings1[gen1_fpslimit].m_flags |= S_DISABLE; - } - else - { - gen_settings1[gen1_fpslimit].m_flags &= ~S_DISABLE; - } + DISABLE_ITEM(!uncapped, gen_settings1[gen1_fpslimit]); } static void M_ToggleFullScreen(void) @@ -7225,6 +7218,11 @@ void M_ResetSetupMenu(void) gen_settings3[gen3_pistolstart].m_flags |= S_DISABLE; } + if (M_ParmExists("-uncapped") || M_ParmExists("-nouncapped")) + { + gen_settings1[gen1_uncapped].m_flags |= S_DISABLE; + } + if (deh_set_blood_color) { enem_settings1[enem1_colored_blood].m_flags |= S_DISABLE; @@ -7238,7 +7236,6 @@ void M_ResetSetupMenu(void) DISABLE_ITEM(!comp[comp_vile], enem_settings1[enem1_ghost]); M_CoerceFPSLimit(); - M_EnableDisableFPSLimit(); M_UpdateCrosshairItems(); M_UpdateCenteredWeaponItem(); M_UpdateMultiLineMsgItem(); @@ -7248,6 +7245,7 @@ void M_ResetSetupMenu(void) void M_ResetSetupMenuVideo(void) { DISABLE_ITEM(!hires, enem_settings1[enem1_fuzz]); + M_EnableDisableFPSLimit(); } // diff --git a/src/m_misc.c b/src/m_misc.c index b06a2eed..f0abbc52 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -172,7 +172,7 @@ default_t defaults[] = { // [FG] uncapped rendering frame rate { "uncapped", - (config_t *) &uncapped, NULL, + (config_t *) &default_uncapped, (config_t *) &uncapped, {1}, {0, 1}, number, ss_gen, wad_no, "1 to enable uncapped rendering frame rate" }, diff --git a/src/params.h b/src/params.h index bf3d4d2a..daa0ce35 100644 --- a/src/params.h +++ b/src/params.h @@ -17,16 +17,17 @@ static const char *params[] = { "-2", "-3", "-fullscreen", -"-hires", "-noblit", "-nodraw", "-nograbmouse", -"-nohires", +"-nouncapped", +"-uncapped", "-window", "-altdeath", "-autojoin", "-avg", "-deathmatch", +"-dedicated", "-dm3", "-left", "-oldsync", @@ -47,9 +48,6 @@ static const char *params[] = { "-strict", "-cdrom", "-nogui", -"-dedicated", -"-uncapped", -"-nouncapped", }; static const char *params_with_args[] = {