From c4d39eae25948002aca01bc3c0f37a5687a00a81 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 c22707472..5a14f88a5 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3531,14 +3531,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])) @@ -3554,7 +3556,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 c7454ba36..2e0fd6f4a 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -1237,7 +1237,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++;