From fc27ed04430999ad67e2227c9ef67cf62e2b07ef Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 2 Apr 2024 22:14:10 +0200 Subject: [PATCH] Add option for wipes only in screentex toggle since the toggle was changed to actually disable ALL screentex functions --- src/hardware/hw_main.c | 3 ++- src/hardware/r_opengl/r_opengl.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 2f0d72cd7..ff7f2a207 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -136,7 +136,8 @@ static INT32 current_bsp_culling_distance = 0; // - water and heat wave effects // - intermission background // - full screen scaling (use native resolution or windowed mode to avoid this) -consvar_t cv_grscreentextures = {"gr_screentextures", "On", CV_CALL|CV_SAVE, CV_OnOff, +static CV_PossibleValue_t grscreentextures_cons_t[] = {{0, "Off"}, {1, "Wipes Only"}, {2, "All"}, {0, NULL}}; +consvar_t cv_grscreentextures = {"gr_screentextures", "All", CV_CALL|CV_SAVE, grscreentextures_cons_t, CV_screentextures_ONChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t grshaders_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Ignore custom shaders"}, {0, NULL}}; diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 991f254dc..7e6c41297 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -612,7 +612,7 @@ static PFNglGetUniformLocation pglGetUniformLocation; static boolean gl_shadersenabled = false; static INT32 gl_allowshaders = 0; -static INT32 gl_enable_screen_textures = 1; +static INT32 gl_enable_screen_textures = 2; static GLint gl_portal_stencil_level = 0; @@ -2838,7 +2838,8 @@ EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]) 16.0f, -16.0f, 6.0f }; - if (!gl_enable_screen_textures) return; + if (gl_enable_screen_textures != 2) + return; // look for power of two that is large enough for the screen while (texsize < screen_width || texsize < screen_height) @@ -2933,7 +2934,8 @@ EXPORT void HWRAPI(DrawScreenTexture)(int tex, FSurfaceInfo *surf, FBITFIELD pol float fix[8]; - if (!gl_enable_screen_textures) return; + if (gl_enable_screen_textures != 2) + return; // look for power of two that is large enough for the screen while (texsize < screen_width || texsize < screen_height) @@ -2996,7 +2998,8 @@ EXPORT void HWRAPI(DoScreenWipe)(int wipeStart, int wipeEnd) 1.0f, 1.0f }; - if (!gl_enable_screen_textures) return; + if (!gl_enable_screen_textures) + return; // look for power of two that is large enough for the screen while (texsize < screen_width || texsize < screen_height) @@ -3077,7 +3080,8 @@ EXPORT void HWRAPI(RenderVhsEffect) (fixed_t upbary, fixed_t downbary, UINT8 upd 1.0f, -1.0f, 1.0f }; - if (!gl_enable_screen_textures) return; + if (gl_enable_screen_textures != 2) + return; // look for power of two that is large enough for the screen while (texsize < screen_width || texsize < screen_height) @@ -3170,7 +3174,8 @@ EXPORT void HWRAPI(MakeScreenTexture) (int tex) INT32 texsize = 512; boolean firstTime = (screenTextures[tex] == 0); - if (!gl_enable_screen_textures) return; + if (!gl_enable_screen_textures || (gl_enable_screen_textures == 1 && tex != (HWD_SCREENTEXTURE_WIPE_START || HWD_SCREENTEXTURE_WIPE_END))) + return; // look for power of two that is large enough for the screen while (texsize < screen_width || texsize < screen_height) @@ -3206,7 +3211,8 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int tex, INT32 width, INT32 height) float off[12]; float fix[8]; - if (!gl_enable_screen_textures) return; + if (gl_enable_screen_textures != 2) + return; // look for power of two that is large enough for the screen while (texsize < screen_width || texsize < screen_height)