From d133839e2e03702c01508d751f5f7c9cbb20bf12 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 29 Aug 2022 11:18:54 +1000 Subject: [PATCH] - Fix a few uses of `interpolatedvalue()` with floating point numbers. --- source/games/blood/src/view.cpp | 2 +- source/games/duke/src/animatesprites_d.cpp | 2 +- source/games/duke/src/animatesprites_r.cpp | 2 +- source/games/duke/src/inlines.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 1c0760d12..e52c3fd7e 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -767,7 +767,7 @@ void viewDrawScreen(bool sceneonly) } if (!sceneonly) hudDraw(gView, pSector, shakeX, shakeY, zDelta, basepal, gInterpolate); - fixedhoriz deliriumPitchI = q16horiz(interpolatedvalue(IntToFixed(deliriumPitchO), IntToFixed(deliriumPitch), gInterpolate)); + fixedhoriz deliriumPitchI = interpolatedhorizon(q16horiz(deliriumPitchO), q16horiz(deliriumPitch), gInterpolate); auto bakCstat = gView->actor->spr.cstat; gView->actor->spr.cstat |= (gViewPos == 0) ? CSTAT_SPRITE_INVISIBLE : CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP; render_drawrooms(gView->actor, { cX, cY, cZ }, sectnum(pSector), cA, cH + deliriumPitchI, rotscrnang, gInterpolate); diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 388245fdd..5a4535b8a 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -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 = interpolatedvalue(pp->opos.Z, pp->pos.Z, smoothratio) + gs.playerheight; + t->pos.Z = interpolatedvaluef(pp->opos.Z, pp->pos.Z, smoothratio) + gs.playerheight; } else if (!actorflag(h, SFLAG_NOINTERPOLATE)) { diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index d06545e49..45a618a26 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -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 = interpolatedvalue(pp->opos.Z, pp->pos.Z, smoothratio) + gs.playerheight; + t->pos.Z = interpolatedvaluef(pp->opos.Z, pp->pos.Z, smoothratio) + gs.playerheight; h->spr.xrepeat = 24; h->spr.yrepeat = 17; } diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index e6f477c43..5544b8111 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -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(interpolatedvalue(p->ofistsign, p->fistsign, smoothratio), -10); + const double fistsign = bsinf(interpolatedvaluef(p->ofistsign, p->fistsign, smoothratio), -10); if (p->jetpack_on == 0) looking_arc += 32 - (p->GetActor()->spr.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);