change limits for tx based on fov, by multiplying by fovtan

this makes it so that higher fov values can actually let you see all the sprites that should be in the view
This commit is contained in:
Monster Iestyn 2020-05-19 18:54:39 +01:00
parent 35e5d673e0
commit 65d6b04fd2
1 changed files with 2 additions and 2 deletions

View File

@ -1407,7 +1407,7 @@ static void R_ProjectSprite(mobj_t *thing)
basetx = tx = FixedMul(tr_x, viewsin) - FixedMul(tr_y, viewcos); // sideways distance
// too far off the side?
if (!papersprite && abs(tx) > tz<<2) // papersprite clipping is handled later
if (!papersprite && abs(tx) > FixedMul(tz, fovtan)<<2) // papersprite clipping is handled later
return;
// aspect ratio stuff
@ -1600,7 +1600,7 @@ static void R_ProjectSprite(mobj_t *thing)
xscale2 = FixedDiv(projection, tz2);
}
if (tx2 < -(tz2<<2) || tx > tz<<2) // too far off the side?
if (tx2 < -(FixedMul(tz2, fovtan)<<2) || tx > FixedMul(tz, fovtan)<<2) // too far off the side?
return;
// TODO: tx clamping