From 485ae2eb02363a5de75fe88af5ddecaf3784501e Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 1 Oct 2025 14:20:21 +0200 Subject: [PATCH] add toggle for frameskip just in case someone wants to toggle that off for some reason --- src/d_main.c | 11 +++++++++-- src/d_netcmd.c | 1 + src/m_menudefs.c | 18 +++++++++++------- src/screen.c | 3 +++ src/screen.h | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index ec7efd5b5..32e3bd3cf 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -991,9 +991,16 @@ void D_SRB2Loop(void) // // Wipes run an inner loop and artificially increase // the measured time. - if (!ranwipe && (frameskip < 3) && (deltatics > 1.0)) + if (cv_frameskip.value) { - frameskip++; + if (!ranwipe && (frameskip < 3) && (deltatics > 1.0)) + { + frameskip++; + } + else + { + frameskip = 0; + } } else { diff --git a/src/d_netcmd.c b/src/d_netcmd.c index b003b7a96..a452c2a2f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1020,6 +1020,7 @@ void D_RegisterClientCommands(void) // screen.c CV_RegisterVar(&cv_fullscreen); CV_RegisterVar(&cv_renderview); + CV_RegisterVar(&cv_frameskip); CV_RegisterVar(&cv_vhseffect); CV_RegisterVar(&cv_shittyscreen); CV_RegisterVar(&cv_scr_width); diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 34e81193f..74ee714dd 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -928,17 +928,19 @@ static menuitem_t OP_ExpOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "FPS counter sampling", &cv_accuratefps, 50}, - {IT_STRING | IT_CVAR, NULL, "Votescreen Scaling", &cv_votebgscaling, 60}, + {IT_STRING | IT_CVAR, NULL, "Frameskip", &cv_frameskip, 60}, + + {IT_STRING | IT_CVAR, NULL, "Votescreen Scaling", &cv_votebgscaling, 70}, #ifdef HWRENDER - {IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_glscreentextures, 70}, + {IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_glscreentextures, 80}, #ifdef USE_FBO_OGL - {IT_STRING | IT_CVAR, NULL, "FBO Downsampling support", &cv_glframebuffer, 75}, - {IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 85}, - {IT_DISABLED, NULL, "", NULL, 95}, // dummy text + {IT_STRING | IT_CVAR, NULL, "FBO Downsampling support", &cv_glframebuffer, 85}, + {IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 95}, + {IT_DISABLED, NULL, "", NULL, 105}, // dummy text #else - {IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 80}, - {IT_DISABLED, NULL, "", NULL, 90}, // dummy text + {IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 90}, + {IT_DISABLED, NULL, "", NULL, 100}, // dummy text #endif #endif }; @@ -952,6 +954,7 @@ static const char* OP_ExpTooltips[] = //"Should the directional lightning be randomized each map?\nTakes effect on next map load.", "Toggle being able to see the sky.", "Change the FPS counter sampling method\nInaccurate updates slower and might miss frame drops and such\nAccurate updates faster and is more accurate, but might be less readable", // how to ingles?? + "Skips rendering frames if game logic takes too long preventing issues during performance drops." // idk im shit as describing things "Different methods of scaling the votescreen backgrounds.", #ifdef HWRENDER "Should the game do Screen Textures? Provides a good boost to frames\nat the cost of some visual effects not working when disabled.", @@ -971,6 +974,7 @@ enum //op_exp_dirlight, op_exp_skybox, op_exp_accuratefps, + op_exp_frameskip, op_exp_votescrn, #ifdef HWRENDER op_exp_glscrtx, diff --git a/src/screen.c b/src/screen.c index a79b5b232..0a47e7ae7 100644 --- a/src/screen.c +++ b/src/screen.c @@ -45,6 +45,9 @@ static CV_PossibleValue_t shittyscreen_cons_t[] = {{0, "Okay"}, {1, "Shitty"}, { consvar_t cv_scr_width = {"scr_width", "1280", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_scr_height = {"scr_height", "800", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + +consvar_t cv_frameskip = {"frameskip", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + consvar_t cv_vhseffect = {"vhspause", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_shittyscreen = {"televisionsignal", "Okay", CV_NOSHOWHELP, shittyscreen_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/screen.h b/src/screen.h index df5baee18..ecad24a64 100644 --- a/src/screen.h +++ b/src/screen.h @@ -86,7 +86,7 @@ extern INT32 setmodeneeded; // mode number to set if needed, or 0 extern UINT8 *scr_borderpatch; // patch used to fill the view borders -extern consvar_t cv_scr_width, cv_scr_height, cv_renderview, cv_fullscreen, cv_vhseffect, cv_shittyscreen; +extern consvar_t cv_scr_width, cv_scr_height, cv_renderview, cv_frameskip, cv_fullscreen, cv_vhseffect, cv_shittyscreen; extern consvar_t cv_parallelsoftware; extern consvar_t cv_paralleldrawmasked;