- Fix all calls to interpolatedangle() that didn't revert smoothratio back to a float.

This commit is contained in:
Mitchell Richters 2022-09-06 22:22:51 +10:00 committed by Christoph Oelckers
parent f72d42bb8e
commit 7d5040f560
10 changed files with 23 additions and 23 deletions

View file

@ -198,7 +198,7 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b
tileX += interpolatedvaluef(prevTile->x, thisTile->x, smoothratio);
tileY += interpolatedvaluef(prevTile->y, thisTile->y, smoothratio);
tileZ = interpolatedvaluef(prevTile->z, thisTile->z, smoothratio);
tileA = interpolatedangle(DAngle::fromBuild(prevTile->angle), DAngle::fromBuild(thisTile->angle), smoothratio).Buildfang();
tileA = interpolatedangle(DAngle::fromBuild(prevTile->angle), DAngle::fromBuild(thisTile->angle), smoothratio * (1. / MaxSmoothRatio)).Buildfang();
tileShade = interpolatedvalue(prevTile->shade, thisTile->shade, smoothratio) + shade;
auto prevAlpha = ((stat | prevTile->stat) & RS_TRANS1) ? glblend[0].def[!!((stat | prevTile->stat) & RS_TRANS2)].alpha : 1.;
auto thisAlpha = (tileStat & RS_TRANS1) ? glblend[0].def[!!(tileStat & RS_TRANS2)].alpha : 1.;

View file

@ -473,7 +473,7 @@ static void DrawMap(DBloodActor* view)
}
VIEW* pView = &gPrevView[gViewIndex];
auto xy = DVector2(interpolatedvalue(pView->x, view->int_pos().X, gInterpolate), interpolatedvalue(pView->y, view->int_pos().Y, gInterpolate)) * inttoworld;
auto ang = !SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(gInterpolate);
auto ang = !SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(gInterpolate * (1. / MaxSmoothRatio));
DrawOverheadMap(xy, ang, gInterpolate);
if (tm)
setViewport(hud_size);
@ -511,9 +511,9 @@ void SetupView(int& cX, int& cY, int& cZ, DAngle& cA, fixedhoriz& cH, sectortype
}
else
{
cA = interpolatedangle(predictOld.angle + predictOld.look_ang, predict.angle + predict.look_ang, gInterpolate);
cA = interpolatedangle(predictOld.angle + predictOld.look_ang, predict.angle + predict.look_ang, gInterpolate * (1. / MaxSmoothRatio));
cH = interpolatedhorizon(predictOld.horiz + predictOld.horizoff, predict.horiz + predict.horizoff, gInterpolate);
rotscrnang = interpolatedangle(predictOld.rotscrnang, predict.rotscrnang, gInterpolate);
rotscrnang = interpolatedangle(predictOld.rotscrnang, predict.rotscrnang, gInterpolate * (1. / MaxSmoothRatio));
}
}
else
@ -537,9 +537,9 @@ void SetupView(int& cX, int& cY, int& cZ, DAngle& cA, fixedhoriz& cH, sectortype
}
else
{
cA = gView->angle.interpolatedsum(gInterpolate);
cA = gView->angle.interpolatedsum(gInterpolate * (1. / MaxSmoothRatio));
cH = gView->horizon.interpolatedsum(gInterpolate);
rotscrnang = gView->angle.interpolatedrotscrn(gInterpolate);
rotscrnang = gView->angle.interpolatedrotscrn(gInterpolate * (1. / MaxSmoothRatio));
}
}
@ -686,7 +686,7 @@ void viewDrawScreen(bool sceneonly)
double shakeX, shakeY;
SetupView(cX, cY, cZ, cA, cH, pSector, zDelta, shakeX, shakeY, rotscrnang);
DAngle tilt = interpolatedangle(gScreenTiltO, gScreenTilt, gInterpolate);
DAngle tilt = interpolatedangle(gScreenTiltO, gScreenTilt, gInterpolate * (1. / MaxSmoothRatio));
bool bDelirium = powerupCheck(gView, kPwUpDeliriumShroom) > 0;
static bool bDeliriumOld = false;
//int tiltcs, tiltdim;
@ -735,7 +735,7 @@ void viewDrawScreen(bool sceneonly)
}
}
g_relvisibility = (int32_t)(ClipLow(gVisibility - 32 * gView->visibility - brightness, 0)) - g_visibility;
cA += interpolatedangle(deliriumTurnO, deliriumTurn, gInterpolate);
cA += interpolatedangle(deliriumTurnO, deliriumTurn, gInterpolate * (1. / MaxSmoothRatio));
if (pSector != nullptr)
{

View file

@ -310,7 +310,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->x = interpolatedvalue(omyx, myx, smoothratio);
t->y = interpolatedvalue(omyy, myy, smoothratio);
t->z = interpolatedvalue(omyz, myz, smoothratio) + gs_playerheight;
t->ang = interpolatedangle(omyang, myang, smoothratio).asbuild();
t->ang = interpolatedangle(omyang, myang, smoothratio * (1. / MaxSmoothRatio)).asbuild();
t->sector = mycursectnum;
}
#endif

View file

@ -352,7 +352,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->x = interpolatedvalue(omyx, myx, smoothratio);
t->y = interpolatedvalue(omyy, myy, smoothratio);
t->z = interpolatedvalue(omyz, myz, smoothratio) + gs.playerheight;
t->ang = interpolatedangle(omyang, myang, smoothratio).asbuild();
t->ang = interpolatedangle(omyang, myang, smoothratio * (1. / MaxSmoothRatio)).asbuild();
t->sector = mycursectnum;
}
#endif

View file

@ -267,12 +267,12 @@ void drawoverlays(double smoothratio)
if (screenpeek == myconnectindex && numplayers > 1)
{
cposxy = DVector2(interpolatedvalue(omyx, myx, smoothratio), interpolatedvalue(omyy, myy, smoothratio)) * inttoworld;
cang = !SyncInput() ? myang : interpolatedangle(omyang, myang, smoothratio);
cang = !SyncInput() ? myang : interpolatedangle(omyang, myang, smoothratio * (1. / MaxSmoothRatio));
}
else
{
cposxy = interpolatedvec3(pp->opos, pp->pos, smoothratio * (1. / MaxSmoothRatio)).XY();
cang = !SyncInput() ? pp->angle.ang : interpolatedangle(pp->angle.oang, pp->angle.ang, smoothratio);
cang = !SyncInput() ? pp->angle.ang : interpolatedangle(pp->angle.oang, pp->angle.ang, smoothratio * (1. / MaxSmoothRatio));
}
}
else

View file

@ -258,7 +258,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
if (act->spr.yint < 0) act->spr.yint = -100;
else if (act->spr.yint > 199) act->spr.yint = 300;
cang = interpolatedangle(DAngle::fromBuild(ud.cameraactor->tempang), act->spr.angle, smoothratio);
cang = interpolatedangle(DAngle::fromBuild(ud.cameraactor->tempang), act->spr.angle, smoothratio * (1. / MaxSmoothRatio));
auto bh = buildhoriz(act->spr.yint);
auto cstat = act->spr.cstat;
@ -281,7 +281,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
setgamepalette(setpal(p));
// set screen rotation.
rotscrnang = !SyncInput() ? p->angle.rotscrnang : p->angle.interpolatedrotscrn(smoothratio);
rotscrnang = !SyncInput() ? p->angle.rotscrnang : p->angle.interpolatedrotscrn(smoothratio * (1. / MaxSmoothRatio));
#if 0
if ((snum == myconnectindex) && (numplayers > 1))
@ -292,7 +292,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
if (SyncInput())
{
choriz = interpolatedhorizon(omyhoriz + omyhorizoff, myhoriz + myhorizoff, smoothratio);
cang = interpolatedangle(omyang, myang, smoothratio);
cang = interpolatedangle(omyang, myang, smoothratio * (1. / MaxSmoothRatio));
}
else
{
@ -310,7 +310,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
if (SyncInput())
{
// Original code for when the values are passed through the sync struct
cang = p->angle.interpolatedsum(smoothratio);
cang = p->angle.interpolatedsum(smoothratio * (1. / MaxSmoothRatio));
choriz = p->horizon.interpolatedsum(smoothratio);
}
else

View file

@ -910,7 +910,7 @@ void DrawWeapons(double smooth)
if (cl_hudinterpolation)
{
nBobAngle = interpolatedangle(DAngle::fromBuild(obobangle), DAngle::fromBuild(bobangle), smooth).Buildfang();
nBobAngle = interpolatedangle(DAngle::fromBuild(obobangle), DAngle::fromBuild(bobangle), smooth * (1. / MaxSmoothRatio)).Buildfang();
nVal = interpolatedvaluef(PlayerList[nLocalPlayer].ototalvel, PlayerList[nLocalPlayer].totalvel, smooth, 16) * 0.5;
}
else

View file

@ -49,7 +49,7 @@ void DrawMap(double const smoothratio)
if (!nFreeze && automapMode != am_off)
{
auto pPlayerActor = PlayerList[nLocalPlayer].pActor;
auto ang = !SyncInput() ? PlayerList[nLocalPlayer].angle.sum() : PlayerList[nLocalPlayer].angle.interpolatedsum(smoothratio);
auto ang = !SyncInput() ? PlayerList[nLocalPlayer].angle.sum() : PlayerList[nLocalPlayer].angle.interpolatedsum(smoothratio * (1. / MaxSmoothRatio));
DrawOverheadMap(pPlayerActor->interpolatedvec3(smoothratio * (1. / MaxSmoothRatio)).XY(), ang, smoothratio);
}
}

View file

@ -239,8 +239,8 @@ void DrawView(double smoothRatio, bool sceneonly)
else
{
pan = PlayerList[nLocalPlayer].horizon.interpolatedsum(smoothRatio);
nAngle = PlayerList[nLocalPlayer].angle.interpolatedsum(smoothRatio);
rotscrnang = PlayerList[nLocalPlayer].angle.interpolatedrotscrn(smoothRatio);
nAngle = PlayerList[nLocalPlayer].angle.interpolatedsum(smoothRatio * (1. / MaxSmoothRatio));
rotscrnang = PlayerList[nLocalPlayer].angle.interpolatedrotscrn(smoothRatio * (1. / MaxSmoothRatio));
}
if (!bCamera)

View file

@ -784,7 +784,7 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
pp = tActor->user.PlayerP;
double sr = 1. - smoothratio * (1. / MaxSmoothRatio);
tsp->pos -= (pp->pos - pp->opos) * sr;
tsp->angle = pp->angle.interpolatedang(sr);
tsp->angle = pp->angle.interpolatedang(sr * (1. / MaxSmoothRatio));
}
}
@ -1388,9 +1388,9 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
// This isn't needed for the turret as it was fixable, but moving sector objects are problematic.
if (SyncInput() || pp != Player+myconnectindex)
{
tang = camerapp->angle.interpolatedsum(smoothratio);
tang = camerapp->angle.interpolatedsum(smoothratio * (1. / MaxSmoothRatio));
thoriz = camerapp->horizon.interpolatedsum(smoothratio);
trotscrnang = camerapp->angle.interpolatedrotscrn(smoothratio);
trotscrnang = camerapp->angle.interpolatedrotscrn(smoothratio * (1. / MaxSmoothRatio));
}
else
{