From b706c55ed82acb01253ddcf32fdd507e557f2ea7 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 6 Apr 2025 10:29:28 +0200 Subject: [PATCH] cache this somehow this was unusually expensive lol --- src/hardware/hw_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 2e8b0315e..4dd91cc8a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -544,11 +544,13 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool static FOutVector *planeVerts = NULL; static UINT16 numAllocedPlaneVerts = 0; + poly_t *planepoly = xsub->planepoly; + // no convex poly were generated for this subsector - if (!xsub->planepoly) + if (!planepoly) return; - nrPlaneVerts = xsub->planepoly->numpts; + nrPlaneVerts = planepoly->numpts; if (nrPlaneVerts < 3) //not even a triangle ? return; @@ -617,7 +619,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool break; } - pv = xsub->planepoly->pts; + pv = planepoly->pts; // reference point for flat texture coord for each vertex around the polygon flatxref = (float)(((fixed_t)pv->x & (~flatflag)) / fflatsize);