Remedy some quirky rendering of hitboxes if your viewpoint is too close

It's not correct but it's better than before.
This commit is contained in:
James R 2022-09-11 07:08:10 -07:00
parent 99653de134
commit 7527fdbb56

View file

@ -82,8 +82,13 @@ draw_bbox_col
{
struct bbox_col *col = &bb->col[p];
fixed_t xscale = FixedDiv(projection, ty);
fixed_t yscale = FixedDiv(projectiony, ty);
fixed_t xscale, yscale;
if (ty < FRACUNIT) // projection breaks down here
ty = FRACUNIT;
xscale = FixedDiv(projection, ty);
yscale = FixedDiv(projectiony, ty);
col->x = (centerxfrac + FixedMul(tx, xscale)) / FRACUNIT;
col->y = (centeryfrac - FixedMul(bb->tz, yscale));