From d50962f22d5228aecfd6d6f3946159b98dd94253 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Tue, 3 Jun 2025 11:07:14 +0200 Subject: [PATCH] Use `ARRAY_COUNT` for `Skelanime_Init(Flex)`'s table length argument --- include/z64animation.h | 4 ++-- src/code/z_skelanime.c | 8 ++++---- src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c | 5 +++-- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 3 ++- src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c | 6 ++++-- src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 4 +++- src/overlays/actors/ovl_Door_Killer/z_door_killer.c | 3 ++- src/overlays/actors/ovl_En_Am/z_en_am.c | 4 +++- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 3 ++- src/overlays/actors/ovl_En_Anubice/z_en_anubice.c | 2 +- src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c | 4 +++- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 3 ++- src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c | 2 +- src/overlays/actors/ovl_En_Bili/z_en_bili.c | 3 ++- .../actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 3 ++- src/overlays/actors/ovl_En_Box/z_en_box.c | 3 ++- src/overlays/actors/ovl_En_Brob/z_en_brob.c | 4 +++- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 4 +++- src/overlays/actors/ovl_En_Bw/z_en_bw.c | 3 ++- src/overlays/actors/ovl_En_Cow/z_en_cow.c | 5 +++-- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 4 +++- src/overlays/actors/ovl_En_Cs/z_en_cs.c | 4 +++- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 4 +++- .../actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c | 4 +++- src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c | 2 +- src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c | 3 ++- src/overlays/actors/ovl_En_Dh/z_en_dh.c | 3 ++- src/overlays/actors/ovl_En_Dha/z_en_dha.c | 3 ++- src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c | 4 +++- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 3 ++- src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c | 4 +++- src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c | 3 ++- src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c | 3 ++- src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c | 4 +++- src/overlays/actors/ovl_En_Dog/z_en_dog.c | 4 +++- src/overlays/actors/ovl_En_Door/z_en_door.c | 2 +- src/overlays/actors/ovl_En_Ds/z_en_ds.c | 3 ++- src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c | 4 +++- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 4 +++- src/overlays/actors/ovl_En_Fd/z_en_fd.c | 4 +++- src/overlays/actors/ovl_En_Firefly/z_en_firefly.c | 4 +++- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 4 +++- src/overlays/actors/ovl_En_Floormas/z_en_floormas.c | 3 ++- src/overlays/actors/ovl_En_Fr/z_en_fr.c | 4 ++-- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 3 ++- src/overlays/actors/ovl_En_Fw/z_en_fw.c | 4 +++- src/overlays/actors/ovl_En_Gb/z_en_gb.c | 2 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 3 ++- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 4 +++- src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 3 ++- src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 3 ++- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 4 +++- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 3 ++- src/overlays/actors/ovl_En_Goma/z_en_goma.c | 3 ++- src/overlays/actors/ovl_En_Guest/z_en_guest.c | 4 +++- src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c | 3 ++- src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c | 3 ++- src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c | 4 +++- src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c | 5 +++-- src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c | 3 ++- src/overlays/actors/ovl_En_Hs/z_en_hs.c | 3 ++- src/overlays/actors/ovl_En_Hs2/z_en_hs2.c | 3 ++- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 3 ++- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 4 ++-- src/overlays/actors/ovl_En_In/z_en_in.c | 3 ++- src/overlays/actors/ovl_En_Insect/z_en_insect.c | 4 +++- src/overlays/actors/ovl_En_Jj/z_en_jj.c | 3 ++- src/overlays/actors/ovl_En_Js/z_en_js.c | 3 ++- src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c | 3 ++- src/overlays/actors/ovl_En_Ko/z_en_ko.c | 3 ++- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 4 +++- src/overlays/actors/ovl_En_Mb/z_en_mb.c | 7 ++++--- src/overlays/actors/ovl_En_Md/z_en_md.c | 4 +++- src/overlays/actors/ovl_En_Mk/z_en_mk.c | 3 ++- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 4 +++- src/overlays/actors/ovl_En_Mm2/z_en_mm2.c | 4 +++- src/overlays/actors/ovl_En_Ms/z_en_ms.c | 3 ++- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 3 ++- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 3 ++- src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c | 4 +++- src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 4 +++- src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 3 ++- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 6 ++++-- src/overlays/actors/ovl_En_Peehat/z_en_peehat.c | 4 +++- src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c | 4 +++- src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c | 4 +++- src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c | 4 +++- src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c | 2 +- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 4 +++- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 5 +++-- src/overlays/actors/ovl_En_Reeba/z_en_reeba.c | 3 ++- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 3 ++- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 3 ++- src/overlays/actors/ovl_En_Sa/z_en_sa.c | 4 +++- src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c | 3 ++- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 3 ++- src/overlays/actors/ovl_En_Skj/z_en_skj.c | 3 ++- src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 3 ++- src/overlays/actors/ovl_En_St/z_en_st.c | 3 ++- src/overlays/actors/ovl_En_Sth/z_en_sth.c | 3 ++- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 4 +++- src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c | 3 ++- src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c | 4 +++- src/overlays/actors/ovl_En_Ta/z_en_ta.c | 2 +- src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c | 3 ++- src/overlays/actors/ovl_En_Test/z_en_test.c | 5 +++-- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 3 ++- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 3 ++- src/overlays/actors/ovl_En_Toryo/z_en_toryo.c | 4 +++- src/overlays/actors/ovl_En_Tr/z_en_tr.c | 5 +++-- src/overlays/actors/ovl_En_Vali/z_en_vali.c | 3 ++- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 4 +++- src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c | 3 ++- src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c | 4 +++- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 4 ++-- src/overlays/actors/ovl_En_Zf/z_en_zf.c | 4 ++-- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 3 ++- src/overlays/actors/ovl_En_Zl4/z_en_zl4.c | 4 +++- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 3 ++- 119 files changed, 287 insertions(+), 137 deletions(-) diff --git a/include/z64animation.h b/include/z64animation.h index a085da5ddd..b1d3b7e8ff 100644 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -184,9 +184,9 @@ typedef struct SkelAnime { // Init BAD_RETURN(s32) SkelAnime_Init(struct PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 tableLength); BAD_RETURN(s32) SkelAnime_InitFlex(struct PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 tableLength); BAD_RETURN(s32) SkelAnime_InitSkin(struct PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation); diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 4e4fd97e9a..ef16e40c56 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1440,7 +1440,7 @@ s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 frame) { * Initializes a normal skeleton to a looping animation, dynamically allocating the frame tables if not provided. */ BAD_RETURN(s32) SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 tableLength) { SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->limbCount + 1; @@ -1451,7 +1451,7 @@ BAD_RETURN(s32) SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHe skelAnime->morphTable = ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 2969); } else { - ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 2973); + ASSERT(tableLength == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 2973); skelAnime->jointTable = jointTable; skelAnime->morphTable = morphTable; } @@ -1470,7 +1470,7 @@ BAD_RETURN(s32) SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHe * Initializes a flex skeleton to a looping animation, dynamically allocating the frame tables if not given. */ BAD_RETURN(s32) SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 tableLength) { FlexSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->sh.limbCount + 1; @@ -1484,7 +1484,7 @@ BAD_RETURN(s32) SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSk skelAnime->morphTable = ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3048); } else { - ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 3052); + ASSERT(tableLength == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 3052); skelAnime->jointTable = jointTable; skelAnime->morphTable = morphTable; } diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 006deb893e..91ae81918a 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" @@ -106,7 +107,7 @@ void BgDyYoseizo_Init(Actor* thisx, PlayState* play2) { if (play->sceneId == SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ " T("大妖精の泉", "Great Fairy Fountain") " ☆☆☆☆☆ %d\n" VT_RST, play->spawn); SkelAnime_InitFlex(play, &this->skelAnime, &gGreatFairySkel, &gGreatFairySittingTransitionAnim, - this->jointTable, this->morphTable, 28); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); #if OOT_VERSION < NTSC_1_1 if (!gSaveContext.save.info.playerData.isMagicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) { Actor_Kill(&this->actor); @@ -116,7 +117,7 @@ void BgDyYoseizo_Init(Actor* thisx, PlayState* play2) { } else { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ " T("石妖精の泉", "Stone Fairy Fountain") " ☆☆☆☆☆ %d\n" VT_RST, play->spawn); SkelAnime_InitFlex(play, &this->skelAnime, &gGreatFairySkel, &gGreatFairyLayingDownTransitionAnim, - this->jointTable, this->morphTable, 28); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); #if OOT_VERSION < NTSC_1_1 if (!gSaveContext.save.info.playerData.isMagicAcquired) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 89ba5fab34..dc7592ae6e 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -303,7 +304,7 @@ void BossSst_Init(Actor* thisx, PlayState* play2) { sFloor = (BgSstFloor*)Actor_Spawn(&play->actorCtx, play, ACTOR_BG_SST_FLOOR, sRoomCenter.x, sRoomCenter.y, sRoomCenter.z, 0, 0, 0, BONGOFLOOR_REST); SkelAnime_InitFlex(play, &this->skelAnime, &gBongoHeadSkel, &gBongoHeadEyeOpenIdleAnim, this->jointTable, - this->morphTable, 45); + this->morphTable, ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 70000.0f, ActorShadow_DrawCircle, 95.0f); Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInitHead, this->colliderJntSphElements); Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInitHead); diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index a5dff0d4a3..46b78fa548 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -193,7 +193,8 @@ void DemoIk_Type1Init(DemoIk* this, PlayState* play) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, phi_f0); //! @bug Flex skeleton is used as normal skeleton - SkelAnime_Init(play, &this->skelAnime, (SkeletonHeader*)skeleton, NULL, this->jointTable, this->morphTable, 2); + SkelAnime_Init(play, &this->skelAnime, (SkeletonHeader*)skeleton, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE, 0.0f); } @@ -329,7 +330,8 @@ void DemoIk_Type2Init(DemoIk* this, PlayState* play) { animation = &object_ik_Anim_0008DC; } - SkelAnime_InitFlex(play, &this->skelAnime, skeleton, NULL, this->jointTable, this->morphTable, 2); + SkelAnime_InitFlex(play, &this->skelAnime, skeleton, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE, 0.0f); this->actionMode = 3; this->drawMode = 0; diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 508128f7be..a3e4904584 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -1140,7 +1141,8 @@ void DemoIm_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); DemoIm_InitCollider(thisx, play); - SkelAnime_InitFlex(play, &this->skelAnime, &gImpaSkel, NULL, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(play, &this->skelAnime, &gImpaSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; switch (this->actor.params) { diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 15d92cb18a..2bebca0e16 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -6,6 +6,7 @@ #include "z_door_killer.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -138,7 +139,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { // `jointTable` is used for both the `jointTable` and `morphTable` args here. Because this actor doesn't // play any animations it does not cause problems, but it would need to be changed otherwise. SkelAnime_InitFlex(play, &this->skelAnime, &object_door_killer_Skel_001BC8, NULL, this->jointTable, - this->jointTable, 9); + this->jointTable, ARRAY_COUNT(this->jointTable)); this->actionFunc = DoorKiller_WaitForObject; DoorKiller_WaitForObject(this, play); diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 3f7649ea7e..5414dfce24 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -226,7 +227,8 @@ void EnAm_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 48.0f); - SkelAnime_Init(play, &this->skelAnime, &gArmosSkel, &gArmosRicochetAnim, this->jointTable, this->morphTable, 14); + SkelAnime_Init(play, &this->skelAnime, &gArmosSkel, &gArmosRicochetAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Actor_SetScale(&this->dyna.actor, 0.01f); DynaPolyActor_Init(&this->dyna, 0); Collider_InitCylinder(play, &this->hurtCollider); diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 8bfcc38fac..c6377658e3 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -6,6 +6,7 @@ #include "z_en_ani.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -86,7 +87,7 @@ void EnAni_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gRoofManSkel, &gRoofManIdleAnim, this->jointTable, this->morphTable, - 0x10); + ARRAY_COUNT(this->jointTable)); Animation_PlayOnce(&this->skelAnime, &gRoofManIdleAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index a37aae8954..a18cc0bed5 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -145,7 +145,7 @@ void EnAnubice_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); SkelAnime_Init(play, &this->skelAnime, &gAnubiceSkel, &gAnubiceIdleAnim, this->jointTable, this->morphTable, - ANUBICE_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); PRINTF("\n\n"); PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ アヌビス発生 ☆☆☆☆☆ \n", "☆☆☆☆☆ Anubis occurrence ☆☆☆☆☆ \n") VT_RST); diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 4a3a32663a..620eb3702d 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -56,7 +57,8 @@ void EnAttackNiw_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); if (this->actor.params < 0) { this->actor.params = 0; } diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 18dad81519..2a2dc4e429 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -7,6 +7,7 @@ #include "z_en_bb.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -331,7 +332,7 @@ void EnBb_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); SkelAnime_Init(play, &this->skelAnime, &object_Bb_Skel_001A30, &object_Bb_Anim_000444, this->jointTable, - this->morphTable, 16); + this->morphTable, ARRAY_COUNT(this->jointTable)); this->unk_254 = 0; thisx->colChkInfo.health = 4; Collider_InitJntSph(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 4243bbdf79..efafd61c2c 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -180,7 +180,7 @@ void EnBigokuta_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(play, &this->skelAnime, &object_bigokuta_Skel_006BC0, &object_bigokuta_Anim_0014B8, - this->jointTable, this->morphTable, 20); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 82f7b62796..84ad726433 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -7,6 +7,7 @@ #include "z_en_bili.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -134,7 +135,7 @@ void EnBili_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 17.0f); this->actor.shape.shadowAlpha = 155; SkelAnime_Init(play, &this->skelAnime, &gBiriSkel, &gBiriDefaultAnim, this->jointTable, this->morphTable, - EN_BILI_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 435b0d4838..fc895f1665 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -1,6 +1,7 @@ #include "z_en_bom_bowl_man.h" #include "overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" @@ -73,7 +74,7 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gChuGirlSkel, &gChuGirlNoddingOffAnim, this->jointTable, - this->morphTable, 11); + this->morphTable, ARRAY_COUNT(this->jointTable)); PRINTF(VT_FGCOL(GREEN) T("☆ もー 肩こっちゃうよねぇ〜 \t\t ☆ \n", "☆ Man, my shoulders hurt~ \t\t ☆ \n") VT_RST); PRINTF(VT_FGCOL(GREEN) T("☆ もっとラクしてもうかるバイトないかしら? ☆ %d\n", "☆ Isn't there some sort of job that will pay better and be more relaxing? ☆ %d\n") VT_RST, diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index c4ef15919a..469b42d267 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -192,7 +193,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { //! @bug Flex skeleton is used as normal skeleton SkelAnime_Init(play, &this->skelanime, (SkeletonHeader*)&gTreasureChestSkel, anim, this->jointTable, - this->morphTable, 5); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_Change(&this->skelanime, anim, 1.5f, animFrameStart, endFrame, ANIMMODE_ONCE, 0.0f); switch (this->type) { diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index 436f4740c5..7e29280bad 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -7,6 +7,7 @@ #include "z_en_brob.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" @@ -70,7 +71,8 @@ void EnBrob_Init(Actor* thisx, PlayState* play) { EnBrob* this = (EnBrob*)thisx; CollisionHeader* colHeader = NULL; - SkelAnime_InitFlex(play, &this->skelAnime, &gBrobSkel, &gBrobMoveUpAnim, this->jointTable, this->morphTable, 10); + SkelAnime_InitFlex(play, &this->skelAnime, &gBrobSkel, &gBrobMoveUpAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&gBrobCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 2ec5e260f8..33cc1f609a 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -172,7 +173,8 @@ void EnButte_Init(Actor* thisx, PlayState* play) { this->actor.cullingVolumeScale = 200.0f; } - SkelAnime_Init(play, &this->skelAnime, &gButterflySkel, &gButterflyAnim, this->jointTable, this->morphTable, 8); + SkelAnime_Init(play, &this->skelAnime, &gButterflySkel, &gButterflyAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements); this->actor.colChkInfo.mass = 0; diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 0aad9cccae..3733a4708a 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -151,7 +152,7 @@ void EnBw_Init(Actor* thisx, PlayState* play) { this->actor.naviEnemyId = NAVI_ENEMY_TORCH_SLUG; this->actor.gravity = -2.0f; SkelAnime_Init(play, &this->skelAnime, &gTorchSlugSkel, &gTorchSlugEyestalkWaveAnim, this->jointTable, - this->morphTable, TORCH_SLUG_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 6; diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index d459c93f6f..d48638263f 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -6,6 +6,7 @@ #include "z_en_cow.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" @@ -128,7 +129,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { switch (COW_GET_TYPE(this)) { case COW_TYPE_BODY: SkelAnime_InitFlex(play, &this->skelAnime, &gCowBodySkel, NULL, this->jointTable, this->morphTable, - COW_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, &gCowBodyChewAnim); Collider_InitCylinder(play, &this->colliders[COW_COLLIDER_FRONT]); @@ -164,7 +165,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { case COW_TYPE_TAIL: SkelAnime_InitFlex(play, &this->skelAnime, &gCowTailSkel, NULL, this->jointTable, this->morphTable, - COW_TAIL_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, &gCowTailIdleAnim); this->actor.update = EnCow_UpdateTail; this->actor.draw = EnCow_DrawTail; diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 3ce86ff9d3..cf7a8f806e 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -1,5 +1,6 @@ #include "z_en_crow.h" +#include "array_count.h" #include "gfx_setupdl.h" #include "ichain.h" #include "rand.h" @@ -122,7 +123,8 @@ void EnCrow_Init(Actor* thisx, PlayState* play) { EnCrow* this = (EnCrow*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(play, &this->skelAnime, &gGuaySkel, &gGuayFlyAnim, this->jointTable, this->morphTable, 9); + SkelAnime_InitFlex(play, &this->skelAnime, &gGuaySkel, &gGuayFlyAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 8b74a6063e..96c3170767 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -2,6 +2,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" @@ -145,7 +146,8 @@ void EnCs_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gGraveyardKidSkel, NULL, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gGraveyardKidSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 98a09bb25e..eda6dc8282 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -3,6 +3,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" @@ -191,7 +192,8 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.z = 0; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_daiku_Skel_007958, NULL, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(play, &this->skelAnime, &object_daiku_Skel_007958, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); if (!noKill) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index f469d5626f..06c33a92b4 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -178,7 +179,8 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_daiku_Skel_007958, NULL, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(play, &this->skelAnime, &object_daiku_Skel_007958, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index df9b566f87..70774ef7b4 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -241,7 +241,7 @@ void EnDekubaba_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f); SkelAnime_Init(play, &this->skelAnime, &gDekuBabaSkel, &gDekuBabaFastChompAnim, this->jointTable, this->morphTable, - 8); + ARRAY_COUNT(this->jointTable)); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index cf498eb726..f2d5bb8f9f 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -7,6 +7,7 @@ #include "z_en_dekunuts.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" +#include "array_count.h" #include "ichain.h" #include "sfx.h" #include "sys_matrix.h" @@ -124,7 +125,7 @@ void EnDekunuts_Init(Actor* thisx, PlayState* play) { } else { ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 35.0f); SkelAnime_Init(play, &this->skelAnime, &gDekuNutsSkel, &gDekuNutsStandAnim, this->jointTable, this->morphTable, - 25); + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 34acb2d982..d5c7e867dc 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -7,6 +7,7 @@ #include "z_en_dh.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -169,7 +170,7 @@ void EnDh_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.colChkInfo.damageTable = &D_809EC620; SkelAnime_InitFlex(play, &this->skelAnime, &object_dh_Skel_007E88, &object_dh_Anim_005880, this->jointTable, - this->limbRotTable, 16); + this->limbRotTable, ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 64.0f); this->actor.params = ENDH_WAIT_UNDERGROUND; this->actor.colChkInfo.mass = MASS_HEAVY; diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 5754d8ae1e..4f4896fc96 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Dh/z_en_dh.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -171,7 +172,7 @@ void EnDha_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.colChkInfo.damageTable = &sDamageTable; SkelAnime_InitFlex(play, &this->skelAnime, &object_dh_Skel_000BD8, &object_dh_Anim_0015B0, this->jointTable, - this->morphTable, 4); + this->morphTable, ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFeet, 90.0f); this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos.y += 50.0f; diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index 8cb2f45151..04df383dc9 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -98,7 +99,8 @@ void EnDivingGame_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -3.0f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, &gZoraIdleAnim, this->jointTable, this->morphTable, 20); + SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, &gZoraIdleAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 素もぐりGO ☆☆☆☆☆ \n" VT_RST); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 399f417aa1..384bb4fde3 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -6,6 +6,7 @@ #include "z_en_dns.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -162,7 +163,7 @@ void EnDns_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(play, &this->skelAnime, &gBusinessScrubSkel, &gBusinessScrubNervousTransitionAnim, - this->jointTable, this->morphTable, BUSINESS_SCRUB_LIMB_MAX); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index c89aa0d67f..64a275b100 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -9,6 +9,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" @@ -95,7 +96,8 @@ void EnDntJiji_Init(Actor* thisx, PlayState* play) { EnDntJiji* this = (EnDntJiji*)thisx; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); - SkelAnime_Init(play, &this->skelAnime, &gDntJijiSkel, &gDntJijiBurrowAnim, this->jointTable, this->morphTable, 13); + SkelAnime_Init(play, &this->skelAnime, &gDntJijiSkel, &gDntJijiBurrowAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->stage = (EnDntDemo*)this->actor.parent; diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index ab5a70d82f..97ed1bea8e 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -11,6 +11,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" @@ -203,7 +204,7 @@ void EnDntNomal_WaitForObject(EnDntNomal* this, PlayState* play) { this->actor.draw = EnDntNomal_DrawTargetScrub; } else { SkelAnime_Init(play, &this->skelAnime, &gDntStageSkel, &gDntStageHideAnim, this->jointTable, - this->morphTable, 11); + this->morphTable, ARRAY_COUNT(this->jointTable)); this->actor.draw = EnDntNomal_DrawStageScrub; } this->actionFunc = EnDntNomal_SetFlower; diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 1d967ed5fa..17e82b8499 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" @@ -82,7 +83,7 @@ void EnDodojr_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 18.0f); SkelAnime_Init(play, &this->skelAnime, &object_dodojr_Skel_0020E0, &object_dodojr_Anim_0009D4, this->jointTable, - this->morphTable, 15); + this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(4), &sColChkInit); diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 5d013911eb..6b7a7df8ff 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -3,6 +3,7 @@ #include "overlays/actors/ovl_En_Bombf/z_en_bombf.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -331,7 +332,8 @@ void EnDodongo_Init(Actor* thisx, PlayState* play) { this->bodyScale.x = this->bodyScale.y = this->bodyScale.z = 1.0f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 48.0f); Actor_SetScale(&this->actor, 0.01875f); - SkelAnime_Init(play, &this->skelAnime, &gDodongoSkel, &gDodongoWaitAnim, this->jointTable, this->morphTable, 31); + SkelAnime_Init(play, &this->skelAnime, &gDodongoSkel, &gDodongoWaitAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); this->actor.colChkInfo.health = 4; this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.damageTable = &sDamageTable; diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 0255b01626..a5c983fea0 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -6,6 +6,7 @@ #include "z_en_dog.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" @@ -253,7 +254,8 @@ void EnDog_Init(Actor* thisx, PlayState* play) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gDogSkel, NULL, this->jointTable, this->morphTable, 13); + SkelAnime_InitFlex(play, &this->skelAnime, &gDogSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDOG_ANIM_0); if (!PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 9f5bd8723e..23ac989a2a 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -131,7 +131,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { objectInfo = &sDoorInfo[0]; Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_Init(play, &this->skelAnime, &gDoorSkel, &gDoorAdultOpeningLeftAnim, this->jointTable, this->morphTable, - 5); + ARRAY_COUNT(this->jointTable)); for (i = 0; i < ARRAY_COUNT(sDoorInfo) - 2; i++, objectInfo++) { if (play->sceneId == objectInfo->sceneId) { break; diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 3c879ee1ac..2c7f39b3cc 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -6,6 +6,7 @@ #include "z_en_ds.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" @@ -43,7 +44,7 @@ void EnDs_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gPotionShopLadySkel, &gPotionShopLadyAnim, this->jointTable, - this->morphTable, 6); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayOnce(&this->skelAnime, &gPotionShopLadyAnim); this->actor.colChkInfo.mass = MASS_IMMOVABLE; diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 9477eb0df1..c92cd27773 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -1,6 +1,7 @@ #include "z_en_eiyer.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -133,7 +134,8 @@ void EnEiyer_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 600.0f, ActorShadow_DrawCircle, 65.0f); - SkelAnime_Init(play, &this->skelanime, &gStingerSkel, &gStingerIdleAnim, this->jointTable, this->morphTable, 19); + SkelAnime_Init(play, &this->skelanime, &gStingerSkel, &gStingerIdleAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 58cd30f3ff..b5543ffcb8 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -9,6 +9,7 @@ #include "libc64/qrand.h" #include "libu64/debug.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -341,7 +342,8 @@ void EnElf_Init(Actor* thisx, PlayState* play) { s32 i; Actor_ProcessInitChain(thisx, sInitChain); - SkelAnime_Init(play, &this->skelAnime, &gFairySkel, &gFairyAnim, this->jointTable, this->morphTable, 15); + SkelAnime_Init(play, &this->skelAnime, &gFairySkel, &gFairyAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f); thisx->shape.shadowAlpha = 0xFF; diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 475c476bb5..eb5ef590cd 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" @@ -471,7 +472,8 @@ void EnFd_Fade(EnFd* this, PlayState* play) { void EnFd_Init(Actor* thisx, PlayState* play) { EnFd* this = (EnFd*)thisx; - SkelAnime_InitFlex(play, &this->skelAnime, &gFlareDancerSkel, NULL, this->jointTable, this->morphTable, 27); + SkelAnime_InitFlex(play, &this->skelAnime, &gFlareDancerSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 32.0f); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index e674ee9bf5..ea519c9a78 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -157,7 +158,8 @@ void EnFirefly_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); - SkelAnime_Init(play, &this->skelAnime, &gKeeseSkeleton, &gKeeseFlyAnim, this->jointTable, this->morphTable, 28); + SkelAnime_Init(play, &this->skelAnime, &gKeeseSkeleton, &gKeeseFlyAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index f5964ebaea..b8dfbdab2c 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -7,6 +7,7 @@ #include "z_en_fish.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -145,7 +146,8 @@ void EnFish_Init(Actor* thisx, PlayState* play) { s16 params = this->actor.params; Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(play, &this->skelAnime, &gFishSkel, &gFishInWaterAnim, this->jointTable, this->morphTable, 7); + SkelAnime_InitFlex(play, &this->skelAnime, &gFishSkel, &gFishInWaterAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); this->actor.colChkInfo.mass = 50; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 87747933d3..7aa5728481 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -6,6 +6,7 @@ #include "z_en_floormas.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -141,7 +142,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gWallmasterSkel, &gWallmasterWaitAnim, this->jointTable, - this->morphTable, 25); + this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 00d29dcc6f..31a119bf86 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -309,10 +309,10 @@ void EnFr_Update(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); // frog SkelAnime_InitFlex(play, &this->skelAnime, &object_fr_Skel_00B498, &object_fr_Anim_001534, this->jointTable, - this->morphTable, 24); + this->morphTable, ARRAY_COUNT(this->jointTable)); // butterfly SkelAnime_Init(play, &this->skelAnimeButterfly, &gButterflySkel, &gButterflyAnim, this->jointTableButterfly, - this->morphTableButterfly, 8); + this->morphTableButterfly, ARRAY_COUNT(this->jointTableButterfly)); // When playing the song for the HP, the frog with the next note and the butterfly turns on its lightsource this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 24818477d7..abe13bac6b 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -6,6 +6,7 @@ #include "z_en_fu.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" @@ -92,7 +93,7 @@ void EnFu_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelanime, &gWindmillManSkel, &gWindmillManPlayStillAnim, this->jointTable, - this->morphTable, FU_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelanime, &gWindmillManPlayStillAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index ba002aefbe..2bac94f9d4 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -9,6 +9,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" @@ -202,7 +203,8 @@ s32 EnFw_SpawnDust(EnFw* this, u8 timer, f32 scale, f32 scaleStep, s32 dustCnt, void EnFw_Init(Actor* thisx, PlayState* play) { EnFw* this = (EnFw*)thisx; - SkelAnime_InitFlex(play, &this->skelAnime, &gFlareDancerCoreSkel, NULL, this->jointTable, this->morphTable, 11); + SkelAnime_InitFlex(play, &this->skelAnime, &gFlareDancerCoreSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFW_ANIM_0); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); Collider_InitJntSph(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 9565ceba98..33db9b07c3 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -177,7 +177,7 @@ void EnGb_Init(Actor* thisx, PlayState* play) { CollisionHeader_GetVirtual(&gPoeSellerCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); SkelAnime_InitFlex(play, &this->skelAnime, &gPoeSellerSkel, &gPoeSellerIdleAnim, this->jointTable, this->morphTable, - 12); + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->dyna.actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 8b6d821346..6d315fd409 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -7,6 +7,7 @@ #include "z_en_ge1.h" #include "libu64/debug.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -107,7 +108,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoWhiteSkel, &gGerudoWhiteIdleAnim, this->jointTable, - this->morphTable, GE1_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayOnce(&this->skelAnime, &gGerudoWhiteIdleAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 704ca69543..f30d79b10f 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -6,6 +6,7 @@ #include "z_en_ge2.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -131,7 +132,8 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { s16 params = this->actor.params; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoPurpleSkel, NULL, this->jointTable, this->morphTable, 22); + SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoPurpleSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, &gGerudoPurpleWalkingAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 5e0783bc30..46b0fdc37b 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -6,6 +6,7 @@ #include "z_en_ge3.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -81,7 +82,7 @@ void EnGe3_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoRedSkel, NULL, this->jointTable, this->morphTable, - GELDB_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, &gGerudoRedStandAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index a0fea77783..03281e9c48 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -7,6 +7,7 @@ #include "z_en_geldb.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -251,7 +252,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) { this->blinkState = 0; this->unkFloat = 10.0f; SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoRedSkel, &gGerudoRedNeutralAnim, this->jointTable, - this->morphTable, GELDB_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->bodyCollider); Collider_SetCylinder(play, &this->bodyCollider, thisx, &sBodyCylinderInit); Collider_InitTris(play, &this->blockCollider); diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 0c904a8808..11c3a59be8 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -6,6 +6,7 @@ #include "z_en_gm.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -117,7 +118,8 @@ s32 func_80A3D7C8(void) { void func_80A3D838(EnGm* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->gmObjectSlot)) { this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; - SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, 18); + SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->gmObjectSlot].segment); Animation_Change(&this->skelAnime, &object_gm_Anim_0002B8, 1.0f, 0.0f, Animation_GetLastFrame(&object_gm_Anim_0002B8), ANIMMODE_LOOP, 0.0f); diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 61c3d5f6e1..0f204fe3ab 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -1538,7 +1538,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, 18); + SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 82175795bd..d6165b2dc9 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -10,6 +10,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -160,7 +161,7 @@ void EnGoma_Init(Actor* thisx, PlayState* play) { } else { // Egg ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); SkelAnime_Init(play, &this->skelanime, &gObjectGolSkel, &gObjectGolStandAnim, this->jointTable, - this->morphTable, GOMA_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelanime, &gObjectGolStandAnim); this->actor.colChkInfo.health = 2; diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 91a896632d..4b92607a4d 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -6,6 +6,7 @@ #include "z_en_guest.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -93,7 +94,8 @@ void EnGuest_Update(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(play, &this->skelAnime, &gHylianMan2Skel, NULL, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gHylianMan2Skel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment); Animation_Change(&this->skelAnime, &gObjOsAnim_42AC, 1.0f, 0.0f, Animation_GetLastFrame(&gObjOsAnim_42AC), ANIMMODE_LOOP, 0.0f); diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 4236fe05bd..35356fb86c 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -89,7 +89,8 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play2) { s32 i; Actor_SetScale(&this->actor, 0.01f); - SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, 17); + SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); this->type = PARAMS_GET_U(this->actor.params, 8, 8); this->path = PARAMS_GET_U(this->actor.params, 0, 8); diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index f9d5999c88..e11f8c7609 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -133,7 +134,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { this->unk_2E0 = 60.0f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, - 17); + ARRAY_COUNT(this->jointTable)); collider = &this->collider; Collider_InitCylinder(play, collider); Collider_SetCylinder(play, collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 8e03fe3e62..ad201018a5 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -6,6 +6,7 @@ #include "z_en_heishi3.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -83,7 +84,8 @@ void EnHeishi3_Init(Actor* thisx, PlayState* play) { } Actor_SetScale(&this->actor, 0.01f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, 17); + SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.attentionRangeType = ATTENTION_RANGE_6; Collider_InitCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index b90c778114..fa50f3bd9a 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -1,5 +1,6 @@ #include "z_en_heishi4.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -76,12 +77,12 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { this->height = 30.0f; ActorShape_Init(&thisx->shape, 0.0f, NULL, 30.0f); SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiDyingGuardAnim_00C444, this->jointTable, - this->morphTable, 17); + this->morphTable, ARRAY_COUNT(this->jointTable)); } else { this->height = 60.0f; ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, - 17); + ARRAY_COUNT(this->jointTable)); } Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 454f83c2d0..aedb993791 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -6,6 +6,7 @@ #include "z_en_hintnuts.h" +#include "array_count.h" #include "ichain.h" #include "sfx.h" #include "sys_matrix.h" @@ -87,7 +88,7 @@ void EnHintnuts_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0x0, ActorShadow_DrawCircle, 35.0f); //! @bug Flex skeleton is used as normal skeleton SkelAnime_Init(play, &this->skelAnime, (SkeletonHeader*)&gHintNutsSkel, &gHintNutsStandAnim, this->jointTable, - this->morphTable, 10); + this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 76281c549f..fdaa897926 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -6,6 +6,7 @@ #include "z_en_hs.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -72,7 +73,7 @@ void EnHs_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_hs_Skel_006260, &object_hs_Anim_0005C0, this->jointTable, - this->morphTable, 16); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, &object_hs_Anim_0005C0); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 71005a3afb..40644d95da 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -6,6 +6,7 @@ #include "z_en_hs2.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -63,7 +64,7 @@ void EnHs2_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_hs_Skel_006260, &object_hs_Anim_0005C0, this->jointTable, - this->morphTable, 16); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, &object_hs_Anim_0005C0); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 8680d13aa6..94bd24f4ff 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -6,6 +6,7 @@ #include "z_en_hy.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -1165,7 +1166,7 @@ void EnHy_WaitForObjects(EnHy* this, PlayState* play) { gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment); SkelAnime_InitFlex(play, &this->skelAnime, sSkeletonInfo[sModelInfo[ENHY_GET_TYPE(&this->actor)].lowerSkelInfoIndex].skeleton, NULL, - this->jointTable, this->morphTable, ENHY_LIMB_MAX); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment); Collider_InitCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 582455f17e..1b2b534cf6 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -1218,7 +1218,7 @@ void EnIk_SetupCsAction3(EnIk* this, PlayState* play) { f32 endFrame = Animation_GetLastFrame(&gIronKnuckleNabooruDeathAnim); SkelAnime_InitFlex(play, &this->skelAnime, &gIronKnuckleDefeatSkel, NULL, this->jointTable, this->morphTable, - IRON_KNUCKLE_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); Animation_Change(&this->skelAnime, &gIronKnuckleNabooruDeathAnim, 1.0f, 0.0f, endFrame, ANIMMODE_ONCE, 0.0f); this->csAction = IK_CS_ACTION_3; this->csDrawMode = IK_CS_DRAW_DEFEAT; @@ -1568,7 +1568,7 @@ void EnIk_Init(Actor* thisx, PlayState* play) { } else { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gIronKnuckleSkel, &gIronKnuckleNabooruSummonAxeAnim, - this->jointTable, this->morphTable, IRON_KNUCKLE_LIMB_MAX); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); EnIk_InitImpl(&this->actor, play); EnIk_CsInit(this, play); } diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 521b8dcbfa..73fc3eed8e 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -540,7 +540,8 @@ void EnIn_WaitForObject(EnIn* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot) || this->actor.params <= 0) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gIngoSkel, NULL, this->jointTable, this->morphTable, 20); + SkelAnime_InitFlex(play, &this->skelAnime, &gIngoSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 8695ba0a58..b38f448c7b 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -205,7 +206,8 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) { type = PARAMS_GET_U(this->actor.params, 0, 2); - SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, 24); + SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements); diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/src/overlays/actors/ovl_En_Jj/z_en_jj.c index 3f6b3c587c..16a89b705c 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -7,6 +7,7 @@ #include "z_en_jj.h" #include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -100,7 +101,7 @@ void EnJj_Init(Actor* thisx, PlayState* play2) { switch (this->dyna.actor.params) { case JABUJABU_MAIN: SkelAnime_InitFlex(play, &this->skelAnime, &gJabuJabuSkel, &gJabuJabuAnim, this->jointTable, - this->morphTable, 22); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, &gJabuJabuAnim); this->unk_30A = 0; this->eyeIndex = 0; diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index f5aee34c6a..6e877f63db 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -6,6 +6,7 @@ #include "z_en_js.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "regs.h" @@ -67,7 +68,7 @@ void EnJs_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gCarpetMerchantSkel, &gCarpetMerchantSlappingKneeAnim, this->jointTable, - this->morphTable, 13); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayOnce(&this->skelAnime, &gCarpetMerchantSlappingKneeAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index be3b0eacb5..e1488967b5 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -7,6 +7,7 @@ #include "z_en_karebaba.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -107,7 +108,7 @@ void EnKarebaba_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f); SkelAnime_Init(play, &this->skelAnime, &gDekuBabaSkel, &gDekuBabaFastChompAnim, this->jointTable, this->morphTable, - 8); + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->bodyCollider); Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sBodyColliderInit); Collider_UpdateCylinder(&this->actor, &this->bodyCollider); diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 348c3a0acc..2249ed958b 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -6,6 +6,7 @@ #include "z_en_ko.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "printf.h" @@ -1189,7 +1190,7 @@ void func_80A99048(EnKo* this, PlayState* play) { this->actor.objectSlot = this->legsObjectSlot; gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment); SkelAnime_InitFlex(play, &this->skelAnime, sSkeleton[sModelInfo[ENKO_TYPE].legsId].flexSkeletonHeader, NULL, - this->jointTable, this->morphTable, 16); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment); Collider_InitCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 7caa735739..c886ea395c 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -7,6 +7,7 @@ #include "z_en_kz.h" #include "libc64/math64.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -393,7 +394,8 @@ void EnKz_Init(Actor* thisx, PlayState* play) { EnKz* this = (EnKz*)thisx; s32 pad; - SkelAnime_InitFlex(play, &this->skelanime, &gKzSkel, NULL, this->jointTable, this->morphTable, 12); + SkelAnime_InitFlex(play, &this->skelanime, &gKzSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 0.0, NULL, 0.0); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index a69a25f0d5..8c8ea91a84 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -7,6 +7,7 @@ #include "z_en_mb.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -293,7 +294,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { switch (this->actor.params) { case ENMB_TYPE_SPEAR_GUARD: SkelAnime_InitFlex(play, &this->skelAnime, &gEnMbSpearSkel, &gEnMbSpearStandStillAnim, this->jointTable, - this->morphTable, 28); + this->morphTable, ARRAY_COUNT(this->jointTable)); this->actor.colChkInfo.health = 2; this->actor.colChkInfo.mass = MASS_HEAVY; this->maxHomeDist = 1000.0f; @@ -302,7 +303,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { break; case ENMB_TYPE_CLUB: SkelAnime_InitFlex(play, &this->skelAnime, &gEnMbClubSkel, &gEnMbClubStandStillClubDownAnim, - this->jointTable, this->morphTable, 28); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); this->actor.colChkInfo.health = 6; this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -331,7 +332,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { break; default: /* Spear Patrol */ SkelAnime_InitFlex(play, &this->skelAnime, &gEnMbSpearSkel, &gEnMbSpearStandStillAnim, this->jointTable, - this->morphTable, 28); + this->morphTable, ARRAY_COUNT(this->jointTable)); Actor_SetScale(&this->actor, 0.014f); this->path = PARAMS_GET_S(thisx->params, 8, 8); diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 296f4d42af..96e3ca5726 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "libc64/math64.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "segmented_address.h" @@ -687,7 +688,8 @@ void EnMd_Init(Actor* thisx, PlayState* play) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gMidoSkel, NULL, this->jointTable, this->morphTable, ENMD_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gMidoSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index f035f2d331..ab6c36e904 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -6,6 +6,7 @@ #include "z_en_mk.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" @@ -67,7 +68,7 @@ void EnMk_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -1.0f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_mk_Skel_005DF0, &object_mk_Anim_000D88, this->jointTable, - this->morphTable, 13); + this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, &object_mk_Anim_000D88); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 75969dd224..7b18a54187 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -7,6 +7,7 @@ #include "z_en_mm.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -176,7 +177,8 @@ void EnMm_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 21.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gRunningManSkel, NULL, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gRunningManSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index 2144294ab3..483f9361ac 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -7,6 +7,7 @@ #include "z_en_mm2.h" #include "libu64/debug.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -140,7 +141,8 @@ void EnMm2_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 21.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gRunningManSkel, NULL, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gRunningManSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_Change(&this->skelAnime, sAnimationInfo[RM2_ANIM_SIT_WAIT].animation, 1.0f, 0.0f, Animation_GetLastFrame(sAnimationInfo[RM2_ANIM_SIT_WAIT].animation), sAnimationInfo[RM2_ANIM_SIT_WAIT].mode, sAnimationInfo[RM2_ANIM_SIT_WAIT].morphFrames); diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 18ebac054a..353a3e4422 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -6,6 +6,7 @@ #include "z_en_ms.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -87,7 +88,7 @@ void EnMs_Init(Actor* thisx, PlayState* play) { } Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(play, &this->skelAnime, &gBeanSalesmanSkel, &gBeanSalesmanEatingAnim, this->jointTable, - this->morphTable, 9); + this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 1c937e8721..d3bd5f663f 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -1476,7 +1476,8 @@ void EnNb_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); EnNb_SetupCollider(thisx, play); - SkelAnime_InitFlex(play, &this->skelAnime, &gNabooruSkel, NULL, this->jointTable, this->morphTable, NB_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gNabooruSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); switch (EnNb_GetType(this)) { case NB_TYPE_DEMO02: diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 71cc497e10..4a0cb04527 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -177,7 +177,8 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); if (play->sceneId == SCENE_KAKARIKO_VILLAGE) { for (i = 0; i < ARRAY_COUNT(sKakarikoPosList); i++) { diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 6a2468f93f..8631b09d75 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -72,7 +73,8 @@ void EnNiwGirl_Init(Actor* thisx, PlayState* play) { Vec3f vec2; s32 pad2; - SkelAnime_InitFlex(play, &this->skelAnime, &gNiwGirlSkel, &gNiwGirlRunAnim, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(play, &this->skelAnime, &gNiwGirlSkel, &gNiwGirlRunAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.attentionRangeType = ATTENTION_RANGE_6; diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 1ea6397096..edaba3e23f 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -1,6 +1,7 @@ #include "z_en_niw_lady.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -174,7 +175,8 @@ void func_80AB9F24(EnNiwLady* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->aneObjectSlot) && Object_IsLoaded(&play->objectCtx, this->osAnimeObjectSlot)) { gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->aneObjectSlot].segment); - SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoLadySkel, NULL, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoLadySkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment); this->unk_27E = 1; this->actor.gravity = -3.0f; diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index b7063e0f00..ed6f08c72c 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -1,6 +1,7 @@ #include "z_en_okuta.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -139,7 +140,7 @@ void EnOkuta_Init(Actor* thisx, PlayState* play) { thisx->params &= 0xFF; if (thisx->params == 0) { SkelAnime_Init(play, &this->skelAnime, &gOctorokSkel, &gOctorokAppearAnim, this->jointTable, this->morphTable, - 38); + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sOctorockColliderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 3ec065c696..1be98a6577 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -7,6 +7,7 @@ #include "z_en_owl.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -133,9 +134,10 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 36.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gOwlFlyingSkel, &gOwlFlyAnim, this->jointTable, this->morphTable, 21); + SkelAnime_InitFlex(play, &this->skelAnime, &gOwlFlyingSkel, &gOwlFlyAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); SkelAnime_InitFlex(play, &this->skelAnime2, &gOwlPerchingSkel, &gOwlPerchAnim, this->jointTable2, this->morphTable2, - 16); + ARRAY_COUNT(this->jointTable2)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sOwlCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 2246b3df16..fb1df81717 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -3,6 +3,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -210,7 +211,8 @@ void EnPeehat_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 36.0f * 0.001f); - SkelAnime_Init(play, &this->skelAnime, &gPeehatSkel, &gPeehatRisingAnim, this->jointTable, this->morphTable, 24); + SkelAnime_Init(play, &this->skelAnime, &gPeehatSkel, &gPeehatRisingAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 100.0f, ActorShadow_DrawCircle, 27.0f); this->actor.focus.pos = this->actor.world.pos; this->unk_2D4 = 0; diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 8110c00f3e..058ff48845 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -7,6 +7,7 @@ #include "z_en_po_desert.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -74,7 +75,8 @@ void EnPoDesert_Init(Actor* thisx, PlayState* play) { EnPoDesert* this = (EnPoDesert*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_Init(play, &this->skelAnime, &gPoeFieldSkel, &gPoeFieldFloatAnim, this->jointTable, this->morphTable, 10); + SkelAnime_Init(play, &this->skelAnime, &gPoeFieldSkel, &gPoeFieldFloatAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderCylinderInit); this->lightColor.r = 255; diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 30218e20e5..22b06b8f39 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -7,6 +7,7 @@ #include "z_en_po_field.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -182,7 +183,8 @@ void EnPoField_Init(Actor* thisx, PlayState* play) { return; } Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_Init(play, &this->skelAnime, &gPoeFieldSkel, &gPoeFieldFloatAnim, this->jointTable, this->morphTable, 10); + SkelAnime_Init(play, &this->skelAnime, &gPoeFieldSkel, &gPoeFieldFloatAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AD7080); Collider_InitCylinder(play, &this->flameCollider); diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index 983dbf0d71..5664efdbaa 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -109,7 +110,8 @@ void EnPoRelay_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 42.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gDampeSkel, &gDampeFloatAnim, this->jointTable, this->morphTable, 18); + SkelAnime_InitFlex(play, &this->skelAnime, &gDampeSkel, &gDampeFloatAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index ba165bd3ad..e1c85c4b0f 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -200,7 +200,7 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); SkelAnime_Init(play, &this->skelAnime, &gPoeSistersSkel, &gPoeSistersSwayAnim, this->jointTable, this->morphTable, - 12); + ARRAY_COUNT(this->jointTable)); this->unk_22E.r = 255; this->unk_22E.g = 255; this->unk_22E.b = 210; diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index fceb18ef7c..cc0776de07 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -7,6 +7,7 @@ #include "z_en_poh.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -927,7 +928,8 @@ void EnPoh_Update(Actor* thisx, PlayState* play) { this->actor.update = EnPoh_UpdateLiving; Actor_SetObjectDependency(play, &this->actor); if (this->infoIdx == EN_POH_INFO_NORMAL) { - SkelAnime_Init(play, &this->skelAnime, &gPoeSkel, &gPoeFloatAnim, this->jointTable, this->morphTable, 21); + SkelAnime_Init(play, &this->skelAnime, &gPoeSkel, &gPoeFloatAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); this->actor.draw = EnPoh_DrawRegular; } else { SkelAnime_InitFlex(play, &this->skelAnime, &gPoeComposerSkel, &gPoeComposerFloatAnim, this->jointTable, diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index af9ed8f112..590f8ef994 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -7,6 +7,7 @@ #include "z_en_rd.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -185,11 +186,11 @@ void EnRd_Init(Actor* thisx, PlayState* play) { if (this->actor.params >= REDEAD_TYPE_DOES_NOT_MOURN) { SkelAnime_InitFlex(play, &this->skelAnime, &gRedeadSkel, &gGibdoRedeadIdleAnim, this->jointTable, - this->morphTable, REDEAD_GIBDO_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); this->actor.naviEnemyId = NAVI_ENEMY_REDEAD; } else { SkelAnime_InitFlex(play, &this->skelAnime, &gGibdoSkel, &gGibdoRedeadIdleAnim, this->jointTable, - this->morphTable, REDEAD_GIBDO_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); this->actor.naviEnemyId = NAVI_ENEMY_GIBDO; } diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index b4cafe6817..9660002aff 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -136,7 +137,7 @@ void EnReeba_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -3.5f; this->actor.focus.pos = this->actor.world.pos; SkelAnime_Init(play, &this->skelanime, &object_reeba_Skel_001EE8, &object_reeba_Anim_0001E4, this->jointTable, - this->morphTable, 18); + this->morphTable, ARRAY_COUNT(this->jointTable)); this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 4; Collider_InitCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 0e4573f90d..2f8d04e867 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -2280,7 +2280,8 @@ void EnRu1_Init(Actor* thisx, PlayState* play) { EnRu1* this = (EnRu1*)thisx; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gRutoChildSkel, NULL, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(play, &this->skelAnime, &gRutoChildSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); func_80AEAD20(&this->actor, play); switch (func_80AEADF0(this)) { case 0: diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index b6c7405a03..d2c8978650 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -936,7 +936,8 @@ void EnRu2_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); EnRu2_InitCollider(thisx, play); - SkelAnime_InitFlex(play, &this->skelAnime, &gAdultRutoSkel, NULL, this->jointTable, this->morphTable, 23); + SkelAnime_InitFlex(play, &this->skelAnime, &gAdultRutoSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); switch (EnRu2_GetType(this)) { case 2: diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index fb834576fb..d8fc436082 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -1,6 +1,7 @@ #include "z_en_sa.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "segmented_address.h" @@ -495,7 +496,8 @@ void EnSa_Init(Actor* thisx, PlayState* play) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 12.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gSariaSkel, NULL, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(play, &this->skelAnime, &gSariaSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index 4e082fcd47..d5818aee8b 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Dns/z_en_dns.h" #include "overlays/actors/ovl_En_Nutsball/z_en_nutsball.h" +#include "array_count.h" #include "gfx.h" #include "ichain.h" #include "sfx.h" @@ -80,7 +81,7 @@ void EnShopnuts_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gBusinessScrubSkel, &gBusinessScrubPeekAnim, this->jointTable, - this->morphTable, BUSINESS_SCRUB_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 52e521df9c..dc6d651b01 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -179,7 +180,7 @@ void EnSkb_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.health = 2; this->actor.shape.yOffset = -8000.0f; SkelAnime_Init(play, &this->skelAnime, &gStalchildSkel, &gStalchildUncurlingAnim, this->jointTable, - this->morphTable, 20); + this->morphTable, ARRAY_COUNT(this->jointTable)); this->actor.naviEnemyId = NAVI_ENEMY_STALCHILD; Collider_InitJntSph(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 52b1c4ae3f..ddc8c6e24b 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -1,6 +1,7 @@ #include "z_en_skj.h" #include "overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -427,7 +428,7 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { EnSkj_SetNaviId(this); SkelAnime_InitFlex(play, &this->skelAnime, &gSkullKidSkel, &gSkullKidPlayFluteAnim, this->jointTable, - this->morphTable, 19); + this->morphTable, ARRAY_COUNT(this->jointTable)); if ((type >= 0) && (type < 3)) { this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 95abf52374..0446eab368 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -634,7 +634,8 @@ void EnSsh_Init(Actor* thisx, PlayState* play) { return; } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_Init(play, &this->skelAnime, &object_ssh_Skel_0052E0, NULL, this->jointTable, this->morphTable, 30); + SkelAnime_Init(play, &this->skelAnime, &object_ssh_Skel_0052E0, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_Change(&this->skelAnime, &object_ssh_Anim_000304, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, 0.0f); this->blureIdx = EnSsh_CreateBlureEffect(play); EnSsh_InitColliders(this, play); diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index d0e8f79ecc..9e4ddb1976 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -802,7 +802,8 @@ void EnSt_Init(Actor* thisx, PlayState* play) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f); - SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); + SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENST_ANIM_0); this->blureIdx = EnSt_CreateBlureEffect(play); EnSt_InitColliders(this, play); diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 58ee87f235..3cca0a65b3 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -6,6 +6,7 @@ #include "z_en_sth.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -160,7 +161,7 @@ void EnSth_SetupAfterObjectLoaded(EnSth* this, PlayState* play) { EnSth_SetupShapeColliderUpdate2AndDraw(this, play); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment); SkelAnime_InitFlex(play, &this->skelAnime, sSkeletons[this->actor.params], NULL, this->jointTable, this->morphTable, - 16); + ARRAY_COUNT(this->jointTable)); Animation_PlayLoop(&this->skelAnime, sAnimations[this->actor.params]); params = &this->actor.params; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 8e10154c10..57a179f6f0 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -2,6 +2,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -252,7 +253,8 @@ void EnSw_Init(Actor* thisx, PlayState* play) { return; } - SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); + SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENSW_ANIM_0); ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); Collider_InitJntSph(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 5829aa68f1..986a7fd6ea 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" @@ -179,7 +180,7 @@ void EnSyatekiMan_Init(Actor* thisx, PlayState* play) { this->actor.attentionRangeType = ATTENTION_RANGE_1; Actor_SetScale(&this->actor, 0.01f); SkelAnime_InitFlex(play, &this->skelAnime, &gObjectOssanSkel, &gObjectOssanAnim_000338, this->jointTable, - this->morphTable, 9); + this->morphTable, ARRAY_COUNT(this->jointTable)); if (!LINK_IS_ADULT) { this->headRot.z = 20; } diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 5eca8ac947..2e7e8252ba 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -7,6 +7,7 @@ #include "z_en_syateki_niw.h" #include "libc64/math64.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -86,7 +87,8 @@ void EnSyatekiNiw_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoSkel, &gCuccoAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); this->minigameType = this->actor.params; if (this->minigameType < 0) { diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index fd4f5b91c1..063b982cea 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -159,7 +159,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gTalonSkel, &gTalonStandAnim, this->jointTable, this->morphTable, - ENTA_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index b61e51abdb..daa1be05cc 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -6,6 +6,7 @@ #include "z_en_takara_man.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -68,7 +69,7 @@ void EnTakaraMan_Init(Actor* thisx, PlayState* play) { play->actorCtx.flags.chest = 0; gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] = -1; SkelAnime_InitFlex(play, &this->skelAnime, &object_ts_Skel_004FE0, &object_ts_Anim_000498, this->jointTable, - this->morphTable, 10); + this->morphTable, ARRAY_COUNT(this->jointTable)); thisx->focus.pos = thisx->world.pos; this->pos = thisx->world.pos; thisx->world.pos.x = 133.0f; diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 17a18d8a6a..8255ed8939 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -7,6 +7,7 @@ #include "z_en_test.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -275,9 +276,9 @@ void EnTest_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_Init(play, &this->skelAnime, &gStalfosSkel, &gStalfosMiddleGuardAnim, this->jointTable, this->morphTable, - STALFOS_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); SkelAnime_Init(play, &this->upperSkelanime, &gStalfosSkel, &gStalfosMiddleGuardAnim, this->upperJointTable, - this->upperMorphTable, STALFOS_LIMB_MAX); + this->upperMorphTable, ARRAY_COUNT(this->upperJointTable)); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, 90.0f); diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 71ea089bbd..e4e9c85062 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -9,6 +9,7 @@ #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -196,7 +197,7 @@ void EnTite_Init(Actor* thisx, PlayState* play) { thisx->attentionRangeType = ATTENTION_RANGE_3; Actor_SetScale(thisx, 0.01f); SkelAnime_Init(play, &this->skelAnime, &object_tite_Skel_003A20, &object_tite_Anim_0012E4, this->jointTable, - this->morphTable, 25); + this->morphTable, ARRAY_COUNT(this->jointTable)); ActorShape_Init(&thisx->shape, -200.0f, ActorShadow_DrawCircle, 70.0f); this->flipState = TEKTITE_INITIAL; thisx->colChkInfo.damageTable = sDamageTable; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 4f697c29b8..1fbacdac9b 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -495,7 +495,8 @@ void EnTk_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gDampeSkel, NULL, this->jointTable, this->morphTable, 18); + SkelAnime_InitFlex(play, &this->skelAnime, &gDampeSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Animation_Change(&this->skelAnime, &gDampeRestAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDampeRestAnim), ANIMMODE_LOOP, 0.0f); diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 2ac84162c6..fb78dcb0ca 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -6,6 +6,7 @@ #include "z_en_toryo.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" @@ -129,7 +130,8 @@ void EnToryo_Init(Actor* thisx, PlayState* play) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 42.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_toryo_Skel_007150, NULL, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(play, &this->skelAnime, &object_toryo_Skel_007150, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index 3f2672cde4..f5bd9b26e6 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -6,6 +6,7 @@ #include "z_en_tr.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" @@ -108,7 +109,7 @@ void EnTr_Init(Actor* thisx, PlayState* play) { switch (this->actor.params) { case TR_KOUME: SkelAnime_InitFlex(play, &this->skelAnime, &gKoumeSkel, &gKotakeKoumeStandingBroomOverRightShoulderAnim, - this->jointTable, this->morphTable, KOTAKE_KOUME_LIMB_MAX); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayOnce(&this->skelAnime, &gKotakeKoumeStandingBroomOverRightShoulderAnim); this->animation = NULL; EnTr_SetupAction(this, EnTr_ChooseAction1); @@ -117,7 +118,7 @@ void EnTr_Init(Actor* thisx, PlayState* play) { case TR_KOTAKE: SkelAnime_InitFlex(play, &this->skelAnime, &gKotakeSkel, &gKotakeKoumeStandingBroomOverLeftShoulderAnim, - this->jointTable, this->morphTable, KOTAKE_KOUME_LIMB_MAX); + this->jointTable, this->morphTable, ARRAY_COUNT(this->jointTable)); Animation_PlayOnce(&this->skelAnime, &gKotakeKoumeStandingBroomOverLeftShoulderAnim); this->animation = NULL; EnTr_SetupAction(this, EnTr_ChooseAction1); diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 011b004b68..7a52a2f769 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -7,6 +7,7 @@ #include "z_en_vali.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -156,7 +157,7 @@ void EnVali_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 27.0f); this->actor.shape.shadowAlpha = 155; SkelAnime_Init(play, &this->skelAnime, &gBariSkel, &gBariLurkingAnim, this->jointTable, this->morphTable, - EN_VALI_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); Collider_InitQuad(play, &this->leftArmCollider); Collider_SetQuad(play, &this->leftArmCollider, &this->actor, &sQuadInit); diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 2ee230d9bd..6ee4380bb5 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -149,7 +150,8 @@ void EnVm_SetupAction(EnVm* this, EnVmActionFunc actionFunc) { void EnVm_Init(Actor* thisx, PlayState* play) { EnVm* this = (EnVm*)thisx; - SkelAnime_Init(play, &this->skelAnime, &gBeamosSkel, &gBeamosAnim, this->jointTable, this->morphTable, 11); + SkelAnime_Init(play, &this->skelAnime, &gBeamosSkel, &gBeamosAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); Collider_InitCylinder(play, &this->colliderCylinder); Collider_SetCylinder(play, &this->colliderCylinder, thisx, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index abb91c80b9..1edb33c681 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -6,6 +6,7 @@ #include "z_en_wallmas.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -133,7 +134,7 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); ActorShape_Init(&thisx->shape, 0, NULL, 0.5f); SkelAnime_InitFlex(play, &this->skelAnime, &gWallmasterSkel, &gWallmasterWaitAnim, this->jointTable, - this->morphTable, 25); + this->morphTable, ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 2e19328961..8dd06c298f 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -7,6 +7,7 @@ #include "z_en_weiyer.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -118,7 +119,8 @@ void EnWeiyer_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); ActorShape_Init(&this->actor.shape, 1000.0f, ActorShadow_DrawCircle, 65.0f); - SkelAnime_Init(play, &this->skelAnime, &gStingerSkel, &gStingerIdleAnim, this->jointTable, this->morphTable, 19); + SkelAnime_Init(play, &this->skelAnime, &gStingerSkel, &gStingerIdleAnim, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index f7ae2db60b..2afd935d2d 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -254,12 +254,12 @@ void EnWf_Init(Actor* thisx, PlayState* play) { if (thisx->params == WOLFOS_NORMAL) { SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosNormalSkel, &gWolfosWaitingAnim, this->jointTable, - this->morphTable, WOLFOS_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); Actor_SetScale(thisx, 0.0075f); thisx->naviEnemyId = NAVI_ENEMY_WOLFOS; } else { // WOLFOS_WHITE SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosWhiteSkel, &gWolfosWaitingAnim, this->jointTable, - this->morphTable, WOLFOS_LIMB_MAX); + this->morphTable, ARRAY_COUNT(this->jointTable)); Actor_SetScale(thisx, 0.01f); this->colliderJntSph.elements[0].base.atDmgInfo.damage = this->colliderJntSph.elements[1].base.atDmgInfo.damage = 8; diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index b49481e881..73ba6c5e8f 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -343,12 +343,12 @@ void EnZf_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.health = 12; thisx->naviEnemyId = NAVI_ENEMY_DINOLFOS; SkelAnime_Init(play, &this->skelAnime, &gZfDinolfosSkel, &gZfCryingAnim, this->jointTable, this->morphTable, - ENZF_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); } else { // Lizalfos thisx->colChkInfo.health = 6; thisx->naviEnemyId = NAVI_ENEMY_LIZALFOS; SkelAnime_Init(play, &this->skelAnime, &gZfLizalfosSkel, &gZfCryingAnim, this->jointTable, this->morphTable, - ENZF_LIMB_MAX); + ARRAY_COUNT(this->jointTable)); } if (thisx->params < ENZF_TYPE_LIZALFOS_MINIBOSS_A) { // Not minibosses diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 7977dfbe55..fdb55317d5 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -2714,7 +2714,8 @@ void EnZl3_Init(Actor* thisx, PlayState* play) { ActorShape_Init(shape, 0.0f, ActorShadow_DrawCircle, 30.0f); shape->shadowAlpha = 0; func_80B533B0(thisx, play); - SkelAnime_InitFlex(play, &this->skelAnime, &gZelda2Skel, NULL, this->jointTable, this->morphTable, 15); + SkelAnime_InitFlex(play, &this->skelAnime, &gZelda2Skel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); switch (func_80B54DD4(this)) { case 1: diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index a18efd4ba9..33712f2582 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -6,6 +6,7 @@ #include "z_en_zl4.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -377,7 +378,8 @@ void EnZl4_Init(Actor* thisx, PlayState* play) { s32 pad; EnZl4* this = (EnZl4*)thisx; - SkelAnime_InitFlex(play, &this->skelAnime, &gChildZeldaSkel, NULL, this->jointTable, this->morphTable, 18); + SkelAnime_InitFlex(play, &this->skelAnime, &gChildZeldaSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_21); Collider_InitCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 95a9f6e07c..dc79293176 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -587,7 +587,8 @@ void EnZo_Init(Actor* thisx, PlayState* play) { EnZo* this = (EnZo*)thisx; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, 20); + SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, + ARRAY_COUNT(this->jointTable)); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInit);