From 28c30a9294e8aeadf0ecc685991ced1513ac7227 Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Mon, 8 Jan 2024 22:08:50 -0300 Subject: [PATCH] Optimize for when wall_scalex == 1.0 --- src/r_segs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 16d6a1856..6ca7bce28 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -737,8 +737,16 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) thicksidecol = ffloortexturecolumn; - for (INT32 x = x1; x <= x2; x++) - thicksidecol[x] = FixedDiv(ds->thicksidecol[x], wall_scalex) + ds->offsetx; + if (wall_scalex == FRACUNIT) + { + for (INT32 x = x1; x <= x2; x++) + thicksidecol[x] = ds->thicksidecol[x] + ds->offsetx; + } + else + { + for (INT32 x = x1; x <= x2; x++) + thicksidecol[x] = FixedDiv(ds->thicksidecol[x], wall_scalex) + ds->offsetx; + } mfloorclip = ds->sprbottomclip; mceilingclip = ds->sprtopclip;