diff --git a/source/games/blood/src/choke.cpp b/source/games/blood/src/choke.cpp index e528fd15f..f1d02225c 100644 --- a/source/games/blood/src/choke.cpp +++ b/source/games/blood/src/choke.cpp @@ -38,7 +38,6 @@ void CChoke::init(int a1, void(*a2)(PLAYER*)) qav = getQAV(a1); if (!qav) I_Error("Could not load QAV %d\n", a1); - qav->nSprite = -1; qav->x = x; qav->y = y; duration = qav->duration; diff --git a/source/games/blood/src/d_menu.cpp b/source/games/blood/src/d_menu.cpp index 3be8a729b..fc45ba497 100644 --- a/source/games/blood/src/d_menu.cpp +++ b/source/games/blood/src/d_menu.cpp @@ -60,7 +60,6 @@ CGameMenuItemQAV::CGameMenuItemQAV(int a3, int a4, const char* name, bool widesc data = getQAV(fileSystem.GetResourceId(fileSystem.FindFile(name))); if (data) { - data->nSprite = -1; data->x = a3; data->y = a4; duration = data->duration; diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index edbe382ef..1a10b34ef 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -7364,7 +7364,6 @@ void playerQavScenePlay(PLAYER* pPlayer) if (pQavScene->qavResrc != NULL) { QAV* pQAV = pQavScene->qavResrc; - pQAV->nSprite = pPlayer->pSprite->index; int nTicks = pQAV->duration - pPlayer->weaponTimer; pQAV->Play(nTicks - 4, nTicks, pPlayer->qavCallback, pPlayer); } diff --git a/source/games/blood/src/qav.cpp b/source/games/blood/src/qav.cpp index 3f30a957d..42cb3b56b 100644 --- a/source/games/blood/src/qav.cpp +++ b/source/games/blood/src/qav.cpp @@ -203,8 +203,9 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b } -void QAV::Play(int start, int end, int nCallback, void *pData) +void QAV::Play(int start, int end, int nCallback, PLAYER *pData) { + auto pActor = pData ? pData->actor() : nullptr; assert(ticksPerFrame > 0); int frame; int ticks; @@ -227,10 +228,10 @@ void QAV::Play(int start, int end, int nCallback, void *pData) SOUNDINFO* pSound2 = &pFrame2->sound; if (pSound2->sound != 0) { if (pSound->sndFlags != kFlagSoundKillAll && pSound2->priority != pSound->priority) continue; - else if (nSprite >= 0) { + else if (pActor) { // We need stop all sounds in a range for (int a = 0; a <= pSound2->sndRange; a++) - sfxKill3DSound(&sprite[nSprite], -1, pSound2->sound + a); + sfxKill3DSound(pActor, -1, pSound2->sound + a); } else { sndKillAllSounds(); } @@ -245,8 +246,8 @@ void QAV::Play(int start, int end, int nCallback, void *pData) if (pSound->sndRange > 0 && !VanillaMode()) sound += Random((pSound->sndRange == 1) ? 2 : pSound->sndRange); - if (nSprite == -1) sndStartSample(sound, -1, -1, 0); - else sfxPlay3DSound(&sprite[nSprite], sound, 16+pSound->priority, 6); + if (pActor == nullptr) sndStartSample(sound, -1, -1, 0); + else sfxPlay3DSound(pActor, sound, 16+pSound->priority, 6); } if (pFrame->nCallbackId > 0 && nCallback != -1) { @@ -345,7 +346,7 @@ QAV* getQAV(int res_id) qavdata->duration = fr.ReadInt32(); qavdata->x = fr.ReadInt32(); qavdata->y = fr.ReadInt32(); - qavdata->nSprite = fr.ReadInt32(); + /*qavdata->nSprite =*/ fr.ReadInt32(); for (int i = 0; i < 4; i++) fr.ReadUInt8(); // Read FRAMEINFO data. diff --git a/source/games/blood/src/qav.h b/source/games/blood/src/qav.h index aa0e2bad5..efbd68c7d 100644 --- a/source/games/blood/src/qav.h +++ b/source/games/blood/src/qav.h @@ -227,14 +227,11 @@ struct QAV int duration; // 10 int x; // 14 int y; // 18 - int nSprite; // 1c - //SPRITE *pSprite; // 1c - char pad3[2]; // 20 unsigned short res_id; FRAMEINFO frames[1]; // 24 void Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool to3dview, double const smoothratio = 65536); void Draw(int ticks, int stat, int shade, int palnum, bool to3dview, double const smoothratio = 65536) { Draw(x, y, ticks, stat, shade, palnum, to3dview, smoothratio); } - void Play(int, int, int, void *); + 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 8abded16c..507ffb393 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -235,7 +235,6 @@ void WeaponInit(void) auto pQAV = getQAV(i); if (!pQAV) I_Error("Could not load QAV %d\n", i); - pQAV->nSprite = -1; } }; @@ -288,7 +287,6 @@ void WeaponPlay(PLAYER *pPlayer) if (pPlayer->weaponQav == kQAVNone) return; auto pQAV = getQAV(pPlayer->weaponQav); - pQAV->nSprite = pPlayer->pSprite->index; int nTicks = pQAV->duration - pPlayer->weaponTimer; pQAV->Play(nTicks-4, nTicks, pPlayer->qavCallback, pPlayer); }