add skeleton unregistration to actors that manage their own skeletons (#2908)

This commit is contained in:
Rozelette
2023-05-22 09:20:06 -04:00
committed by GitHub
parent 7962e0e6d6
commit f005bd3b7f
126 changed files with 279 additions and 14 deletions
@@ -109,7 +109,9 @@ void BgDyYoseizo_Init(Actor* thisx, PlayState* play2) {
this->actionFunc = BgDyYoseizo_CheckMagicAcquired;
}
void BgDyYoseizo_Destroy(Actor* this, PlayState* play) {
void BgDyYoseizo_Destroy(Actor* thisx, PlayState* play) {
BgDyYoseizo* this = (BgDyYoseizo*)thisx;
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
static Color_RGB8 sParticlePrimColors[] = {
@@ -346,6 +346,8 @@ void BossSst_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyJntSph(play, &this->colliderJntSph);
Collider_DestroyCylinder(play, &this->colliderCyl);
Audio_StopSfxByPos(&this->center);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void BossSst_HeadSetupLurk(BossSst* this) {
@@ -24,6 +24,9 @@ void DemoIk_Type1Draw(DemoIk* this, PlayState* play);
void DemoIk_Type2Draw(DemoIk* this, PlayState* play);
void DemoIk_Destroy(Actor* thisx, PlayState* play) {
DemoIk* this = (DemoIk*)thisx;
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void DemoIk_BgCheck(DemoIk* this, PlayState* play) {
@@ -1163,7 +1163,10 @@ void DemoIm_Init(Actor* thisx, PlayState* play) {
}
void DemoIm_Destroy(Actor* thisx, PlayState* play) {
DemoIm* this = (DemoIm*)thisx;
DemoIm_DestroyCollider(thisx, play);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
s32 DemoIm_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
@@ -203,6 +203,8 @@ void DoorKiller_Destroy(Actor* thisx, PlayState* play) {
if ((thisx->params & 0xFF) == DOOR_KILLER_DOOR) {
Collider_DestroyCylinder(play, &this->colliderCylinder);
Collider_DestroyJntSph(play, &this->colliderJntSph);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
}
@@ -97,7 +97,16 @@ void DoorWarp1_Destroy(Actor* thisx, PlayState* play) {
play->envCtx.adjAmbientColor[i] = play->envCtx.adjFogColor[i] = play->envCtx.adjLight1Color[i] =
0;
}
//! @bug SkelAnime_Free is not called for crystal variants
switch (this->actor.params) {
case WARP_DUNGEON_ADULT:
case WARP_BLUE_CRYSTAL:
case WARP_PURPLE_CRYSTAL:
SkelAnime_Free(&this->skelAnime, play);
break;
default:
break;
}
}
void DoorWarp1_SetupWarp(DoorWarp1* this, PlayState* play) {
@@ -249,6 +249,8 @@ void EnAm_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->hurtCollider);
Collider_DestroyCylinder(play, &this->blockCollider);
//! @bug Quad collider is not destroyed (though destroy doesnt really do anything anyway)
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void EnAm_SpawnEffects(EnAm* this, PlayState* play) {
@@ -95,6 +95,8 @@ void EnAni_Destroy(Actor* thisx, PlayState* play) {
EnAni* this = (EnAni*)thisx;
Collider_DestroyCylinder(play, &this->collider);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
s32 EnAni_SetText(EnAni* this, PlayState* play, u16 textId) {
@@ -167,6 +167,8 @@ void EnAnubice_Destroy(Actor* thisx, PlayState* play) {
tag->anubis = NULL;
}
}
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void EnAnubice_FindFlameCircles(EnAnubice* this, PlayState* play) {
@@ -68,6 +68,8 @@ void EnAttackNiw_Destroy(Actor* thisx, PlayState* play) {
cucco->unk_296--;
}
}
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809B5268(EnAttackNiw* this, PlayState* play, s16 arg2) {
@@ -403,6 +403,8 @@ void EnBb_Destroy(Actor* thisx, PlayState* play) {
EnBb* this = (EnBb*)thisx;
Collider_DestroyJntSph(play, &this->collider);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void EnBb_SetupFlameTrail(EnBb* this) {
@@ -196,6 +196,8 @@ void EnBigokuta_Destroy(Actor* thisx, PlayState* play) {
for (i = 0; i < ARRAY_COUNT(this->cylinder); i++) {
Collider_DestroyCylinder(play, &this->cylinder[i]);
}
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809BCE3C(EnBigokuta* this) {
@@ -136,6 +136,8 @@ void EnBili_Destroy(Actor* thisx, PlayState* play) {
EnBili* this = (EnBili*)thisx;
Collider_DestroyCylinder(play, &this->collider);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
// Setup Action Functions
@@ -62,6 +62,9 @@ void EnBird_Init(Actor* thisx, PlayState* play) {
}
void EnBird_Destroy(Actor* thisx, PlayState* play) {
EnBird* this = (EnBird*)thisx;
SkelAnime_Free(&this->skelAnime, play);
}
void func_809C1CAC(EnBird* this, s16 params) {
@@ -89,6 +89,9 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) {
}
void EnBomBowlMan_Destroy(Actor* thisx, PlayState* play) {
EnBomBowlMan* this = (EnBomBowlMan*)thisx;
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void EnBomBowMan_SetupWaitAsleep(EnBomBowlMan* this, PlayState* play) {
@@ -208,6 +208,8 @@ void EnBox_Destroy(Actor* thisx, PlayState* play) {
EnBox* this = (EnBox*)thisx;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
ResourceMgr_UnregisterSkeleton(&this->skelanime);
}
void EnBox_RandomDustKinematic(EnBox* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel) {
@@ -102,6 +102,8 @@ void EnBrob_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
Collider_DestroyCylinder(play, &this->colliders[0]);
Collider_DestroyCylinder(play, &this->colliders[1]);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809CADDC(EnBrob* this, PlayState* play) {
@@ -180,6 +180,8 @@ void EnButte_Destroy(Actor* thisx, PlayState* play2) {
EnButte* this = (EnButte*)thisx;
Collider_DestroyJntSph(play, &this->collider);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809CD56C(EnButte* this) {
@@ -161,6 +161,8 @@ void EnBw_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider1);
Collider_DestroyCylinder(play, &this->collider2);
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809CE884(EnBw* this, PlayState* play) {
@@ -162,6 +162,8 @@ void EnCow_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->colliders[0]);
Collider_DestroyCylinder(play, &this->colliders[1]);
}
ResourceMgr_UnregisterSkeleton(&this->skelAnime);
}
void func_809DF494(EnCow* this, PlayState* play) {

Some files were not shown because too many files have changed in this diff Show More