- Blood: Add interpolated weapon QAVs to WeaponInit() and WeaponPrecache() functions.

This commit is contained in:
Mitchell Richters 2021-08-28 16:41:51 +10:00
parent 726edc199e
commit 2fbfa82fe8

View file

@ -228,23 +228,35 @@ void SpawnShellEject(PLAYER *pPlayer, int a2, int a3)
void WeaponInit(void) void WeaponInit(void)
{ {
for (int i = 0; i < kQAVEnd; i++) auto doInit = [](const int base)
{ {
auto pQAV = getQAV(i); for (int i = base; i < (kQAVEnd + base); i++)
if (!pQAV) {
I_Error("Could not load QAV %d\n", i); auto pQAV = getQAV(i);
pQAV->nSprite = -1; if (!pQAV)
} I_Error("Could not load QAV %d\n", i);
pQAV->nSprite = -1;
}
};
doInit(0);
doInit(10000);
} }
void WeaponPrecache() void WeaponPrecache()
{ {
for (int i = 0; i < kQAVEnd; i++) auto doPrecache = [](const int base)
{ {
auto pQAV = getQAV(i); for (int i = base; i < (kQAVEnd + base); i++)
if (pQAV) {
pQAV->Precache(); auto pQAV = getQAV(i);
} if (pQAV)
pQAV->Precache();
}
};
doPrecache(0);
doPrecache(10000);
} }
void WeaponDraw(PLAYER *pPlayer, int shade, double xpos, double ypos, int palnum) void WeaponDraw(PLAYER *pPlayer, int shade, double xpos, double ypos, int palnum)