mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-26 07:21:48 +00:00
R_ProjectSprite: fix overflow in sideways perspective clipping
Multiplications of perspective values can easily overflow and flip sign bit at far distances. Instead, divide the left operand.
This commit is contained in:
parent
80584c9d2f
commit
54b3aff09f
1 changed files with 1 additions and 1 deletions
|
|
@ -1989,7 +1989,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
tz2 = FixedMul(MINZ, this_scale);
|
||||
}
|
||||
|
||||
if (tx2 < -(FixedMul(tz2, fovtan[viewssnum])<<2) || tx > FixedMul(tz, fovtan[viewssnum])<<2) // too far off the side?
|
||||
if ((tx2 / 4) < -(FixedMul(tz2, fovtan[viewssnum])) || (tx / 4) > FixedMul(tz, fovtan[viewssnum])) // too far off the side?
|
||||
return;
|
||||
|
||||
yscale = FixedDiv(projectiony[viewssnum], tz);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue