From 6ebf6a27977ef5be94c26bc44b542c669269e4ca 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 bdb756bdb..95cfad250 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -549,11 +549,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; @@ -622,7 +624,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);