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
c3bae82317
commit
6019b8b96a
1 changed files with 1 additions and 1 deletions
|
|
@ -2037,7 +2037,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
tz2 = FixedMul(MINZ, this_scale);
|
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;
|
return;
|
||||||
|
|
||||||
yscale = FixedDiv(projectiony[viewssnum], tz);
|
yscale = FixedDiv(projectiony[viewssnum], tz);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue