- Blood: eliminated gameclock in weapon draw code

This commit is contained in:
Christoph Oelckers 2020-09-01 20:10:36 +02:00
parent 4b45ee150f
commit d0a3e1781e
7 changed files with 13 additions and 13 deletions

View file

@ -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)

View file

@ -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);

View file

@ -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))) {

View file

@ -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);

View file

@ -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)

View file

@ -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);

View file

@ -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;