From 948c9399deca0a9a67d7efb37ea0e19bb9a651cc Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 27 Jun 2026 14:08:38 +0200 Subject: [PATCH] fix HWR_SplitWall again.. theres guards just above this which should just skip shit but for some reason the clamps still do stuff, idk man fixes the weird grass fof in green hill --- src/hardware/hw_main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 485013345..c47fa7d68 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -1071,11 +1071,11 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, else solid = false; - height = FixedToFloat(P_GetLightZAt(&list[i], v1x, v1y)); - endheight = FixedToFloat(P_GetLightZAt(&list[i], v2x, v2y)); - if (solid) { + height = FixedToFloat(P_GetLightZAt(&list[i], v1x, v1y)); + endheight = FixedToFloat(P_GetLightZAt(&list[i], v2x, v2y)); + bheight = FixedToFloat(P_GetFFloorBottomZAt(list[i].caster, v1x, v1y)); endbheight = FixedToFloat(P_GetFFloorBottomZAt(list[i].caster, v2x, v2y)); @@ -1105,8 +1105,8 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, // Found a break // The heights are clamped to ensure the polygon doesn't cross itself. - bot = std::max(bheight, realbot); - endbot = std::max(endbheight, endrealbot); + bot = std::clamp(bheight, realbot, top); + endbot = std::clamp(endbheight, endrealbot, endtop); Surf->PolyColor.s.alpha = alpha; @@ -3671,8 +3671,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite) // Found a break // The heights are clamped to ensure the polygon doesn't cross itself. - bot = std::max(bheight, realbot); - endbot = std::max(endbheight, endrealbot); + bot = std::clamp(bheight, realbot, top); + endbot = std::clamp(endbheight, endrealbot, endtop); wallVerts[3].t = towtop + ((realtop - top) * towmult); wallVerts[2].t = towtop + ((endrealtop - endtop) * towmult);