From 3e38faed2ebba6227fc76dc3c80d5fd67bb0c25d Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 16 Sep 2025 02:10:19 +0200 Subject: [PATCH] remove floatlenght from seg_t this will get converted to fixedpoint anyways and is only used in ONE function at all to determine texture x offsets in gl yes this does get readjusted in adjustsegs if our glsegs differ, but this should be so marginal so save us the work at mapload gotta test and see if i can ever see a difference --- src/hardware/hw_bsp.c | 17 ----------------- src/hardware/hw_main.cpp | 2 +- src/p_setup.c | 4 ---- src/r_defs.h | 1 - 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index 3d7a3dda5..6982e371b 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -936,23 +936,6 @@ static void AdjustSegs(void) pv->y = FIXED_TO_FLOAT(lseg->v2->y); lseg->pv2 = pv; } - - // recompute length - { - float x,y; - - const polyvertex_t *pv1 = (polyvertex_t *)lseg->pv1; - const polyvertex_t *pv2 = (polyvertex_t *)lseg->pv2; - - x = pv2->x - pv1->x + 0.5f; - y = pv2->y - pv1->y + 0.5f; - - lseg->flength = hypotf(x, y); - - // BP: debug see this kind of segs - //if (nearv2 > NEARDIST*NEARDIST || nearv1 > NEARDIST*NEARDIST) - // lseg->length = 1; - } } } } diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index fc4a55dc9..84bb7d527 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -1419,7 +1419,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom // x offset the texture const fixed_t texturehpeg = gl_sidedef->textureoffset + gl_curline->offset; const float cliplow = (float)texturehpeg; - const float cliphigh = (float)(texturehpeg + (gl_curline->flength*FRACUNIT)); + const float cliphigh = (float)(texturehpeg + gl_curline->length); FUINT lightnum = gl_frontsector->lightlevel; extracolormap_t *colormap = gl_frontsector->extra_colormap; diff --git a/src/p_setup.c b/src/p_setup.c index ccae26eea..f0e48fbdd 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -565,10 +565,6 @@ static void P_LoadSegs(UINT8 *data) li->v2 = &vertexes[SHORT(ml->v2)]; li->length = P_SegLength(li); -#ifdef HWRENDER - if (rendermode == render_opengl) - li->flength = P_SegLengthFloat(li); -#endif li->angle = (SHORT(ml->angle))<offset = (SHORT(ml->offset))<linedef); diff --git a/src/r_defs.h b/src/r_defs.h index abd3b6bd7..043c9ba4a 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -548,7 +548,6 @@ typedef struct seg_s // new pointers so that AdjustSegs doesn't mess with v1/v2 polyvertex_t *pv1; // polyvertex_t polyvertex_t *pv2; // polyvertex_t - float flength; // length of the seg, used by hardware renderer #endif polyobj_t *polyseg;