- use the actor variant of BuildAnim wherever trivially doable.

This commit is contained in:
Christoph Oelckers 2021-10-24 19:11:04 +02:00
parent b79b1aad53
commit a7b71c724e
10 changed files with 18 additions and 18 deletions

View file

@ -295,7 +295,7 @@ void BuildExplosion(short nSprite)
edx = 34; edx = 34;
} }
BuildAnim(-1, edx, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, pSprite->xrepeat, 4); BuildAnim(nullptr, edx, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, pSprite->xrepeat, 4);
} }
int BuildSplash(int nSprite, int nSector) int BuildSplash(int nSprite, int nSector)
@ -329,11 +329,11 @@ int BuildSplash(int nSprite, int nSector)
nFlag = 0; nFlag = 0;
} }
int nAnim = BuildAnim(-1, edx, 0, pSprite->x, pSprite->y, sector[nSector].floorz, nSector, nRepeat, nFlag); auto pActor = BuildAnim(nullptr, edx, 0, pSprite->x, pSprite->y, sector[nSector].floorz, nSector, nRepeat, nFlag);
if (!bIsLava) if (!bIsLava)
{ {
D3PlayFX(StaticSound[nSound] | 0xa00, AnimList[nAnim].nSprite); D3PlayFX(StaticSound[nSound] | 0xa00, pActor);
} }
return AnimList[nAnim].nSprite; return AnimList[nAnim].nSprite;

View file

@ -188,7 +188,7 @@ void AIBubble::Tick(RunListEvent* ev)
short nSectAbove = SectAbove[nSector]; short nSectAbove = SectAbove[nSector];
if (pSprite->hitag > -1 && nSectAbove != -1) { if (pSprite->hitag > -1 && nSectAbove != -1) {
BuildAnim(-1, 70, 0, pSprite->x, pSprite->y, sector[nSectAbove].floorz, nSectAbove, 64, 0); BuildAnim(nullptr, 70, 0, pSprite->x, pSprite->y, sector[nSectAbove].floorz, nSectAbove, 64, 0);
} }
DestroyBubble(nBubble); DestroyBubble(nBubble);

View file

@ -271,7 +271,7 @@ void BulletHitsSprite(Bullet *pBullet, short nBulletSprite, short nHitSprite, in
if (nStat <= 90 || nStat >= 199) if (nStat <= 90 || nStat >= 199)
{ {
BuildAnim(-1, pBulletInfo->field_C, 0, x, y, z, nSector, 40, pBulletInfo->nFlags); BuildAnim(nullptr, pBulletInfo->field_C, 0, x, y, z, nSector, 40, pBulletInfo->nFlags);
return; return;
} }
@ -283,13 +283,13 @@ void BulletHitsSprite(Bullet *pBullet, short nBulletSprite, short nHitSprite, in
case 102: case 102:
case kStatExplodeTrigger: case kStatExplodeTrigger:
case kStatExplodeTarget: case kStatExplodeTarget:
BuildAnim(-1, 12, 0, x, y, z, nSector, 40, 0); BuildAnim(nullptr, 12, 0, x, y, z, nSector, 40, 0);
break; break;
default: default:
BuildAnim(-1, 39, 0, x, y, z, nSector, 40, 0); BuildAnim(nullptr, 39, 0, x, y, z, nSector, 40, 0);
if (pBullet->nType > 2) if (pBullet->nType > 2)
{ {
BuildAnim(-1, pBulletInfo->field_C, 0, x, y, z, nSector, 40, pBulletInfo->nFlags); BuildAnim(nullptr, pBulletInfo->field_C, 0, x, y, z, nSector, 40, pBulletInfo->nFlags);
} }
break; break;
} }
@ -500,7 +500,7 @@ HITWALL:
} }
else else
{ {
BuildAnim(-1, pBulletInfo->field_C, 0, x2, y2, z2, hitsect, 40, pBulletInfo->nFlags); BuildAnim(nullptr, pBulletInfo->field_C, 0, x2, y2, z2, hitsect, 40, pBulletInfo->nFlags);
} }
} }
else else
@ -518,7 +518,7 @@ HITWALL:
} }
// draws bullet puff on walls when they're shot // draws bullet puff on walls when they're shot
BuildAnim(-1, pBulletInfo->field_C, 0, x2, y2, z2 + zOffset + -4096, hitsect, 40, pBulletInfo->nFlags); BuildAnim(nullptr, pBulletInfo->field_C, 0, x2, y2, z2 + zOffset + -4096, hitsect, 40, pBulletInfo->nFlags);
} }
} }
else else

View file

@ -269,7 +269,7 @@ void ExplodeGrenade(short nGrenade)
runlist_RadialDamageEnemy(nGrenadeSprite, nDamage, BulletInfo[kWeaponGrenade].nRadius); runlist_RadialDamageEnemy(nGrenadeSprite, nDamage, BulletInfo[kWeaponGrenade].nRadius);
BuildAnim(-1, var_28, 0, pGrenadeSprite->x, pGrenadeSprite->y, pGrenadeSprite->z, pGrenadeSprite->sectnum, var_20, 4); BuildAnim(nullptr, var_28, 0, pGrenadeSprite->x, pGrenadeSprite->y, pGrenadeSprite->z, pGrenadeSprite->sectnum, var_20, 4);
AddFlash(pGrenadeSprite->sectnum, pGrenadeSprite->x, pGrenadeSprite->y, pGrenadeSprite->z, 128); AddFlash(pGrenadeSprite->sectnum, pGrenadeSprite->x, pGrenadeSprite->y, pGrenadeSprite->z, 128);
nGrenadePlayer[nGrenade] = -1; nGrenadePlayer[nGrenade] = -1;

View file

@ -762,7 +762,7 @@ loc_flag:
else if (sprite[nSprite2].statnum == 102) else if (sprite[nSprite2].statnum == 102)
{ {
// loc_27370: // loc_27370:
BuildAnim(-1, 12, 0, theX, theY, theZ, nSectorB, 30, 0); BuildAnim(nullptr, 12, 0, theX, theY, theZ, nSectorB, 30, 0);
} }
else if (sprite[nSprite2].statnum == kStatExplodeTrigger) { else if (sprite[nSprite2].statnum == kStatExplodeTrigger) {
var_28 += 2; var_28 += 2;
@ -774,7 +774,7 @@ loc_flag:
else else
{ {
// loc_27370: // loc_27370:
BuildAnim(-1, 12, 0, theX, theY, theZ, nSectorB, 30, 0); BuildAnim(nullptr, 12, 0, theX, theY, theZ, nSectorB, 30, 0);
} }
} }
} }

View file

@ -454,7 +454,7 @@ void DoRegenerates()
if (pSprite->extra <= 0) if (pSprite->extra <= 0)
{ {
BuildAnim(-1, 38, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 64, 4); BuildAnim(nullptr, 38, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 64, 4);
D3PlayFX(StaticSound[kSoundTorchOn], nSprite); D3PlayFX(StaticSound[kSoundTorchOn], nSprite);
} }
else { else {

View file

@ -2116,7 +2116,7 @@ void AIObject::Tick(RunListEvent* ev)
} }
AddFlash(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 128); AddFlash(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 128);
BuildAnim(-1, var_18, 0, pSprite->x, pSprite->y, sector[pSprite->sectnum].floorz, pSprite->sectnum, 240, 4); BuildAnim(nullptr, var_18, 0, pSprite->x, pSprite->y, sector[pSprite->sectnum].floorz, pSprite->sectnum, 240, 4);
// int edi = nSprite | 0x4000; // int edi = nSprite | 0x4000;

View file

@ -2591,7 +2591,7 @@ sectdone:
short mouthSect; short mouthSect;
WheresMyMouth(nPlayer, &mouthX, &mouthY, &mouthZ, &mouthSect); WheresMyMouth(nPlayer, &mouthX, &mouthY, &mouthZ, &mouthSect);
BuildAnim(-1, 71, 0, mouthX, mouthY, pPlayerSprite->z + 3840, mouthSect, 75, 128); BuildAnim(nullptr, 71, 0, mouthX, mouthY, pPlayerSprite->z + 3840, mouthSect, 75, 128);
} }
break; break;
case 17: case 17:

View file

@ -240,7 +240,7 @@ void DestroyEgg(short nEgg)
if (QueenEgg[nEgg].nAction != 4) if (QueenEgg[nEgg].nAction != 4)
{ {
BuildAnim(-1, 34, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, pSprite->xrepeat, 4); BuildAnim(nullptr, 34, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, pSprite->xrepeat, 4);
} }
else else
{ {

View file

@ -108,7 +108,7 @@ void ExplodeSnakeSprite(int nSprite, short nPlayer)
pSprite->owner = nOwner; pSprite->owner = nOwner;
BuildAnim(-1, 23, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 40, 4); BuildAnim(nullptr, 23, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 40, 4);
AddFlash(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 128); AddFlash(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 128);