- Remove last main usage of binangle outside of the game's input code.

This commit is contained in:
Mitchell Richters 2022-08-27 20:40:51 +10:00 committed by Christoph Oelckers
parent 4f56138027
commit 728edc182d

View file

@ -39,7 +39,7 @@ int cameradist, cameraclock;
bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** psect, DAngle ang, fixedhoriz horiz, double const smoothratio)
{
HitInfoBase hitinfo;
binangle daang;
DAngle daang;
int newdist;
if (!*psect) return false;
@ -67,9 +67,9 @@ bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** ps
{
// Push you a little bit off the wall
*psect = hitinfo.hitSector;
daang = bvectangbam(hitinfo.hitWall->point2Wall()->pos.X - hitinfo.hitWall->pos.X,
daang = VecToAngle(hitinfo.hitWall->point2Wall()->pos.X - hitinfo.hitWall->pos.X,
hitinfo.hitWall->point2Wall()->pos.Y - hitinfo.hitWall->pos.Y);
newdist = np.X * daang.bsin() + np.Y * -daang.bcos();
newdist = int(np.X * daang.Sin() * (1 << BUILDSINBITS) + np.Y * -daang.Cos() * (1 << BUILDSINBITS));
if (abs(np.X) > abs(np.Y))
hx -= MulScale(np.X, newdist, 28);
@ -102,8 +102,8 @@ bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** ps
else
{
// same as wall calculation.
daang = buildang(act->int_ang() - 512);
newdist = np.X * daang.bsin() + np.Y * -daang.bcos();
daang = DAngle::fromBuild(act->int_ang() - 512);
newdist = int(np.X * daang.Sin() * (1 << BUILDSINBITS) + np.Y * -daang.Cos() * (1 << BUILDSINBITS));
if (abs(np.X) > abs(np.Y))
hx -= MulScale(np.X, newdist, 28);