diff --git a/source/blood/src/hudsprites.cpp b/source/blood/src/hudsprites.cpp index f5ff330c5..378afd8f2 100644 --- a/source/blood/src/hudsprites.cpp +++ b/source/blood/src/hudsprites.cpp @@ -97,7 +97,7 @@ static void viewBurnTime(int gScale) } -void hudDraw(PLAYER *gView, int nSectnum, int defaultHoriz, double bobx, double boby, double zDelta, int basepal) +void hudDraw(PLAYER *gView, int nSectnum, int defaultHoriz, double bobx, double boby, double zDelta, int basepal, int smoothratio) { if (gViewPos == 0) { @@ -129,14 +129,14 @@ void hudDraw(PLAYER *gView, int nSectnum, int defaultHoriz, double bobx, double } #ifdef NOONE_EXTENSIONS - if (gView->sceneQav < 0) WeaponDraw(gView, nShade, cX, cY, nPalette); - else if (gView->pXSprite->health > 0) playerQavSceneDraw(gView, nShade, cX, cY, nPalette); + if (gView->sceneQav < 0) WeaponDraw(gView, nShade, cX, cY, nPalette, smoothratio); + else if (gView->pXSprite->health > 0) playerQavSceneDraw(gView, nShade, cX, cY, nPalette, smoothratio); else { gView->sceneQav = gView->weaponQav = -1; gView->weaponTimer = gView->curWeapon = 0; } #else - WeaponDraw(gView, nShade, cX, cY, nPalette); + WeaponDraw(gView, nShade, cX, cY, nPalette, smoothratio); #endif } if (gViewPos == 0 && gView->pXSprite->burnTime > 60) diff --git a/source/blood/src/misc.h b/source/blood/src/misc.h index 222ff34bf..d0b80f087 100644 --- a/source/blood/src/misc.h +++ b/source/blood/src/misc.h @@ -48,7 +48,7 @@ struct PLAYER; extern QAV* weaponQAV[]; void WeaponInit(void); -void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5); +void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5, int smoothratio); void WeaponRaise(PLAYER *pPlayer); void WeaponLower(PLAYER *pPlayer); char WeaponUpgrade(PLAYER *pPlayer, char newWeapon); diff --git a/source/blood/src/nnexts.cpp b/source/blood/src/nnexts.cpp index 9cf293c39..38f8853bb 100644 --- a/source/blood/src/nnexts.cpp +++ b/source/blood/src/nnexts.cpp @@ -4792,7 +4792,7 @@ void playerQavSceneProcess(PLAYER* pPlayer, QAVSCENE* pQavScene) { } } -void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5) { +void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5, int smoothratio) { if (pPlayer == NULL || pPlayer->sceneQav == -1) return; QAVSCENE* pQavScene = &gPlayerCtrl[pPlayer->nPlayer].qavScene; @@ -4801,7 +4801,7 @@ void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5) { if (pQavScene->qavResrc != NULL) { QAV* pQAV = pQavScene->qavResrc; - int v4 = (pPlayer->weaponTimer == 0) ? gameclock % pQAV->at10 : pQAV->at10 - pPlayer->weaponTimer; + int v4 = (pPlayer->weaponTimer == 0) ? ((gFrameClock + mulscale16(4, smoothratio)) % pQAV->at10) : pQAV->at10 - pPlayer->weaponTimer; int flags = 2; int nInv = powerupCheck(pPlayer, kPwUpShadowCloak); if (nInv >= 120 * 8 || (nInv != 0 && (gFrameClock & 32))) { diff --git a/source/blood/src/nnexts.h b/source/blood/src/nnexts.h index c3304e324..c1ace2f4c 100644 --- a/source/blood/src/nnexts.h +++ b/source/blood/src/nnexts.h @@ -314,7 +314,7 @@ void playerDeactivateShrooms(PLAYER* pPlayer); QAV* playerQavSceneLoad(int qavId); void playerQavSceneProcess(PLAYER* pPlayer, QAVSCENE* pQavScene); void playerQavScenePlay(PLAYER* pPlayer); -void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5); +void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5, int smoothratio); void playerQavSceneReset(PLAYER* pPlayer); // ------------------------------------------------------------------------- // void callbackUniMissileBurst(int nSprite); diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index dae9f85fe..1f8e820fe 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -981,7 +981,7 @@ void viewDrawScreen(bool sceneonly) } } #endif - hudDraw(gView, nSectnum, defaultHoriz, v4c, v48, zDelta, basepal); + hudDraw(gView, nSectnum, defaultHoriz, v4c, v48, zDelta, basepal, (int)gInterpolate); } UpdateDacs(0, true); // keep the view palette active only for the actual 3D view and its overlays. if (automapMode != am_off) diff --git a/source/blood/src/view.h b/source/blood/src/view.h index bce4cf04e..c179b714a 100644 --- a/source/blood/src/view.h +++ b/source/blood/src/view.h @@ -142,7 +142,7 @@ extern LOCATION gPrevSpriteLoc[kMaxSprites]; extern int gLastPal; extern double gInterpolate; -void hudDraw(PLAYER* gView, int nSectnum, int defaultHoriz, double bobx, double boby, double zDelta, int basepal); +void hudDraw(PLAYER* gView, int nSectnum, int defaultHoriz, double bobx, double boby, double zDelta, int basepal, int smoothratio); void viewInitializePrediction(void); void viewUpdatePrediction(InputPacket *pInput); void viewCorrectPrediction(void); diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index 2ae28ade0..02f79793f 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -232,7 +232,7 @@ void WeaponPrecache(void) } } -void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5) +void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5, int smoothratio) { dassert(pPlayer != NULL); if (pPlayer->weaponQav == -1) @@ -240,14 +240,14 @@ void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5) QAV * pQAV = weaponQAV[pPlayer->weaponQav]; int v4; if (pPlayer->weaponTimer == 0) - v4 = gameclock % pQAV->at10; + v4 = (gFrameClock + mulscale16(4, smoothratio)) % pQAV->at10; else v4 = pQAV->at10 - pPlayer->weaponTimer; pQAV->x = int(a3); pQAV->y = int(a4); int flags = 2; int nInv = powerupCheck(pPlayer, kPwUpShadowCloak); - if (nInv >= 120 * 8 || (nInv != 0 && (gameclock & 32))) + if (nInv >= 120 * 8 || (nInv != 0 && (gFrameClock & 32))) { a2 = -128; flags |= 1;