From f56cb7de480c60bbadf2033752c6764aeb0ebf82 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 12 Sep 2022 21:25:31 +1000 Subject: [PATCH] - Blood: Floatify QAV's x/y coordinates. --- source/games/blood/src/nnexts.cpp | 4 ++-- source/games/blood/src/qav.cpp | 2 +- source/games/blood/src/qav.h | 7 +++---- source/games/blood/src/weapon.cpp | 6 +++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index e98c1f1e1..cb9476cd8 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -7364,8 +7364,8 @@ void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5) // draw as weapon if (!(actor->spr.flags & kModernTypeFlag1)) { - pQAV->x = int(a3); pQAV->y = int(a4); - pQAV->Draw(a3, a4, v4, flags, a2, a5, true, interpfrac); + pQAV->x = a3; pQAV->y = a4; + pQAV->Draw(v4, flags, a2, a5, true, interpfrac); // draw fullscreen (currently 4:3 only) } diff --git a/source/games/blood/src/qav.cpp b/source/games/blood/src/qav.cpp index f499acb49..e6982f56a 100644 --- a/source/games/blood/src/qav.cpp +++ b/source/games/blood/src/qav.cpp @@ -163,7 +163,7 @@ void DrawFrame(double x, double y, double z, double a, double alpha, int picnum, // //--------------------------------------------------------------------------- -void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool to3dview, double const interpfrac) +void QAV::Draw(int ticks, int stat, int shade, int palnum, bool to3dview, double const interpfrac) { assert(ticksPerFrame > 0); diff --git a/source/games/blood/src/qav.h b/source/games/blood/src/qav.h index 166b0e945..30a7d783a 100644 --- a/source/games/blood/src/qav.h +++ b/source/games/blood/src/qav.h @@ -225,12 +225,11 @@ struct QAV int nFrames; // 8 int ticksPerFrame; // C int duration; // 10 - int x; // 14 - int y; // 18 + double x; // 14 + double y; // 18 uint16_t res_id; FRAMEINFO frames[1]; // 24 - void Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool to3dview, double const interpfrac = 1.); - void Draw(int ticks, int stat, int shade, int palnum, bool to3dview, double const interpfrac = 1.) { Draw(x, y, ticks, stat, shade, palnum, to3dview, interpfrac); } + void Draw(int ticks, int stat, int shade, int palnum, bool to3dview, double const interpfrac = 1.); void Play(int, int, int, PLAYER*); void Precache(int palette = 0); }; diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 81b3e579c..236468c1c 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -322,8 +322,8 @@ void WeaponDraw(PLAYER* pPlayer, int shade, double xpos, double ypos, int palnum qavProcessTimer(pPlayer, pQAV, &duration, &interpfrac, pPlayer->weaponState == -1, pPlayer->curWeapon == kWeapShotgun && pPlayer->weaponState == 7); - pQAV->x = int(xpos); - pQAV->y = int(ypos); + pQAV->x = xpos; + pQAV->y = ypos; int flags = 2; int nInv = powerupCheck(pPlayer, kPwUpShadowCloak); if (nInv >= 120 * 8 || (nInv != 0 && (PlayClock & 32))) @@ -331,7 +331,7 @@ void WeaponDraw(PLAYER* pPlayer, int shade, double xpos, double ypos, int palnum shade = -128; flags |= 1; } - pQAV->Draw(xpos, ypos, duration, flags, shade, palnum, true, interpfrac); + pQAV->Draw(duration, flags, shade, palnum, true, interpfrac); } //---------------------------------------------------------------------------