diff --git a/source/games/exhumed/src/aistuff.h b/source/games/exhumed/src/aistuff.h index 99aef886b..330d221f4 100644 --- a/source/games/exhumed/src/aistuff.h +++ b/source/games/exhumed/src/aistuff.h @@ -29,7 +29,11 @@ BEGIN_PS_NS void InitAnims(); void DestroyAnim(DExhumedActor* nAnim); -DExhumedActor* BuildAnim(DExhumedActor* actor, int val, int val2, const DVector3& pos, sectortype* pSector, int nRepeat, int nFlag); +DExhumedActor* BuildAnim(DExhumedActor* actor, int val, int val2, const DVector3& pos, sectortype* pSector, double nScale, int nFlag); +DExhumedActor* BuildAnimI(DExhumedActor* actor, int val, int val2, const DVector3& pos, sectortype* pSector, int nRepeat, int nFlag) +{ + return BuildAnim(actor, val, val2, pos, pSector, nRepeat * REPEAT_SCALE, nFlag); +} void FuncAnim(int, int, int, int); void BuildExplosion(DExhumedActor* actor); diff --git a/source/games/exhumed/src/anims.cpp b/source/games/exhumed/src/anims.cpp index 7ac3c2304..ca5f7821b 100644 --- a/source/games/exhumed/src/anims.cpp +++ b/source/games/exhumed/src/anims.cpp @@ -72,7 +72,7 @@ void DestroyAnim(DExhumedActor* pActor) // //--------------------------------------------------------------------------- -DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector3& pos, sectortype* pSector, int nRepeat, int nFlag) +DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector3& pos, sectortype* pSector, double nScale, int nFlag) { if (pActor == nullptr) { pActor = insertActor(pSector, 500); @@ -92,7 +92,7 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector } pActor->clipdist = 2.5; - pActor->spr.SetScale(nRepeat * REPEAT_SCALE, nRepeat * REPEAT_SCALE); + pActor->spr.SetScale(nScale, nScale); pActor->spr.picnum = 1; pActor->spr.angle = nullAngle; pActor->spr.xoffset = 0; @@ -268,7 +268,7 @@ void BuildExplosion(DExhumedActor* pActor) edx = 34; } - BuildAnim(nullptr, edx, 0, pActor->spr.pos, pActor->sector(), pActor->spr.ScaleX() * INV_REPEAT_SCALE, 4); + BuildAnimI(nullptr, edx, 0, pActor->spr.pos, pActor->sector(), pActor->spr.ScaleX() * INV_REPEAT_SCALE, 4); } //--------------------------------------------------------------------------- @@ -308,7 +308,7 @@ void BuildSplash(DExhumedActor* pActor, sectortype* pSector) nFlag = 0; } - auto pSpawned = BuildAnim(nullptr, edx, 0, DVector3(pActor->spr.pos.XY(), pSector->floorz), pSector, nRepeat, nFlag); + auto pSpawned = BuildAnimI(nullptr, edx, 0, DVector3(pActor->spr.pos.XY(), pSector->floorz), pSector, nRepeat, nFlag); if (!bIsLava) { diff --git a/source/games/exhumed/src/bubbles.cpp b/source/games/exhumed/src/bubbles.cpp index 36b819b59..cf577b6a7 100644 --- a/source/games/exhumed/src/bubbles.cpp +++ b/source/games/exhumed/src/bubbles.cpp @@ -113,7 +113,7 @@ void AIBubble::Tick(RunListEvent* ev) auto pSectAbove = pSector->pAbove; if (pActor->spr.hitag > -1 && pSectAbove != nullptr) { - BuildAnim(nullptr, 70, 0, DVector3(pActor->spr.pos.XY(), pSectAbove->floorz), pSectAbove, 64, 0); + BuildAnimI(nullptr, 70, 0, DVector3(pActor->spr.pos.XY(), pSectAbove->floorz), pSectAbove, 64, 0); } DestroyBubble(pActor); diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index c75467944..e4bc4b060 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -177,7 +177,7 @@ void IgniteSprite(DExhumedActor* pActor) { pActor->spr.hitag += 2; - auto pAnimActor = BuildAnim(nullptr, 38, 0, pActor->spr.pos, pActor->sector(), 40, 20); + auto pAnimActor = BuildAnimI(nullptr, 38, 0, pActor->spr.pos, pActor->sector(), 40, 20); if (pAnimActor) { @@ -216,7 +216,7 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo } if (!RandomSize(2)) { - BuildAnim(nullptr, pBulletInfo->field_C, 0, pos, pSector, 40, pBulletInfo->nFlags); + BuildAnimI(nullptr, pBulletInfo->field_C, 0, pos, pSector, 40, pBulletInfo->nFlags); } return; @@ -279,7 +279,7 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo if (nStat <= 90 || nStat >= 199) { - BuildAnim(nullptr, pBulletInfo->field_C, 0, pos, pSector, 40, pBulletInfo->nFlags); + BuildAnimI(nullptr, pBulletInfo->field_C, 0, pos, pSector, 40, pBulletInfo->nFlags); return; } @@ -291,13 +291,13 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo case 102: case kStatExplodeTrigger: case kStatExplodeTarget: - BuildAnim(nullptr, 12, 0, pos, pSector, 40, 0); + BuildAnimI(nullptr, 12, 0, pos, pSector, 40, 0); break; default: - BuildAnim(nullptr, 39, 0, pos, pSector, 40, 0); + BuildAnimI(nullptr, 39, 0, pos, pSector, 40, 0); if (pBullet->nType > 2) { - BuildAnim(nullptr, pBulletInfo->field_C, 0, pos, pSector, 40, pBulletInfo->nFlags); + BuildAnimI(nullptr, pBulletInfo->field_C, 0, pos, pSector, 40, pBulletInfo->nFlags); } break; } @@ -491,7 +491,7 @@ HITSPRITE: } else { - BuildAnim(nullptr, pBulletInfo->field_C, 0, pos, pHitSect, 40, pBulletInfo->nFlags); + BuildAnimI(nullptr, pBulletInfo->field_C, 0, pos, pHitSect, 40, pBulletInfo->nFlags); } } else @@ -510,7 +510,7 @@ HITSPRITE: } // draws bullet puff on walls when they're shot - BuildAnim(nullptr, pBulletInfo->field_C, 0, pos.plusZ(zOffset - 16), pHitSect, 40, pBulletInfo->nFlags); + BuildAnimI(nullptr, pBulletInfo->field_C, 0, pos.plusZ(zOffset - 16), pHitSect, 40, pBulletInfo->nFlags); } } else @@ -807,7 +807,7 @@ void AIBullet::Tick(RunListEvent* ev) if (nFlag & 0x80) { - BuildAnim(nullptr, 45, 0, pActor->spr.pos, pActor->sector(), pActor->spr.ScaleX() * REPEAT_SCALE, 0); + BuildAnimI(nullptr, 45, 0, pActor->spr.pos, pActor->sector(), pActor->spr.ScaleX() * REPEAT_SCALE, 0); } BulletList[nBullet].nFrame++; diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index 727e69ed1..60ccfa395 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -78,7 +78,7 @@ void BuildFishLimb(DExhumedActor* pActor, int anim) void BuildBlood(const DVector3& pos, sectortype* pSector) { - BuildAnim(nullptr, kSeqFish, 36, pos, pSector, 75, 128); + BuildAnimI(nullptr, kSeqFish, 36, pos, pSector, 75, 128); } //--------------------------------------------------------------------------- diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index 3e5ecbdf1..c2e247800 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -219,7 +219,7 @@ void ExplodeGrenade(DExhumedActor* pActor) runlist_RadialDamageEnemy(pActor, nDamage, BulletInfo[kWeaponGrenade].nRadius); - BuildAnim(nullptr, var_28, 0, pActor->spr.pos, pActor->sector(), var_20, 4); + BuildAnimI(nullptr, var_28, 0, pActor->spr.pos, pActor->sector(), var_20, 4); AddFlash(pActor->sector(), pActor->spr.pos, 128); DestroyGrenade(pActor); diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 22aa253ef..bca728678 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -777,7 +777,7 @@ loc_flag: else if (pActor2->spr.statnum == 102) { // loc_27370: - BuildAnim(nullptr, 12, 0, thePos, pSectorB, 30, 0); + BuildAnimI(nullptr, 12, 0, thePos, pSectorB, 30, 0); } else if (pActor2->spr.statnum == kStatExplodeTrigger) { var_28 += 2; @@ -789,7 +789,7 @@ loc_flag: else { // loc_27370: - BuildAnim(nullptr, 12, 0, thePos, pSectorB, 30, 0); + BuildAnimI(nullptr, 12, 0, thePos, pSectorB, 30, 0); } } } diff --git a/source/games/exhumed/src/items.cpp b/source/games/exhumed/src/items.cpp index 318398d16..b5cbfe225 100644 --- a/source/games/exhumed/src/items.cpp +++ b/source/games/exhumed/src/items.cpp @@ -135,7 +135,7 @@ void BuildItemAnim(DExhumedActor* pActor) if (nItemAnimInfo[nItem].a >= 0) { - auto pAnimActor = BuildAnim(pActor, 41, nItemAnimInfo[nItem].a, pActor->spr.pos, pActor->sector(), nItemAnimInfo[nItem].repeat, 20); + auto pAnimActor = BuildAnimI(pActor, 41, nItemAnimInfo[nItem].a, pActor->spr.pos, pActor->sector(), nItemAnimInfo[nItem].repeat, 20); if (nItem == 44) { pAnimActor->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT; @@ -404,7 +404,7 @@ void DropMagic(DExhumedActor* pActor) if (nMagicCount <= 0) { - auto pAnimActor = BuildAnim( + auto pAnimActor = BuildAnimI( nullptr, 64, 0, @@ -481,7 +481,7 @@ void DoRegenerates() if (pActor->spr.extra <= 0) { - BuildAnim(nullptr, 38, 0, pActor->spr.pos, pActor->sector(), 64, 4); + BuildAnimI(nullptr, 38, 0, pActor->spr.pos, pActor->sector(), 64, 4); D3PlayFX(StaticSound[kSoundTorchOn], pActor); } else { diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 1921c4a35..872db6609 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -2023,7 +2023,7 @@ void AIObject::Tick(RunListEvent* ev) } AddFlash(pActor->sector(), pActor->spr.pos, 128); - BuildAnim(nullptr, var_18, 0, DVector3(pActor->spr.pos.XY(), pActor->sector()->floorz), pActor->sector(), 240, 4); + BuildAnimI(nullptr, var_18, 0, DVector3(pActor->spr.pos.XY(), pActor->sector()->floorz), pActor->sector(), 240, 4); // int edi = nSprite | 0x4000; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 1370b4bca..ad1b84418 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -2585,7 +2585,7 @@ sectdone: sectortype* mouthSect; auto pos = WheresMyMouth(nPlayer, &mouthSect); - BuildAnim(nullptr, 71, 0, DVector3(pos.XY(), pPlayerActor->spr.pos.Z + 15), mouthSect, 75, 128); + BuildAnimI(nullptr, 71, 0, DVector3(pos.XY(), pPlayerActor->spr.pos.Z + 15), mouthSect, 75, 128); } break; case 17: diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index bd3fe7042..1dbf0fbb3 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -269,7 +269,7 @@ void DestroyEgg(int nEgg) if (QueenEgg[nEgg].nAction != 4) { - BuildAnim(nullptr, 34, 0, pActor->spr.pos, pActor->sector(), pActor->spr.xrepeat, 4); + BuildAnimI(nullptr, 34, 0, pActor->spr.pos, pActor->sector(), pActor->spr.xrepeat, 4); } else { @@ -1531,7 +1531,7 @@ void AIQueen::Damage(RunListEvent* ev) QueenList[nQueen].nHealth = 4000; QueenList[nQueen].nAction = 7; - BuildAnim(nullptr, 36, 0, pActor->spr.pos.plusZ(-30), pActor->sector(), pActor->spr.xrepeat, 4); + BuildAnimI(nullptr, 36, 0, pActor->spr.pos.plusZ(-30), pActor->sector(), pActor->spr.xrepeat, 4); break; case 2: QueenList[nQueen].nHealth = 4000; diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index d97421096..1e6b7fae5 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -146,7 +146,7 @@ void ExplodeSnakeSprite(DExhumedActor* pActor, int nPlayer) pActor->pTarget = nOwner; - BuildAnim(nullptr, 23, 0, pActor->spr.pos, pActor->sector(), 40, 4); + BuildAnimI(nullptr, 23, 0, pActor->spr.pos, pActor->sector(), 40, 4); AddFlash(pActor->sector(), pActor->spr.pos, 128);