From bdf2e87cb8d4ed17a1b1c28197ac373d424d7b7a Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 13 Oct 2023 01:33:09 -0700 Subject: [PATCH] renderhitbox: fix raster errors at screen edge --- src/r_bbox.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/r_bbox.c b/src/r_bbox.c index 2350d702e..3654565a8 100644 --- a/src/r_bbox.c +++ b/src/r_bbox.c @@ -56,11 +56,11 @@ raster_bbox_seg { y /= FRACUNIT; + h = y + (FixedCeil(abs(h)) / FRACUNIT); + if (y < 0) y = 0; - h = y + (FixedCeil(abs(h)) / FRACUNIT); - if (h >= viewheight) h = viewheight; @@ -124,9 +124,6 @@ draw_bbox_row x1 = a->x; x2 = b->x; - if (x2 >= viewwidth) - x2 = viewwidth - 1; - if (x1 == x2 || x1 >= viewwidth || x2 < 0) return; @@ -154,6 +151,9 @@ draw_bbox_row x1 = 0; } + if (x2 >= viewwidth) + x2 = viewwidth - 1; + while (x1 < x2) { raster_bbox_seg(x1, y1, s1, bb->color);