From 9c014eb2eaadfc09f09251f6361b570d93c0cc4b Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 14 Oct 2025 22:43:58 +0200 Subject: [PATCH] delet gl_viewwidth, gl_viewheight, gl_baseviewwindowx, gl_baseviewwindowy gl_basewindowcenterx, gl_basewindowcentery they were effectively unused the last two werent ever even initialized to anything, using HWR_DrawViewBorder wouldve crashed --- src/hardware/hw_draw.c | 12 ++++++---- src/hardware/hw_main.cpp | 48 +++++++--------------------------------- src/hardware/hw_main.h | 4 ---- 3 files changed, 16 insertions(+), 48 deletions(-) diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index 2b8ace584..1c014ce4c 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -649,6 +649,7 @@ void HWR_DrawConsoleBack(UINT32 color, INT32 height) // ------------------ void HWR_DrawViewBorder(INT32 clearlines) { +#if 0 INT32 x, y; INT32 top, side; INT32 baseviewwidth, baseviewheight; @@ -659,10 +660,10 @@ void HWR_DrawViewBorder(INT32 clearlines) clearlines = BASEVIDHEIGHT; // refresh all // calc view size based on original game resolution - baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdup)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7; - baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdup)); - top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdup)); - side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowx), vid.fdup)); + baseviewwidth = FixedInt(FixedDiv(viewwidth * FRACUNIT, vid.fdup)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7; + baseviewheight = FixedInt(FixedDiv(viewheight * FRACUNIT, vid.fdup)); + top = FixedInt(FixedDiv(baseviewwindowy * FRACUNIT, vid.fdup)); + side = FixedInt(FixedDiv(baseviewwindowx * FRACUNIT, vid.fdup)); // top HWR_DrawFlatFill(0, 0, @@ -759,6 +760,9 @@ void HWR_DrawViewBorder(INT32 clearlines) PU_PATCH), basewindowx + baseviewwidth, basewindowy + baseviewheight, 0); +#else + (void)clearlines; +#endif } diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index c88b075a1..2b0799807 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -77,11 +77,6 @@ boolean gl_drawing_stencil = false; static INT32 current_bsp_culling_distance = 0; -// base values set at SetViewSize -float gl_baseviewwindowy, gl_baseviewwindowx; -static float gl_viewwindowy, gl_viewwindowx; // top left corner of view window -float gl_viewwidth, gl_viewheight; // viewport clipping boundaries (screen coords) - FTransform atransform; // Float variants of viewx, viewy, viewz, etc. @@ -5316,10 +5311,10 @@ static void HWR_DrawSkyBackground(void) // -----------------+ static inline void HWR_ClearView(void) { - GL_GClipRect((INT32)gl_viewwindowx, - (INT32)gl_viewwindowy, - (INT32)(gl_viewwindowx + gl_viewwidth), - (INT32)(gl_viewwindowy + gl_viewheight), + GL_GClipRect(viewwindowx, + viewwindowy, + (viewwindowx + viewwidth), + (viewwindowy + viewheight), ZCLIP_PLANE, FAR_ZCLIP_DEFAULT); GL_ClearBuffer(false, true, true, NULL); } @@ -5329,19 +5324,6 @@ static inline void HWR_ClearView(void) // -----------------+ void HWR_SetViewSize(void) { - // setup view size - gl_viewwidth = (float)vid.width; - gl_viewheight = (float)vid.height; - - if (splitscreen) - gl_viewheight /= 2; - - if (splitscreen > 1) - gl_viewwidth /= 2; - - gl_baseviewwindowy = 0; - gl_baseviewwindowx = 0; - GL_FlushScreenTextures(); } @@ -5594,20 +5576,6 @@ extern "C" { // ========================================================================== static void HWR_RenderFrame(player_t *player, boolean skybox) { - // set window position - gl_viewwindowx = gl_baseviewwindowx; - gl_viewwindowy = gl_baseviewwindowy; - - if ((splitscreen == 1 && viewssnum == 1) || (splitscreen > 1 && viewssnum > 1)) - { - gl_viewwindowy += gl_viewheight; - } - - if (splitscreen > 1 && viewssnum & 1) - { - gl_viewwindowx += gl_viewwidth; - } - // check for new console commands. NetUpdate(); @@ -5623,10 +5591,10 @@ static void HWR_RenderFrame(player_t *player, boolean skybox) if (!skybox && cv_glrenderdistance.value) { - GL_GClipRect((INT32)gl_viewwindowx, - (INT32)gl_viewwindowy, - (INT32)(gl_viewwindowx + gl_viewwidth), - (INT32)(gl_viewwindowy + gl_viewheight), + GL_GClipRect(viewwindowx, + viewwindowy, + (viewwindowx + viewwidth), + (viewwindowy + viewheight), ZCLIP_PLANE, clipping_distances[cv_glrenderdistance.value - 1]); current_bsp_culling_distance = bsp_culling_distances[cv_glrenderdistance.value - 1]; } diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 4060b6540..43a292c57 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -42,10 +42,6 @@ extern "C" { void HWR_Startup(void); void HWR_Shutdown(void); -extern float gl_viewwidth, gl_viewheight, gl_baseviewwindowx, gl_baseviewwindowy; - -extern float gl_basewindowcenterx, gl_basewindowcentery; - extern unsigned msaa; extern boolean a2c;