- Rename interpolatedvaluef() in preparation for replacement.

This commit is contained in:
Mitchell Richters 2022-09-07 13:51:20 +10:00 committed by Christoph Oelckers
parent f0fe6463a4
commit 8fd6452baf
14 changed files with 39 additions and 39 deletions

View file

@ -211,17 +211,17 @@ public:
double interpolatedx(double const smoothratio, int const scale = 16)
{
return interpolatedvaluef(opos.X, spr.pos.X, smoothratio, scale);
return __interpvaluef(opos.X, spr.pos.X, smoothratio, scale);
}
double interpolatedy(double const smoothratio, int const scale = 16)
{
return interpolatedvaluef(opos.Y, spr.pos.Y, smoothratio, scale);
return __interpvaluef(opos.Y, spr.pos.Y, smoothratio, scale);
}
double interpolatedz(double const smoothratio, int const scale = 16)
{
return interpolatedvaluef(opos.Z, spr.pos.Z, smoothratio, scale);
return __interpvaluef(opos.Z, spr.pos.Z, smoothratio, scale);
}
DVector3 interpolatedvec3(double const smoothratio)

View file

@ -47,7 +47,7 @@ inline constexpr int32_t interpolatedvalue(int32_t oval, int32_t val, int const
return oval + MulScale(val - oval, smoothratio, scale);
}
inline constexpr double interpolatedvaluef(double oval, double val, double const smoothratio, int const scale = 16)
inline constexpr double __interpvaluef(double oval, double val, double const smoothratio, int const scale = 16)
{
return oval + MulScaleF(val - oval, smoothratio, scale);
}

View file

@ -195,14 +195,14 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b
if (prevTile)
{
tileX += interpolatedvaluef(prevTile->x, thisTile->x, smoothratio);
tileY += interpolatedvaluef(prevTile->y, thisTile->y, smoothratio);
tileZ = interpolatedvaluef(prevTile->z, thisTile->z, smoothratio);
tileX += __interpvaluef(prevTile->x, thisTile->x, smoothratio);
tileY += __interpvaluef(prevTile->y, thisTile->y, smoothratio);
tileZ = __interpvaluef(prevTile->z, thisTile->z, smoothratio);
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.;
tileAlpha = interpolatedvaluef(prevAlpha, thisAlpha, smoothratio);
tileAlpha = __interpvaluef(prevAlpha, thisAlpha, smoothratio);
}
else
{

View file

@ -497,11 +497,11 @@ void SetupView(int& cX, int& cY, int& cZ, DAngle& cA, fixedhoriz& cH, sectortype
cX = interpolatedvalue(predictOld.x, predict.x, gInterpolate);
cY = interpolatedvalue(predictOld.y, predict.y, gInterpolate);
cZ = interpolatedvalue(predictOld.viewz, predict.viewz, gInterpolate);
zDelta = interpolatedvaluef(predictOld.weaponZ, predict.weaponZ, gInterpolate);
zDelta = __interpvaluef(predictOld.weaponZ, predict.weaponZ, gInterpolate);
bobWidth = interpolatedvalue(predictOld.bobWidth, predict.bobWidth, gInterpolate);
bobHeight = interpolatedvalue(predictOld.bobHeight, predict.bobHeight, gInterpolate);
shakeX = interpolatedvaluef(predictOld.shakeBobX, predict.shakeBobX, gInterpolate);
shakeY = interpolatedvaluef(predictOld.shakeBobY, predict.shakeBobY, gInterpolate);
shakeX = __interpvaluef(predictOld.shakeBobX, predict.shakeBobX, gInterpolate);
shakeY = __interpvaluef(predictOld.shakeBobY, predict.shakeBobY, gInterpolate);
if (!SyncInput())
{
@ -523,11 +523,11 @@ void SetupView(int& cX, int& cY, int& cZ, DAngle& cA, fixedhoriz& cH, sectortype
cX = interpolatedvalue(pView->x, gView->actor->int_pos().X, gInterpolate);
cY = interpolatedvalue(pView->y, gView->actor->int_pos().Y, gInterpolate);
cZ = interpolatedvalue(pView->viewz, gView->zView, gInterpolate);
zDelta = interpolatedvaluef(pView->weaponZ, gView->zWeapon - gView->zView - (12 << 8), gInterpolate);
zDelta = __interpvaluef(pView->weaponZ, gView->zWeapon - gView->zView - (12 << 8), gInterpolate);
bobWidth = interpolatedvalue(pView->bobWidth, gView->bobWidth, gInterpolate);
bobHeight = interpolatedvalue(pView->bobHeight, gView->bobHeight, gInterpolate);
shakeX = interpolatedvaluef(pView->shakeBobX, gView->swayWidth, gInterpolate);
shakeY = interpolatedvaluef(pView->shakeBobY, gView->swayHeight, gInterpolate);
shakeX = __interpvaluef(pView->shakeBobX, gView->swayWidth, gInterpolate);
shakeY = __interpvaluef(pView->shakeBobY, gView->swayHeight, gInterpolate);
if (!SyncInput())
{

View file

@ -169,7 +169,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
{
t->pos.X -= MulScaleF(MaxSmoothRatio - smoothratio, pp->pos.X - pp->opos.X, 16);
t->pos.Y -= MulScaleF(MaxSmoothRatio - smoothratio, pp->pos.Y - pp->opos.Y, 16);
t->pos.Z = interpolatedvaluef(pp->opos.Z, pp->pos.Z, smoothratio) + gs.playerheight;
t->pos.Z = __interpvaluef(pp->opos.Z, pp->pos.Z, smoothratio) + gs.playerheight;
}
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
{

View file

@ -149,7 +149,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
{
t->pos.X -= MulScaleF(MaxSmoothRatio - smoothratio, pp->pos.X - pp->opos.X, 16);
t->pos.Y -= MulScaleF(MaxSmoothRatio - smoothratio, pp->pos.Y - pp->opos.Y, 16);
t->pos.Z = interpolatedvaluef(pp->opos.Z, pp->pos.Z, smoothratio) + gs.playerheight;
t->pos.Z = __interpvaluef(pp->opos.Z, pp->pos.Z, smoothratio) + gs.playerheight;
h->spr.xrepeat = 24;
h->spr.yrepeat = 17;
}

View file

@ -65,7 +65,7 @@ static void displayloogie(player_struct* p, double const smoothratio)
{
if (p->loogcnt == 0) return;
const double loogi = interpolatedvaluef(p->oloogcnt, p->loogcnt, smoothratio);
const double loogi = __interpvaluef(p->oloogcnt, p->loogcnt, smoothratio);
const double y = loogi * 4.;
for (int i = 0; i < p->numloogs; i++)
@ -86,7 +86,7 @@ static void displayloogie(player_struct* p, double const smoothratio)
static bool animatefist(int gs, player_struct* p, double look_anghalf, double looking_arc, double plravel, int fistpal, double const smoothratio)
{
const double fisti = min(interpolatedvaluef(p->ofist_incs, p->fist_incs, smoothratio), 32.);
const double fisti = min(__interpvaluef(p->ofist_incs, p->fist_incs, smoothratio), 32.);
if (fisti <= 0) return false;
hud_drawsprite(
@ -108,7 +108,7 @@ static bool animateknee(int gs, player_struct* p, double look_anghalf, double lo
if (p->knee_incs > 11 || p->knee_incs == 0 || p->GetActor()->spr.extra <= 0) return false;
static const int8_t knee_y[] = { 0,-8,-16,-32,-64,-84,-108,-108,-108,-72,-32,-8 };
const double kneei = interpolatedvaluef(knee_y[p->oknee_incs], knee_y[p->knee_incs], smoothratio);
const double kneei = __interpvaluef(knee_y[p->oknee_incs], knee_y[p->knee_incs], smoothratio);
looking_arc += kneei;
hud_drawpal(105 + plravel - look_anghalf + (kneei * 0.25), looking_arc + 280 - horiz16th, KNEE, gs, 4, pal);
@ -161,7 +161,7 @@ static bool animatetip(int gs, player_struct* p, double look_anghalf, double loo
if (p->tipincs == 0) return false;
static const int8_t tip_y[] = { 0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16 };
const double tipi = interpolatedvaluef(tip_y[p->otipincs], tip_y[p->tipincs], smoothratio) * 0.5;
const double tipi = __interpvaluef(tip_y[p->otipincs], tip_y[p->tipincs], smoothratio) * 0.5;
hud_drawpal(170 + plravel - look_anghalf, tipi + looking_arc + 240 - horiz16th, TIP + ((26 - p->tipincs) >> 4), gs, 0, pal);
@ -179,7 +179,7 @@ static bool animateaccess(int gs, player_struct* p, double look_anghalf, double
if (p->access_incs == 0 || p->GetActor()->spr.extra <= 0) return false;
static const int8_t access_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16};
const double accessi = interpolatedvaluef(access_y[p->oaccess_incs], access_y[p->access_incs], smoothratio);
const double accessi = __interpvaluef(access_y[p->oaccess_incs], access_y[p->access_incs], smoothratio);
looking_arc += accessi;
const int pal = p->access_spritenum != nullptr ? p->access_spritenum->spr.pal : 0;
@ -215,11 +215,11 @@ void displayweapon_d(int snum, double smoothratio)
if (cl_hudinterpolation)
{
weapon_sway = interpolatedvaluef(p->oweapon_sway, p->weapon_sway, smoothratio);
kickback_pic = interpolatedvaluef(p->okickback_pic, p->kickback_pic, smoothratio);
random_club_frame = interpolatedvaluef(p->orandom_club_frame, p->random_club_frame, smoothratio);
hard_landing = interpolatedvaluef(p->ohard_landing, p->hard_landing, smoothratio);
gun_pos = 80 - interpolatedvaluef(p->oweapon_pos * p->oweapon_pos, p->weapon_pos * p->weapon_pos, smoothratio);
weapon_sway = __interpvaluef(p->oweapon_sway, p->weapon_sway, smoothratio);
kickback_pic = __interpvaluef(p->okickback_pic, p->kickback_pic, smoothratio);
random_club_frame = __interpvaluef(p->orandom_club_frame, p->random_club_frame, smoothratio);
hard_landing = __interpvaluef(p->ohard_landing, p->hard_landing, smoothratio);
gun_pos = 80 - __interpvaluef(p->oweapon_pos * p->oweapon_pos, p->weapon_pos * p->weapon_pos, smoothratio);
}
else
{

View file

@ -120,10 +120,10 @@ void displayweapon_r(int snum, double smoothratio)
if (cl_hudinterpolation)
{
weapon_sway = interpolatedvaluef(p->oweapon_sway, p->weapon_sway, smoothratio);
hard_landing = interpolatedvaluef(p->ohard_landing, p->hard_landing, smoothratio);
gun_pos = 80 - interpolatedvaluef(p->oweapon_pos * p->oweapon_pos, p->weapon_pos * p->weapon_pos, smoothratio);
TiltStatus = !SyncInput() ? p->TiltStatus : interpolatedvaluef(p->oTiltStatus, p->TiltStatus, smoothratio);
weapon_sway = __interpvaluef(p->oweapon_sway, p->weapon_sway, smoothratio);
hard_landing = __interpvaluef(p->ohard_landing, p->hard_landing, smoothratio);
gun_pos = 80 - __interpvaluef(p->oweapon_pos * p->oweapon_pos, p->weapon_pos * p->weapon_pos, smoothratio);
TiltStatus = !SyncInput() ? p->TiltStatus : __interpvaluef(p->oTiltStatus, p->TiltStatus, smoothratio);
}
else
{

View file

@ -225,7 +225,7 @@ inline void hud_draw(double x, double y, int tilenum, int shade, int orientation
inline void animateshrunken(player_struct* p, double weapon_xoffset, double looking_arc, double look_anghalf, int tilenum, int8_t shade, int o, double smoothratio)
{
const double fistsign = bsinf(interpolatedvaluef(p->ofistsign, p->fistsign, smoothratio), -10);
const double fistsign = bsinf(__interpvaluef(p->ofistsign, p->fistsign, smoothratio), -10);
if (p->jetpack_on == 0) looking_arc += 32 - (p->GetActor()->int_xvel() >> 1);
hud_draw(weapon_xoffset + fistsign + 250 - look_anghalf, looking_arc + 258 - fabs(fistsign * 4), tilenum, shade, o);
hud_draw(weapon_xoffset - fistsign + 40 - look_anghalf, looking_arc + 200 + fabs(fistsign * 4), tilenum, shade, o | 4);

View file

@ -339,7 +339,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
}
else if (p->over_shoulder_on == 0)
{
if (cl_viewbob) cposz += interpolatedvaluef(p->opyoff, p->pyoff, smoothratio) * zworldtoint;
if (cl_viewbob) cposz += __interpvaluef(p->opyoff, p->pyoff, smoothratio) * zworldtoint;
viewer = p->GetActor();
}
else

View file

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

View file

@ -214,7 +214,7 @@ void DrawView(double interpfrac, bool sceneonly)
}
else
{
nCamerapos = pPlayerActor->interpolatedvec3(interpfrac).plusZ(interpolatedvaluef(PlayerList[nLocalPlayer].oeyelevel, PlayerList[nLocalPlayer].eyelevel, interpfrac * MaxSmoothRatio) * zinttoworld);
nCamerapos = pPlayerActor->interpolatedvec3(interpfrac).plusZ(__interpvaluef(PlayerList[nLocalPlayer].oeyelevel, PlayerList[nLocalPlayer].eyelevel, interpfrac * MaxSmoothRatio) * zinttoworld);
pSector = PlayerList[nLocalPlayer].pPlayerViewSect;
updatesector(nCamerapos, &pSector);

View file

@ -1380,9 +1380,9 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
else
camerapp = pp;
tx = int(interpolatedvaluef(camerapp->opos.X, camerapp->pos.X, smoothratio) * worldtoint);
ty = int(interpolatedvaluef(camerapp->opos.Y, camerapp->pos.Y, smoothratio) * worldtoint);
tz = int(interpolatedvaluef(camerapp->opos.Z, camerapp->pos.Z, smoothratio) * zworldtoint);
tx = int(__interpvaluef(camerapp->opos.X, camerapp->pos.X, smoothratio) * worldtoint);
ty = int(__interpvaluef(camerapp->opos.Y, camerapp->pos.Y, smoothratio) * worldtoint);
tz = int(__interpvaluef(camerapp->opos.Z, camerapp->pos.Z, smoothratio) * zworldtoint);
// Interpolate the player's angle while on a sector object, just like VoidSW.
// This isn't needed for the turret as it was fixable, but moving sector objects are problematic.

View file

@ -6387,8 +6387,8 @@ void pDisplaySprites(PLAYER* pp, double smoothratio)
flags = 0;
if (cl_hudinterpolation)
{
x = interpolatedvaluef(psp->opos.X, psp->pos.X, smoothratio);
y = interpolatedvaluef(psp->opos.Y, psp->pos.Y, smoothratio);
x = __interpvaluef(psp->opos.X, psp->pos.X, smoothratio);
y = __interpvaluef(psp->opos.Y, psp->pos.Y, smoothratio);
}
else