From d3867cba5f71976e70aabd34f505c981400c384e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 4 Oct 2023 23:00:17 +0200 Subject: [PATCH] removed the unused int parameter from state callbacks. This makes handling a lot easier because all state related functions have the same signature --- source/games/blood/src/actor.cpp | 14 ++-- source/games/blood/src/actor.h | 21 +++-- source/games/blood/src/aibat.cpp | 2 +- source/games/blood/src/aibeast.cpp | 4 +- source/games/blood/src/aiboneel.cpp | 2 +- source/games/blood/src/aiburn.cpp | 2 +- source/games/blood/src/aicaleb.cpp | 2 +- source/games/blood/src/aicerber.cpp | 6 +- source/games/blood/src/aicult.cpp | 12 +-- source/games/blood/src/aigarg.cpp | 8 +- source/games/blood/src/aighost.cpp | 6 +- source/games/blood/src/aigilbst.cpp | 2 +- source/games/blood/src/aihand.cpp | 2 +- source/games/blood/src/aihound.cpp | 4 +- source/games/blood/src/aipod.cpp | 8 +- source/games/blood/src/airat.cpp | 2 +- source/games/blood/src/aispid.cpp | 6 +- source/games/blood/src/aitchern.cpp | 6 +- source/games/blood/src/aiunicult.cpp | 10 +-- source/games/blood/src/aizomba.cpp | 4 +- source/games/blood/src/aizombf.cpp | 6 +- source/games/blood/src/nnexts.cpp | 2 +- source/games/blood/src/player.cpp | 4 +- source/games/blood/src/seq.cpp | 12 +-- source/games/blood/src/seqcb.h | 116 +++++++++++++-------------- source/games/blood/src/triggers.cpp | 8 +- 26 files changed, 140 insertions(+), 131 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 7fc6fa616..3dbd4fd8c 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -5711,7 +5711,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3 // //--------------------------------------------------------------------------- -void FireballSeqCallback(int, DBloodActor* actor) +void FireballSeqCallback(DBloodActor* actor) { auto pFX = gFX.fxSpawnActor(FX_11, actor->sector(), actor->spr.pos); if (pFX) @@ -5720,7 +5720,7 @@ void FireballSeqCallback(int, DBloodActor* actor) } } -void NapalmSeqCallback(int, DBloodActor* actor) +void NapalmSeqCallback(DBloodActor* actor) { auto pFX = gFX.fxSpawnActor(FX_12, actor->sector(), actor->spr.pos); if (pFX) @@ -5729,7 +5729,7 @@ void NapalmSeqCallback(int, DBloodActor* actor) } } -void Fx32Callback(int, DBloodActor* actor) +void Fx32Callback(DBloodActor* actor) { auto pFX = gFX.fxSpawnActor(FX_32, actor->sector(), actor->spr.pos); if (pFX) @@ -5738,7 +5738,7 @@ void Fx32Callback(int, DBloodActor* actor) } } -void Fx33Callback(int, DBloodActor* actor) +void Fx33Callback(DBloodActor* actor) { auto pFX = gFX.fxSpawnActor(FX_33, actor->sector(), actor->spr.pos); if (pFX) @@ -5753,7 +5753,7 @@ void Fx33Callback(int, DBloodActor* actor) // //--------------------------------------------------------------------------- -void TreeToGibCallback(int, DBloodActor* actor) +void TreeToGibCallback(DBloodActor* actor) { actor->ChangeType(kThingObjectExplode); actor->xspr.state = 1; @@ -5765,7 +5765,7 @@ void TreeToGibCallback(int, DBloodActor* actor) actor->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; } -void DudeToGibCallback1(int, DBloodActor* actor) +void DudeToGibCallback1(DBloodActor* actor) { actor->ChangeType(kThingBloodChunks); actor->xspr.data1 = 8; @@ -5780,7 +5780,7 @@ void DudeToGibCallback1(int, DBloodActor* actor) actor->xspr.state = 1; } -void DudeToGibCallback2(int, DBloodActor* actor) +void DudeToGibCallback2(DBloodActor* actor) { actor->ChangeType(kThingBloodChunks); actor->xspr.data1 = 3; diff --git a/source/games/blood/src/actor.h b/source/games/blood/src/actor.h index 35209e8ed..842e9badc 100644 --- a/source/games/blood/src/actor.h +++ b/source/games/blood/src/actor.h @@ -153,12 +153,6 @@ void actAddGameLight(int lightRadius, int spriteNum, int zOffset, int lightRange void actDoLight(int spriteNum); #endif -void FireballSeqCallback(int, int); -void sub_38938(int, int); -void NapalmSeqCallback(int, int); -void sub_3888C(int, int); -void TreeToGibCallback(int, int); - bool IsUnderwaterSector(sectortype* pSector); void actInit(TArray& actors); void actWallBounceVector(DBloodActor* actor, walltype* pWall, double factor); @@ -195,4 +189,19 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor); extern const int16_t DudeDifficulty[]; +bool IsUnderwaterSector(sectortype* pSector); + +// route state callbacks through the scripting interface. +// this needs to work with incomplete data, so avoid the asserting macros. +#define DEF_ANIMATOR(func) \ + int func(DBloodActor*); \ + DEFINE_ACTION_FUNCTION_NATIVE(DBloodActor, func, func) \ + { \ + auto self = (DBloodActor *)(param[0].a); \ + func(self); \ + return 0; \ + } +#define AF(func) DBloodActor_##func##_VMPtr + + END_BLD_NS diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index b6c6fb79c..df3a0fd7f 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -61,7 +61,7 @@ AISTATE batDodgeDown = { kAiStateMove, 6, -1, 120, NULL, batMoveDodgeDown, 0, &b AISTATE batDodgeDownRight = { kAiStateMove, 6, -1, 90, NULL, batMoveDodgeDown, 0, &batChase }; AISTATE batDodgeDownLeft = { kAiStateMove, 6, -1, 90, NULL, batMoveDodgeDown, 0, &batChase }; -void batBiteSeqCallback(int, DBloodActor* actor) +void batBiteSeqCallback(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto pTarget = actor->GetTarget(); diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 91d307d9b..3f4e70ec0 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -62,7 +62,7 @@ AISTATE beast138FB4 = { kAiStateOther, 9, -1, 120, NULL, sub_62AE0, beastThinkSw AISTATE beast138FD0 = { kAiStateOther, 9, -1, 0, NULL, sub_62D7C, beastThinkSwimChase, &beastSwimChase }; AISTATE beast138FEC = { kAiStateOther, 9, -1, 120, NULL, aiMoveTurn, NULL, &beastSwimChase }; -void SlashSeqCallback(int, DBloodActor* actor) +void SlashSeqCallback(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -80,7 +80,7 @@ void SlashSeqCallback(int, DBloodActor* actor) sfxPlay3DSound(actor, 9012 + Random(2), -1, 0); } -void StompSeqCallback(int, DBloodActor* actor) +void StompSeqCallback(DBloodActor* actor) { auto pos = actor->spr.pos; const int nDist = 400; diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index 25d22d2a7..941bbb8f4 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -61,7 +61,7 @@ AISTATE eelDodgeDown = { kAiStateMove, 0, -1, 120, NULL, eelMoveDodgeDown, NULL, AISTATE eelDodgeDownRight = { kAiStateMove, 0, -1, 90, NULL, eelMoveDodgeDown, NULL, &eelChase }; AISTATE eelDodgeDownLeft = { kAiStateMove, 0, -1, 90, NULL, eelMoveDodgeDown, NULL, &eelChase }; -void eelBiteSeqCallback(int, DBloodActor* actor) +void eelBiteSeqCallback(DBloodActor* actor) { /* * workaround for diff --git a/source/games/blood/src/aiburn.cpp b/source/games/blood/src/aiburn.cpp index da2c56df6..69e257592 100644 --- a/source/games/blood/src/aiburn.cpp +++ b/source/games/blood/src/aiburn.cpp @@ -70,7 +70,7 @@ AISTATE genDudeBurnGoto = { kAiStateMove, 3, -1, 3600, NULL, aiMoveForward, burn AISTATE genDudeBurnSearch = { kAiStateSearch, 3, -1, 3600, NULL, aiMoveForward, burnThinkSearch, &genDudeBurnSearch }; AISTATE genDudeBurnAttack = { kAiStateChase, 3, nBurnClient, 120, NULL, NULL, NULL, &genDudeBurnChase }; -void BurnSeqCallback(int, DBloodActor*) +void BurnSeqCallback(DBloodActor*) { } diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index ba5168160..87c5740f3 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -57,7 +57,7 @@ AISTATE tinycaleb139660 = { kAiStateOther, 8, -1, 120, NULL, sub_65F44, calebThi AISTATE tinycaleb13967C = { kAiStateOther, 8, -1, 0, NULL, sub_661E0, calebThinkSwimChase, &tinycalebSwimChase }; AISTATE tinycaleb139698 = { kAiStateOther, 8, -1, 120, NULL, aiMoveTurn, NULL, &tinycalebSwimChase }; -void SeqAttackCallback(int, DBloodActor* actor) +void SeqAttackCallback(DBloodActor* actor) { DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); vect.X += Random2F(1500, 4); diff --git a/source/games/blood/src/aicerber.cpp b/source/games/blood/src/aicerber.cpp index 0847f4c50..6c178be61 100644 --- a/source/games/blood/src/aicerber.cpp +++ b/source/games/blood/src/aicerber.cpp @@ -58,7 +58,7 @@ AISTATE cerberus1398AC = { kAiStateOther, 7, -1, 120, NULL, aiMoveTurn, NULL, &c static constexpr double Cerberus_XYOff = 350. / 16; static constexpr double Cerberus_ZOff = 100. / 256; -void cerberusBiteSeqCallback(int, DBloodActor* actor) +void cerberusBiteSeqCallback(DBloodActor* actor) { if (!(actor->IsDudeActor())) { Printf(PRINT_HIGH, "actor->IsDudeActor()"); @@ -75,7 +75,7 @@ void cerberusBiteSeqCallback(int, DBloodActor* actor) actFireVector(actor, 0, 0, vec, kVectorCerberusHack); } -void cerberusBurnSeqCallback(int, DBloodActor* actor) +void cerberusBurnSeqCallback(DBloodActor* actor) { DUDEINFO* pDudeInfo = getDudeInfo(actor); double height = pDudeInfo->eyeHeight * actor->spr.scale.Y * 0.25; @@ -136,7 +136,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor) } } -void cerberusBurnSeqCallback2(int, DBloodActor* actor) +void cerberusBurnSeqCallback2(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; DUDEINFO* pDudeInfo = getDudeInfo(actor); diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index bcc9d94d8..37239389b 100644 --- a/source/games/blood/src/aicult.cpp +++ b/source/games/blood/src/aicult.cpp @@ -73,7 +73,7 @@ AISTATE cultistTSwimFire = { kAiStateChase, 8, nTommyClient, 0, NULL, aiMoveTurn AISTATE cultistTsSwimFire = { kAiStateChase, 8, nTeslaClient, 0, NULL, aiMoveTurn, cultThinkChase, &cultistTsSwimFire }; AISTATE cultistSwimRecoil = { kAiStateRecoil, 5, -1, 0, NULL, NULL, NULL, &cultistSwimDodge }; -void TommySeqCallback(int, DBloodActor* actor) +void TommySeqCallback(DBloodActor* actor) { DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); vect.X += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14); @@ -83,7 +83,7 @@ void TommySeqCallback(int, DBloodActor* actor) sfxPlay3DSound(actor, 4001, -1, 0); } -void TeslaSeqCallback(int, DBloodActor* actor) +void TeslaSeqCallback(DBloodActor* actor) { if (Chance(gCultTeslaFireChance[gGameOptions.nDifficulty])) { @@ -96,7 +96,7 @@ void TeslaSeqCallback(int, DBloodActor* actor) } } -void ShotSeqCallback(int, DBloodActor* actor) +void ShotSeqCallback(DBloodActor* actor) { DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); vect.X += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14); @@ -115,7 +115,7 @@ void ShotSeqCallback(int, DBloodActor* actor) sfxPlay3DSound(actor, 1002, -1, 0); } -void cultThrowSeqCallback(int, DBloodActor* actor) +void cultThrowSeqCallback(DBloodActor* actor) { int nMissile = kThingArmedTNTStick; if (gGameOptions.nDifficulty > 2) @@ -137,7 +137,7 @@ void cultThrowSeqCallback(int, DBloodActor* actor) evPostActor(pMissile, 120 * (1 + Random(2)), kCmdOn, actor); } -void cultThrowSeqCallback2(int, DBloodActor* actor) +void cultThrowSeqCallback2(DBloodActor* actor) { int nMissile = kThingArmedTNTStick; if (gGameOptions.nDifficulty > 2) @@ -147,7 +147,7 @@ void cultThrowSeqCallback2(int, DBloodActor* actor) evPostActor(pMissile, 120 * (2 + Random(2)), kCmdOn, actor); } -void cultThrowSeqCallback3(int, DBloodActor* actor) +void cultThrowSeqCallback3(DBloodActor* actor) { int nMissile = kThingArmedTNTStick; if (gGameOptions.nDifficulty > 2) diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index 4bbf0ab3b..817383851 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -75,7 +75,7 @@ static void playStatueBreakSnd(DBloodActor* actor) { aiPlay3DSound(actor, 313, AI_SFX_PRIORITY_1, -1); } -void SlashFSeqCallback(int, DBloodActor* actor) +void SlashFSeqCallback(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -94,12 +94,12 @@ void SlashFSeqCallback(int, DBloodActor* actor) actFireVector(actor, 0, 0, vec + DVector2(r1, r2), kVectorGargSlash); } -void ThrowFSeqCallback(int, DBloodActor* actor) +void ThrowFSeqCallback(DBloodActor* actor) { actFireThing(actor, 0., 0., actor->dudeSlope * 0.25 - 0.11444, kThingBone, 0xeeeee / 65536.); } -void BlastSSeqCallback(int, DBloodActor* actor) +void BlastSSeqCallback(DBloodActor* actor) { wrand(); // ??? if (!actor->ValidateTarget(__FUNCTION__)) return; @@ -168,7 +168,7 @@ void BlastSSeqCallback(int, DBloodActor* actor) } -void ThrowSSeqCallback(int, DBloodActor* actor) +void ThrowSSeqCallback(DBloodActor* actor) { actFireThing(actor, 0., 0., actor->dudeSlope * 0.25 - 0.11444, kThingBone, Chance(0x6000) ? 19.2 : 17.066666); } diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index ea296909b..122b5aa6a 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -60,7 +60,7 @@ AISTATE ghostDodgeDown = { kAiStateMove, 0, -1, 120, NULL, ghostMoveDodgeDown, N AISTATE ghostDodgeDownRight = { kAiStateMove, 0, -1, 90, NULL, ghostMoveDodgeDown, NULL, &ghostChase }; AISTATE ghostDodgeDownLeft = { kAiStateMove, 0, -1, 90, NULL, ghostMoveDodgeDown, NULL, &ghostChase }; -void ghostSlashSeqCallback(int, DBloodActor* actor) +void ghostSlashSeqCallback(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -80,13 +80,13 @@ void ghostSlashSeqCallback(int, DBloodActor* actor) actFireVector(actor, 0, 0, dv + DVector2(-r2, r1), kVectorGhost); } -void ghostThrowSeqCallback(int, DBloodActor* actor) +void ghostThrowSeqCallback(DBloodActor* actor) { actFireThing(actor, 0., 0., actor->dudeSlope * 0.25 - 0.11444, kThingBone, 14.93333); } // This functions seems to be identical with BlastSSeqCallback except for the spawn calls at the end. -void ghostBlastSeqCallback(int, DBloodActor* actor) +void ghostBlastSeqCallback(DBloodActor* actor) { wrand(); // ??? if (!actor->ValidateTarget(__FUNCTION__)) return; diff --git a/source/games/blood/src/aigilbst.cpp b/source/games/blood/src/aigilbst.cpp index f57cb4c77..9ae280dcb 100644 --- a/source/games/blood/src/aigilbst.cpp +++ b/source/games/blood/src/aigilbst.cpp @@ -57,7 +57,7 @@ AISTATE gillBeast13A138 = { kAiStateOther, 10, -1, 120, NULL, sub_6CD74, gillThi AISTATE gillBeast13A154 = { kAiStateOther, 10, -1, 0, NULL, sub_6D03C, gillThinkSwimChase, &gillBeastSwimChase }; AISTATE gillBeast13A170 = { kAiStateOther, 10, -1, 120, NULL, NULL, aiMoveTurn, &gillBeastSwimChase }; -void GillBiteSeqCallback(int, DBloodActor* actor) +void GillBiteSeqCallback(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aihand.cpp b/source/games/blood/src/aihand.cpp index c16aa0a3b..3e630364c 100644 --- a/source/games/blood/src/aihand.cpp +++ b/source/games/blood/src/aihand.cpp @@ -41,7 +41,7 @@ AISTATE handRecoil = { kAiStateRecoil, 5, -1, 0, NULL, NULL, NULL, &handSearch } AISTATE handGoto = { kAiStateMove, 6, -1, 1800, NULL, aiMoveForward, handThinkGoto, &handIdle }; AISTATE handJump = { kAiStateChase, 7, nJumpClient, 120, NULL, NULL, NULL, &handChase }; -void HandJumpSeqCallback(int, DBloodActor* actor) +void HandJumpSeqCallback(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aihound.cpp b/source/games/blood/src/aihound.cpp index afed0c116..cdd8d6523 100644 --- a/source/games/blood/src/aihound.cpp +++ b/source/games/blood/src/aihound.cpp @@ -42,7 +42,7 @@ AISTATE houndGoto = { kAiStateMove, 8, -1, 600, NULL, aiMoveForward, houndThinkG AISTATE houndBite = { kAiStateChase, 6, nHoundBiteClient, 60, NULL, NULL, NULL, &houndChase }; AISTATE houndBurn = { kAiStateChase, 7, nHoundBurnClient, 60, NULL, NULL, NULL, &houndChase }; -void houndBiteSeqCallback(int, DBloodActor* actor) +void houndBiteSeqCallback(DBloodActor* actor) { if (!(actor->IsDudeActor())) { Printf(PRINT_HIGH, "actor->IsDudeActor()"); @@ -56,7 +56,7 @@ void houndBiteSeqCallback(int, DBloodActor* actor) actFireVector(actor, 0, 0, vec, kVectorHoundBite); } -void houndBurnSeqCallback(int, DBloodActor* actor) +void houndBurnSeqCallback(DBloodActor* actor) { actFireMissile(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), 0), kMissileFlameHound); } diff --git a/source/games/blood/src/aipod.cpp b/source/games/blood/src/aipod.cpp index 566f645a9..fc00d89b6 100644 --- a/source/games/blood/src/aipod.cpp +++ b/source/games/blood/src/aipod.cpp @@ -50,17 +50,17 @@ AISTATE tentacleStartChase = { kAiStateOther, 6, nTentacleStartSearchClient, 120 AISTATE tentacleRecoil = { kAiStateRecoil, 5, -1, 0, NULL, NULL, NULL, &tentacleChase }; AISTATE tentacleChase = { kAiStateChase, 6, -1, 0, NULL, aiMoveTurn, aiPodChase, NULL }; -void sub_6FF08(int, DBloodActor* actor) +void podPlaySound1(DBloodActor* actor) { sfxPlay3DSound(actor, 2503, -1, 0); } -void sub_6FF54(int, DBloodActor* actor) +void podPlaySound2(DBloodActor* actor) { sfxPlay3DSound(actor, 2500, -1, 0); } -void podAttack(int, DBloodActor* actor) +void podAttack(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -101,7 +101,7 @@ void podAttack(int, DBloodActor* actor) fxSpawnPodStuff(actor, 240); } -void sub_70284(int, DBloodActor* actor) +void podExplode(DBloodActor* actor) { sfxPlay3DSound(actor, 2502, -1, 0); int nDist, nBurn; diff --git a/source/games/blood/src/airat.cpp b/source/games/blood/src/airat.cpp index c82011be9..81362988e 100644 --- a/source/games/blood/src/airat.cpp +++ b/source/games/blood/src/airat.cpp @@ -41,7 +41,7 @@ AISTATE ratRecoil = { kAiStateRecoil, 7, -1, 0, NULL, NULL, NULL, &ratDodge }; AISTATE ratGoto = { kAiStateMove, 7, -1, 600, NULL, aiMoveForward, ratThinkGoto, &ratIdle }; AISTATE ratBite = { kAiStateChase, 6, nRatBiteClient, 120, NULL, NULL, NULL, &ratChase }; -void ratBiteSeqCallback(int, DBloodActor* actor) +void ratBiteSeqCallback(DBloodActor* actor) { assert(actor->IsDudeActor()); if (!actor->ValidateTarget(__FUNCTION__)) return; diff --git a/source/games/blood/src/aispid.cpp b/source/games/blood/src/aispid.cpp index 8dcdf6ba8..2279c183c 100644 --- a/source/games/blood/src/aispid.cpp +++ b/source/games/blood/src/aispid.cpp @@ -57,7 +57,7 @@ static void spidBlindEffect(DBloodActor* actor, int nBlind, int max) } } -void SpidBiteSeqCallback(int, DBloodActor* actor) +void SpidBiteSeqCallback(DBloodActor* actor) { DVector3 vec(actor->spr.Angles.Yaw.ToVector(), 0); @@ -105,7 +105,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) } } -void SpidJumpSeqCallback(int, DBloodActor* actor) +void SpidJumpSeqCallback(DBloodActor* actor) { DVector3 vec(actor->spr.Angles.Yaw.ToVector(), 0); @@ -129,7 +129,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor) } } -void SpidBirthSeqCallback(int, DBloodActor* actor) +void SpidBirthSeqCallback(DBloodActor* actor) { assert(actor->IsDudeActor()); DUDEINFO* pDudeInfo = getDudeInfo(actor); diff --git a/source/games/blood/src/aitchern.cpp b/source/games/blood/src/aitchern.cpp index c85bfa4b2..1d6006179 100644 --- a/source/games/blood/src/aitchern.cpp +++ b/source/games/blood/src/aitchern.cpp @@ -47,7 +47,7 @@ AISTATE tcherno13AA28 = { kAiStateChase, 8, -1, 60, NULL, aiMoveTurn, NULL, &tch static constexpr double Tchernnobog_XYOff = 350. / 16; -void sub_71A90(int, DBloodActor* actor) +void tchernobogFire(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -58,7 +58,7 @@ void sub_71A90(int, DBloodActor* actor) aiNewState(actor, &tcherno13A9D4); } -void tchernobogBurnSeqCallback(int, DBloodActor* actor) +void tchernobogBurnSeqCallback(DBloodActor* actor) { DUDEINFO* pDudeInfo = getDudeInfo(actor); double height = actor->spr.scale.Y * pDudeInfo->eyeHeight * 0.25; @@ -115,7 +115,7 @@ void tchernobogBurnSeqCallback(int, DBloodActor* actor) actFireMissile(actor, Tchernnobog_XYOff, 0., Aim, kMissileFireballTchernobog); } -void tchernobogBurnSeqCallback2(int, DBloodActor* actor) +void tchernobogBurnSeqCallback2(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index a8299f672..442eba990 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -113,7 +113,7 @@ const GENDUDESND gCustomDudeSnd[] = { static void forcePunch(DBloodActor* actor) { if (actor->genDudeExtra.forcePunch && seqGetStatus(actor) == -1) - punchCallback(0, actor); + punchCallback(actor); } //--------------------------------------------------------------------------- @@ -181,7 +181,7 @@ void genDudeUpdate(DBloodActor* actor) // //--------------------------------------------------------------------------- -void punchCallback(int, DBloodActor* actor) +void punchCallback(DBloodActor* actor) { auto const target = actor->GetTarget(); if (target != nullptr) @@ -206,7 +206,7 @@ void punchCallback(int, DBloodActor* actor) // //--------------------------------------------------------------------------- -void genDudeAttack1(int, DBloodActor* actor) +void genDudeAttack1(DBloodActor* actor) { if (actor->GetTarget() == nullptr) return; @@ -278,12 +278,12 @@ void genDudeAttack1(int, DBloodActor* actor) // //--------------------------------------------------------------------------- -void ThrowCallback1(int, DBloodActor* actor) +void ThrowCallback1(DBloodActor* actor) { ThrowThing(actor, true); } -void ThrowCallback2(int, DBloodActor* actor) +void ThrowCallback2(DBloodActor* actor) { ThrowThing(actor, false); } diff --git a/source/games/blood/src/aizomba.cpp b/source/games/blood/src/aizomba.cpp index a1ee2df79..6dad4381e 100644 --- a/source/games/blood/src/aizomba.cpp +++ b/source/games/blood/src/aizomba.cpp @@ -58,7 +58,7 @@ AISTATE zombie2Search = { kAiStateSearch, 8, -1, 1800, NULL, NULL, myThinkSearch AISTATE zombieSIdle = { kAiStateIdle, 10, -1, 0, NULL, NULL, aiThinkTarget, NULL }; AISTATE zombie13AC2C = { kAiStateOther, 11, nStandClient, 0, entryEZombie, NULL, NULL, &zombieAPonder }; -void HackSeqCallback(int, DBloodActor* actor) +void HackSeqCallback(DBloodActor* actor) { auto target = actor->GetTarget(); if (!target) return; @@ -75,7 +75,7 @@ void HackSeqCallback(int, DBloodActor* actor) actFireVector(actor, 0, 0, dv, kVectorAxe); } -void StandSeqCallback(int, DBloodActor* actor) +void StandSeqCallback(DBloodActor* actor) { sfxPlay3DSound(actor, 1102, -1, 0); } diff --git a/source/games/blood/src/aizombf.cpp b/source/games/blood/src/aizombf.cpp index 2fbe7393b..fd4bf2a02 100644 --- a/source/games/blood/src/aizombf.cpp +++ b/source/games/blood/src/aizombf.cpp @@ -45,7 +45,7 @@ AISTATE zombieFSearch = { kAiStateSearch, 8, -1, 1800, NULL, aiMoveForward, zomb AISTATE zombieFRecoil = { kAiStateRecoil, 5, -1, 0, NULL, NULL, NULL, &zombieFChase }; AISTATE zombieFTeslaRecoil = { kAiStateRecoil, 4, -1, 0, NULL, NULL, NULL, &zombieFChase }; -void zombfHackSeqCallback(int, DBloodActor* actor) +void zombfHackSeqCallback(DBloodActor* actor) { if (actor->GetType() != kDudeZombieButcher) return; @@ -58,7 +58,7 @@ void zombfHackSeqCallback(int, DBloodActor* actor) actFireVector(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector() * 64, height - height2), kVectorCleaver); } -void PukeSeqCallback(int, DBloodActor* actor) +void PukeSeqCallback(DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -75,7 +75,7 @@ void PukeSeqCallback(int, DBloodActor* actor) actFireMissile(actor, 0, -z, DVector3(dv, 0), kMissilePukeGreen); } -void ThrowSeqCallback(int, DBloodActor* actor) +void ThrowSeqCallback(DBloodActor* actor) { actFireMissile(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), 0), kMissileButcherKnife); } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 8c86aa7c3..3ebc7f76c 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -5680,7 +5680,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event) // let's allow only specific commands here to avoid this. if (actor->spr.inittype < kDudeBase || actor->spr.inittype >= kDudeMax) return false; else if (event.cmd != kCmdToggle && event.cmd != kCmdOff && event.cmd != kCmdSpriteImpact) return true; - DudeToGibCallback1(0, actor); // set proper gib type just in case DATAs was changed from the outside. + DudeToGibCallback1(actor); // set proper gib type just in case DATAs was changed from the outside. return false; case kModernCondition: diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 7b0593acf..ae8fc1a43 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -2301,7 +2301,7 @@ void playerLandingSound(DBloodPlayer* pPlayer) // //--------------------------------------------------------------------------- -void PlayerSurvive(int, DBloodActor* actor) +void PlayerSurvive(DBloodActor* actor) { char buffer[80]; actHealDude(actor, 1, 2); @@ -2329,7 +2329,7 @@ void PlayerSurvive(int, DBloodActor* actor) // //--------------------------------------------------------------------------- -void PlayerKneelsOver(int, DBloodActor* actor) +void PlayerKneelsOver(DBloodActor* actor) { for (int p = connecthead; p >= 0; p = connectpoint2[p]) { diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index 5af9d8596..29d439335 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS -static void (*seqClientCallback[])(int, DBloodActor*) = { +static void (*seqClientCallback[])(DBloodActor*) = { FireballSeqCallback, Fx33Callback, NapalmSeqCallback, @@ -71,16 +71,16 @@ static void (*seqClientCallback[])(int, DBloodActor*) = { houndBiteSeqCallback, houndBurnSeqCallback, podAttack, - sub_70284, - sub_6FF08, - sub_6FF54, + podExplode, + podPlaySound1, + podPlaySound2, ratBiteSeqCallback, SpidBiteSeqCallback, SpidJumpSeqCallback, SpidBirthSeqCallback, tchernobogBurnSeqCallback, tchernobogBurnSeqCallback2, - sub_71A90, + tchernobogFire, genDudeAttack1, punchCallback, ThrowCallback1, @@ -402,7 +402,7 @@ void SEQINST::Update() if (pSequence->frames[frameIndex].trigger && callback != -1) { assert(type == SS_SPRITE); - if (target.isActor()) seqClientCallback[callback](type, target.actor()); + if (target.isActor()) seqClientCallback[callback](target.actor()); } } diff --git a/source/games/blood/src/seqcb.h b/source/games/blood/src/seqcb.h index 2bb92aa49..721a50a3f 100644 --- a/source/games/blood/src/seqcb.h +++ b/source/games/blood/src/seqcb.h @@ -3,64 +3,64 @@ BEGIN_BLD_NS class DBloodActor; -void FireballSeqCallback(int, DBloodActor*); -void Fx33Callback(int, DBloodActor*); -void NapalmSeqCallback(int, DBloodActor*); -void Fx32Callback(int, DBloodActor*); -void TreeToGibCallback(int, DBloodActor*); -void DudeToGibCallback1(int, DBloodActor*); -void DudeToGibCallback2(int, DBloodActor*); -void batBiteSeqCallback(int, DBloodActor*); -void SlashSeqCallback(int, DBloodActor*); -void StompSeqCallback(int, DBloodActor*); -void eelBiteSeqCallback(int, DBloodActor*); -void BurnSeqCallback(int, DBloodActor*); -void SeqAttackCallback(int, DBloodActor*); -void cerberusBiteSeqCallback(int, DBloodActor*); -void cerberusBurnSeqCallback(int, DBloodActor*); -void cerberusBurnSeqCallback2(int, DBloodActor*); -void TommySeqCallback(int, DBloodActor*); -void TeslaSeqCallback(int, DBloodActor*); -void ShotSeqCallback(int, DBloodActor*); -void cultThrowSeqCallback(int, DBloodActor*); -void cultThrowSeqCallback2(int, DBloodActor*); -void cultThrowSeqCallback3(int, DBloodActor*); -void SlashFSeqCallback(int, DBloodActor*); -void ThrowFSeqCallback(int, DBloodActor*); -void BlastSSeqCallback(int, DBloodActor*); -void ThrowSSeqCallback(int, DBloodActor*); -void ghostSlashSeqCallback(int, DBloodActor*); -void ghostThrowSeqCallback(int, DBloodActor*); -void ghostBlastSeqCallback(int, DBloodActor*); -void GillBiteSeqCallback(int, DBloodActor*); -void HandJumpSeqCallback(int, DBloodActor*); -void houndBiteSeqCallback(int, DBloodActor*); -void houndBurnSeqCallback(int, DBloodActor*); -void sub_6FF08(int, DBloodActor*); -void sub_6FF54(int, DBloodActor*); -void podAttack(int, DBloodActor*); -void sub_70284(int, DBloodActor*); -void ratBiteSeqCallback(int, DBloodActor*); -void SpidBiteSeqCallback(int, DBloodActor*); -void SpidJumpSeqCallback(int, DBloodActor*); -void SpidBirthSeqCallback(int, DBloodActor*); -void sub_71A90(int, DBloodActor*); -void tchernobogBurnSeqCallback(int, DBloodActor*); -void tchernobogBurnSeqCallback2(int, DBloodActor*); -void genDudeAttack1(int, DBloodActor*); -void punchCallback(int, DBloodActor*); -void ThrowCallback1(int, DBloodActor*); -void ThrowCallback2(int, DBloodActor*); -void HackSeqCallback(int, DBloodActor*); -void StandSeqCallback(int, DBloodActor*); -void zombfHackSeqCallback(int, DBloodActor*); -void PukeSeqCallback(int, DBloodActor*); -void ThrowSeqCallback(int, DBloodActor*); -void PlayerSurvive(int, DBloodActor*); -void PlayerKneelsOver(int, DBloodActor*); -void FireballTrapSeqCallback(int, DBloodActor*); -void MGunFireSeqCallback(int, DBloodActor*); -void MGunOpenSeqCallback(int, DBloodActor*); +void FireballSeqCallback(DBloodActor*); +void Fx33Callback(DBloodActor*); +void NapalmSeqCallback(DBloodActor*); +void Fx32Callback(DBloodActor*); +void TreeToGibCallback(DBloodActor*); +void DudeToGibCallback1(DBloodActor*); +void DudeToGibCallback2(DBloodActor*); +void batBiteSeqCallback(DBloodActor*); +void SlashSeqCallback(DBloodActor*); +void StompSeqCallback(DBloodActor*); +void eelBiteSeqCallback(DBloodActor*); +void BurnSeqCallback(DBloodActor*); +void SeqAttackCallback(DBloodActor*); +void cerberusBiteSeqCallback(DBloodActor*); +void cerberusBurnSeqCallback(DBloodActor*); +void cerberusBurnSeqCallback2(DBloodActor*); +void TommySeqCallback(DBloodActor*); +void TeslaSeqCallback(DBloodActor*); +void ShotSeqCallback(DBloodActor*); +void cultThrowSeqCallback(DBloodActor*); +void cultThrowSeqCallback2(DBloodActor*); +void cultThrowSeqCallback3(DBloodActor*); +void SlashFSeqCallback(DBloodActor*); +void ThrowFSeqCallback(DBloodActor*); +void BlastSSeqCallback(DBloodActor*); +void ThrowSSeqCallback(DBloodActor*); +void ghostSlashSeqCallback(DBloodActor*); +void ghostThrowSeqCallback(DBloodActor*); +void ghostBlastSeqCallback(DBloodActor*); +void GillBiteSeqCallback(DBloodActor*); +void HandJumpSeqCallback(DBloodActor*); +void houndBiteSeqCallback(DBloodActor*); +void houndBurnSeqCallback(DBloodActor*); +void podPlaySound1(DBloodActor*); +void podPlaySound2(DBloodActor*); +void podAttack(DBloodActor*); +void podExplode(DBloodActor*); +void ratBiteSeqCallback(DBloodActor*); +void SpidBiteSeqCallback(DBloodActor*); +void SpidJumpSeqCallback(DBloodActor*); +void SpidBirthSeqCallback(DBloodActor*); +void tchernobogFire(DBloodActor*); +void tchernobogBurnSeqCallback(DBloodActor*); +void tchernobogBurnSeqCallback2(DBloodActor*); +void genDudeAttack1(DBloodActor*); +void punchCallback(DBloodActor*); +void ThrowCallback1(DBloodActor*); +void ThrowCallback2(DBloodActor*); +void HackSeqCallback(DBloodActor*); +void StandSeqCallback(DBloodActor*); +void zombfHackSeqCallback(DBloodActor*); +void PukeSeqCallback(DBloodActor*); +void ThrowSeqCallback(DBloodActor*); +void PlayerSurvive(DBloodActor*); +void PlayerKneelsOver(DBloodActor*); +void FireballTrapSeqCallback(DBloodActor*); +void MGunFireSeqCallback(DBloodActor*); +void MGunOpenSeqCallback(DBloodActor*); enum { diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 3189afaa0..682c1c36e 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -2482,7 +2482,7 @@ void ActivateGenerator(DBloodActor* actor) case kGenMissileFireball: switch (actor->xspr.data2) { case 0: - FireballTrapSeqCallback(3, actor); + FireballTrapSeqCallback(actor); break; case 1: seqSpawn(35, actor, nFireballTrapClient); @@ -2510,7 +2510,7 @@ void ActivateGenerator(DBloodActor* actor) // //--------------------------------------------------------------------------- -void FireballTrapSeqCallback(int, DBloodActor* actor) +void FireballTrapSeqCallback(DBloodActor* actor) { if (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) actFireMissile(actor, 0, 0, DVector3(0, 0, (actor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 1 : -1), kMissileFireball); @@ -2525,7 +2525,7 @@ void FireballTrapSeqCallback(int, DBloodActor* actor) // //--------------------------------------------------------------------------- -void MGunFireSeqCallback(int, DBloodActor* actor) +void MGunFireSeqCallback(DBloodActor* actor) { if (actor->xspr.data2 > 0 || actor->xspr.data1 == 0) { @@ -2545,7 +2545,7 @@ void MGunFireSeqCallback(int, DBloodActor* actor) } } -void MGunOpenSeqCallback(int, DBloodActor* actor) +void MGunOpenSeqCallback(DBloodActor* actor) { seqSpawn(39, actor, nMGunFireClient); }