From 837746c0a99bf540b18ef36de0b527675456cd21 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 25 May 2024 00:01:58 +0200 Subject: [PATCH] =?UTF-8?q?declare=20outside=20of=20l=C3=B6=C3=B6p=20also?= =?UTF-8?q?=20add=20const=20in=20r=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hardware/hw_main.c | 9 ++++++--- src/r_bsp.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index aedf40f34..afddd9365 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3530,14 +3530,16 @@ static boolean HWR_PortalCheckBBox(const fixed_t *bspcoord) static void HWR_RenderBSPNode(INT32 bspnum) { + const node_t *bsp; + INT32 side; ps_numbspcalls.value.i++; while (!(bspnum & NF_SUBSECTOR)) // Found a subsector? { - const node_t *bsp = &nodes[bspnum]; + bsp = &nodes[bspnum]; // Decide which side the view point is on. - INT32 side = R_PointOnSide(viewx, viewy, bsp); + side = R_PointOnSide(viewx, viewy, bsp); // Recursively divide front space. if (HWR_PortalCheckBBox(bsp->bbox[side])) @@ -3553,7 +3555,8 @@ static void HWR_RenderBSPNode(INT32 bspnum) // PORTAL CULLING if (portalclipline && portalcullsector) { - if (portalcullsector != subsectors[bspnum & ~NF_SUBSECTOR].sector) + sector_t *sect = subsectors[bspnum & ~NF_SUBSECTOR].sector; + if (sect != portalcullsector) return; portalcullsector = NULL; } diff --git a/src/r_bsp.c b/src/r_bsp.c index 83f530f2a..81569186d 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -1311,7 +1311,7 @@ INT32 R_GetPlaneLight(sector_t *sector, fixed_t planeheight, boolean underside) void R_RenderBSPNode(INT32 bspnum) { - node_t *bsp; + const node_t *bsp; INT32 side; ps_numbspcalls.value.i++;