Merge branch 'fix-bbox-col-raster' into 'master'

Fix renderhitbox in Software renderer

See merge request KartKrew/Kart!1548
This commit is contained in:
Oni 2023-10-15 15:10:55 +00:00
commit 1e6ab6107e

View file

@ -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;
@ -92,11 +92,10 @@ draw_bbox_col
col->y = (centeryfrac - FixedMul(bb->tz, yscale));
col->h = FixedMul(bb->height, yscale);
// Using this function is TOO EASY!
V_DrawFill(
viewwindowx + col->x,
viewwindowy + col->y / FRACUNIT, 1,
col->h / FRACUNIT, V_NOSCALESTART | bb->color);
if (col->x >= 0 && col->x < viewwidth)
{
raster_bbox_seg(col->x, col->y, col->h, bb->color);
}
}
static void
@ -125,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;
@ -155,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);