From 78684187fefadb54ef551f189f159f2f8364e5e3 Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Mon, 15 Aug 2022 11:51:38 -0700 Subject: [PATCH] Make names related to animations more consistent (#998) * Make names related to animations more consistent * Standardize on sAnimationInfo * Respond to hensldm's review * Standardize on ChangeAnim * Respond to hensldm's review * Small formatting thing * Consistency after merging master * A few more things I missed * Respond to Elliptic's review * Some more stuff that was requested --- docs/tutorial/object_decomp_example.md | 2 +- include/functions.h | 4 +- include/z64subs.h | 4 +- include/z_en_hy_code.h | 44 +- src/code/z_actor.c | 14 +- src/code/z_en_hy_code.c | 14 +- src/code/z_skelanime.c | 20 +- src/code/z_sub_s.c | 32 +- src/overlays/actors/ovl_Dm_Al/z_dm_al.c | 25 +- src/overlays/actors/ovl_Dm_Al/z_dm_al.h | 9 +- src/overlays/actors/ovl_Dm_An/z_dm_an.c | 4 +- src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c | 8 +- .../actors/ovl_Dm_Char00/z_dm_char00.c | 20 +- .../actors/ovl_Dm_Char02/z_dm_char02.c | 44 +- .../actors/ovl_Dm_Char03/z_dm_char03.c | 20 +- .../actors/ovl_Dm_Char04/z_dm_char04.c | 14 +- .../actors/ovl_Dm_Char04/z_dm_char04.h | 2 +- .../actors/ovl_Dm_Char05/z_dm_char05.c | 22 +- src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c | 4 +- src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c | 4 +- src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c | 4 +- src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c | 407 ++++++------ src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c | 44 +- src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h | 2 +- src/overlays/actors/ovl_En_Ah/z_en_ah.c | 4 +- .../ovl_En_Akindonuts/z_en_akindonuts.c | 38 +- src/overlays/actors/ovl_En_Al/z_en_al.c | 4 +- .../actors/ovl_En_Aob_01/z_en_aob_01.c | 32 +- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 20 +- src/overlays/actors/ovl_En_Baba/z_en_baba.c | 20 +- .../actors/ovl_En_Baisen/z_en_baisen.c | 24 +- .../actors/ovl_En_Bba_01/z_en_bba_01.c | 2 +- .../actors/ovl_En_Bji_01/z_en_bji_01.c | 16 +- .../actors/ovl_En_Bji_01/z_en_bji_01.h | 2 +- src/overlays/actors/ovl_En_Bjt/z_en_bjt.c | 31 +- src/overlays/actors/ovl_En_Bjt/z_en_bjt.h | 2 +- .../actors/ovl_En_Bombers2/z_en_bombers2.c | 4 +- .../actors/ovl_En_Bomjimb/z_en_bomjimb.c | 6 +- .../actors/ovl_En_Cne_01/z_en_cne_01.c | 2 +- src/overlays/actors/ovl_En_Dai/z_en_dai.c | 4 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 4 +- .../ovl_En_Demo_heishi/z_en_demo_heishi.c | 24 +- src/overlays/actors/ovl_En_Dg/z_en_dg.c | 116 ++-- src/overlays/actors/ovl_En_Dnk/z_en_dnk.c | 14 +- src/overlays/actors/ovl_En_Dnp/z_en_dnp.c | 4 +- src/overlays/actors/ovl_En_Dnq/z_en_dnq.c | 4 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 79 ++- src/overlays/actors/ovl_En_Dns/z_en_dns.h | 2 +- .../actors/ovl_En_Dragon/z_en_dragon.c | 44 +- .../actors/ovl_En_Dragon/z_en_dragon.h | 2 +- src/overlays/actors/ovl_En_Drs/z_en_drs.c | 4 +- src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c | 4 +- src/overlays/actors/ovl_En_Fg/z_en_fg.c | 22 +- src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 40 +- src/overlays/actors/ovl_En_Fsn/z_en_fsn.h | 2 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 16 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 44 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.h | 2 +- src/overlays/actors/ovl_En_Geg/z_en_geg.c | 8 +- src/overlays/actors/ovl_En_Gg/z_en_gg.c | 26 +- src/overlays/actors/ovl_En_Giant/z_en_giant.c | 126 ++-- src/overlays/actors/ovl_En_Giant/z_en_giant.h | 2 +- .../actors/ovl_En_Ginko_Man/z_en_ginko_man.c | 56 +- .../actors/ovl_En_Ginko_Man/z_en_ginko_man.h | 8 - src/overlays/actors/ovl_En_Gk/z_en_gk.c | 44 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 4 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 4 +- .../ovl_En_Guard_Nuts/z_en_guard_nuts.c | 12 +- .../actors/ovl_En_Guruguru/z_en_guruguru.c | 16 +- .../actors/ovl_En_Heishi/z_en_heishi.c | 24 +- src/overlays/actors/ovl_En_Hg/z_en_hg.c | 42 +- src/overlays/actors/ovl_En_Hg/z_en_hg.h | 2 +- src/overlays/actors/ovl_En_Hgo/z_en_hgo.c | 20 +- .../actors/ovl_En_Hint_Skb/z_en_hint_skb.c | 30 +- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 620 +++++++++--------- src/overlays/actors/ovl_En_Horse/z_en_horse.h | 16 +- src/overlays/actors/ovl_En_Ig/z_en_ig.c | 4 +- src/overlays/actors/ovl_En_In/z_en_in.c | 44 +- src/overlays/actors/ovl_En_In/z_en_in.h | 21 + src/overlays/actors/ovl_En_Ja/z_en_ja.c | 4 +- src/overlays/actors/ovl_En_Jg/z_en_jg.c | 170 ++--- src/overlays/actors/ovl_En_Jg/z_en_jg.h | 4 +- .../actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c | 28 +- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 76 +-- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 24 +- src/overlays/actors/ovl_En_Kgy/z_en_kgy.c | 6 +- src/overlays/actors/ovl_En_Ma4/z_en_ma4.c | 22 +- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.c | 18 +- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.h | 2 +- .../actors/ovl_En_Ma_Yts/z_en_ma_yts.c | 8 +- src/overlays/actors/ovl_En_Mm3/z_en_mm3.c | 20 +- src/overlays/actors/ovl_En_Muto/z_en_muto.c | 2 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 44 +- src/overlays/actors/ovl_En_Niw/z_en_niw.h | 15 +- src/overlays/actors/ovl_En_Osn/z_en_osn.c | 20 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 154 ++--- src/overlays/actors/ovl_En_Ossan/z_en_ossan.h | 2 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 24 +- src/overlays/actors/ovl_En_Ot/z_en_ot.h | 2 +- .../actors/ovl_En_Pamera/z_en_pamera.c | 44 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 4 +- .../actors/ovl_En_Racedog/z_en_racedog.c | 52 +- src/overlays/actors/ovl_En_Raf/z_en_raf.c | 40 +- .../actors/ovl_En_Rail_Skb/z_en_rail_skb.c | 36 +- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 100 +-- .../actors/ovl_En_Railgibud/z_en_railgibud.h | 2 +- src/overlays/actors/ovl_En_Rsn/z_en_rsn.c | 4 +- .../actors/ovl_En_Scopenuts/z_en_scopenuts.c | 34 +- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 76 +-- src/overlays/actors/ovl_En_Shn/z_en_shn.c | 10 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 42 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 11 +- src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 35 +- src/overlays/actors/ovl_En_St/z_en_st.c | 24 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 116 ++-- .../actors/ovl_En_Suttari/z_en_suttari.h | 2 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 6 +- .../z_en_syateki_dekunuts.c | 12 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 14 +- .../ovl_En_Syateki_Okuta/z_en_syateki_okuta.c | 10 +- .../ovl_En_Syateki_Wf/z_en_syateki_wf.c | 12 +- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 58 +- src/overlays/actors/ovl_En_Trt/z_en_trt.c | 44 +- src/overlays/actors/ovl_En_Trt/z_en_trt.h | 2 +- src/overlays/actors/ovl_En_Trt2/z_en_trt2.c | 20 +- src/overlays/actors/ovl_En_Tru/z_en_tru.c | 4 +- .../actors/ovl_En_Tru_Mt/z_en_tru_mt.c | 16 +- src/overlays/actors/ovl_En_Yb/z_en_yb.c | 22 +- src/overlays/actors/ovl_En_Yb/z_en_yb.h | 2 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 22 +- src/overlays/actors/ovl_Obj_Um/z_obj_um.c | 72 +- src/overlays/actors/ovl_Obj_Um/z_obj_um.h | 6 +- tools/disasm/functions.txt | 46 +- tools/disasm/variables.txt | 36 +- 134 files changed, 2115 insertions(+), 2100 deletions(-) diff --git a/docs/tutorial/object_decomp_example.md b/docs/tutorial/object_decomp_example.md index 0917ebdd44..d1cc4738af 100644 --- a/docs/tutorial/object_decomp_example.md +++ b/docs/tutorial/object_decomp_example.md @@ -110,7 +110,7 @@ After naming the animations, the end result will look something like this: Once again, we can run `./extract_assets.py -s objects/object_dns` to extract the object, and we can update the animation names in `z_en_dns.c` to use our new names like so: ```c -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &gKingsChamberDekuGuardWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, diff --git a/include/functions.h b/include/functions.h index 51e4695802..e822a18e75 100644 --- a/include/functions.h +++ b/include/functions.h @@ -757,7 +757,7 @@ s32 func_800BD2B4(PlayState* play, Actor* actor, s16* arg2, f32 arg3, u16 (*text void func_800BD888(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3); void func_800BD9E0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); void func_800BDAA0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); -void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index); +void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 animIndex); void Actor_Noop(Actor* actor, PlayState* play); void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist); @@ -2219,7 +2219,7 @@ s16 SkelAnime_GetFrameDataLegacy(LegacyAnimationHeader* animation, s32 frame, Ve s16 Animation_GetLimbCount2(LegacyAnimationHeader* animation); s16 Animation_GetLength2(LegacyAnimationHeader* animation); s16 Animation_GetLastFrame2(LegacyAnimationHeader* animation); -void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* vec2, Vec3s* vec3, f32 unkf); +void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s* target, f32 weight); void AnimationContext_Reset(AnimationContext* animationCtx); void AnimationContext_SetNextQueue(PlayState* play); void AnimationContext_DisableQueue(PlayState* play); diff --git a/include/z64subs.h b/include/z64subs.h index ff9404e9d5..9f0b5fea3b 100644 --- a/include/z64subs.h +++ b/include/z64subs.h @@ -104,7 +104,7 @@ Path* SubS_GetAdditionalPath(struct PlayState* play, u8 pathIndex, s32 max); Actor* SubS_FindNearestActor(Actor* actor, struct PlayState* play, u8 actorCategory, s16 actorId); -s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index); +s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex); s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex); @@ -151,7 +151,7 @@ s32 SubS_ActorPathing_MoveWithGravity(struct PlayState* play, ActorPathing* acto s32 SubS_ActorPathing_MoveWithoutGravityReverse(struct PlayState* play, ActorPathing* actorPath); s32 SubS_ActorPathing_SetNextPoint(struct PlayState* play, ActorPathing* actorPath); -void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex, s32* curIndex); +void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animationInfo, s32 nextAnimIndex, s32* curAnimIndex); s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type); s32 SubS_FillCutscenesList(Actor* actor, s16 cutscenes[], s16 numCutscenes); diff --git a/include/z_en_hy_code.h b/include/z_en_hy_code.h index 724b8c570b..d272522c91 100644 --- a/include/z_en_hy_code.h +++ b/include/z_en_hy_code.h @@ -10,28 +10,28 @@ struct EnHy; //! TODO: Better animaion enum names when animations are documented typedef enum { - /* 0 */ ENHY_ANIMATION_AOB_0, - /* 1 */ ENHY_ANIMATION_BOJ_1, - /* 2 */ ENHY_ANIMATION_BOJ_2, - /* 3 */ ENHY_ANIMATION_BOJ_3, - /* 4 */ ENHY_ANIMATION_BOJ_4, - /* 5 */ ENHY_ANIMATION_BOJ_5, - /* 6 */ ENHY_ANIMATION_BBA_6, - /* 7 */ ENHY_ANIMATION_BJI_7, - /* 8 */ ENHY_ANIMATION_BJI_8, - /* 9 */ ENHY_ANIMATION_BJI_9, - /* 10 */ ENHY_ANIMATION_BOJ_10, - /* 11 */ ENHY_ANIMATION_OS_ANIME_11, - /* 12 */ ENHY_ANIMATION_BOJ_12, - /* 13 */ ENHY_ANIMATION_BOJ_13, - /* 14 */ ENHY_ANIMATION_BOJ_14, - /* 15 */ ENHY_ANIMATION_BOJ_15, - /* 16 */ ENHY_ANIMATION_BOJ_16, - /* 17 */ ENHY_ANIMATION_BOJ_17, - /* 18 */ ENHY_ANIMATION_BOJ_18, - /* 19 */ ENHY_ANIMATION_BOJ_19, - /* 20 */ ENHY_ANIMATION_BOJ_20, - /* 21 */ ENHY_ANIMATION_MAX + /* 0 */ ENHY_ANIM_AOB_0, + /* 1 */ ENHY_ANIM_BOJ_1, + /* 2 */ ENHY_ANIM_BOJ_2, + /* 3 */ ENHY_ANIM_BOJ_3, + /* 4 */ ENHY_ANIM_BOJ_4, + /* 5 */ ENHY_ANIM_BOJ_5, + /* 6 */ ENHY_ANIM_BBA_6, + /* 7 */ ENHY_ANIM_BJI_7, + /* 8 */ ENHY_ANIM_BJI_8, + /* 9 */ ENHY_ANIM_BJI_9, + /* 10 */ ENHY_ANIM_BOJ_10, + /* 11 */ ENHY_ANIM_OS_ANIME_11, + /* 12 */ ENHY_ANIM_BOJ_12, + /* 13 */ ENHY_ANIM_BOJ_13, + /* 14 */ ENHY_ANIM_BOJ_14, + /* 15 */ ENHY_ANIM_BOJ_15, + /* 16 */ ENHY_ANIM_BOJ_16, + /* 17 */ ENHY_ANIM_BOJ_17, + /* 18 */ ENHY_ANIM_BOJ_18, + /* 19 */ ENHY_ANIM_BOJ_19, + /* 20 */ ENHY_ANIM_BOJ_20, + /* 21 */ ENHY_ANIM_MAX } EnHyAnimation; typedef void (*EnHyActionFunc)(struct EnHy*, PlayState*); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index fdd334b6e6..9ecaba91f7 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4293,18 +4293,18 @@ s16 func_800BDB6C(Actor* actor, PlayState* play, s16 arg2, f32 arg3) { return arg2; } -void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index) { +void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 animIndex) { f32 frameCount; - animation += index; - if (animation->frameCount > 0.0f) { - frameCount = animation->frameCount; + animationInfo += animIndex; + if (animationInfo->frameCount > 0.0f) { + frameCount = animationInfo->frameCount; } else { - frameCount = Animation_GetLastFrame(&animation->animation->common); + frameCount = Animation_GetLastFrame(&animationInfo->animation->common); } - Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, frameCount, - animation->mode, animation->morphFrames); + Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, + frameCount, animationInfo->mode, animationInfo->morphFrames); } // Unused diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index 6549ed9e19..5e32e5c950 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -11,7 +11,7 @@ #include "objects/object_boj/object_boj.h" #include "objects/object_os_anime/object_os_anime.h" -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gMamamuYanUnusedIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_boj_Anim_001494, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_boj_Anim_001494, 1.0f, 0, -1, ANIMMODE_LOOP, -8 }, @@ -45,15 +45,15 @@ s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) { s16 frameCount; s32 isChanged = false; - if (animIndex >= ENHY_ANIMATION_AOB_0 && animIndex < ENHY_ANIMATION_MAX) { + if (animIndex >= ENHY_ANIM_AOB_0 && animIndex < ENHY_ANIM_MAX) { isChanged = true; - frameCount = sAnimations[animIndex].frameCount; + frameCount = sAnimationInfo[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(&sAnimations[animIndex].animation->common); + frameCount = Animation_GetLastFrame(&sAnimationInfo[animIndex].animation->common); } - Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, - sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode, - sAnimations[animIndex].morphFrames); + Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed, + sAnimationInfo[animIndex].startFrame, frameCount, sAnimationInfo[animIndex].mode, + sAnimationInfo[animIndex].morphFrames); } return isChanged; } diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index a223576245..8321a309ee 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -924,30 +924,30 @@ s16 Animation_GetLastFrame2(LegacyAnimationHeader* animation) { } /** - * Linearly interpolates the start and tactoret frame tables with the given weight, putting the result in dst + * Linearly interpolates the start and target frame tables with the given weight, putting the result in dst */ -void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s* tactoret, f32 weight) { +void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s* target, f32 weight) { s32 i; s16 diff; s16 base; if (weight < 1.0f) { - for (i = 0; i < limbCount; i++, dst++, start++, tactoret++) { + for (i = 0; i < limbCount; i++, dst++, start++, target++) { base = start->x; - diff = tactoret->x - base; + diff = target->x - base; dst->x = (s16)(diff * weight) + base; base = start->y; - diff = tactoret->y - base; + diff = target->y - base; dst->y = (s16)(diff * weight) + base; base = start->z; - diff = tactoret->z - base; + diff = target->z - base; dst->z = (s16)(diff * weight) + base; } } else { - for (i = 0; i < limbCount; i++, dst++, tactoret++) { - dst->x = tactoret->x; - dst->y = tactoret->y; - dst->z = tactoret->z; + for (i = 0; i < limbCount; i++, dst++, target++) { + dst->x = target->x; + dst->y = target->y; + dst->z = target->z; } } } diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index afc7f71687..efc6774a7e 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -531,24 +531,24 @@ Actor* SubS_FindNearestActor(Actor* actor, PlayState* play, u8 actorCategory, s1 return closestActor; } -s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index) { +s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex) { s32 endFrame; s32 startFrame; - animations += index; - endFrame = animations->frameCount; - if (animations->frameCount < 0) { - endFrame = Animation_GetLastFrame(&animations->animation->common); + animationInfo += animIndex; + endFrame = animationInfo->frameCount; + if (animationInfo->frameCount < 0) { + endFrame = Animation_GetLastFrame(&animationInfo->animation->common); } - startFrame = animations->startFrame; + startFrame = animationInfo->startFrame; if (startFrame >= endFrame || startFrame < 0) { return false; } - if (animations->playSpeed < 0.0f) { + if (animationInfo->playSpeed < 0.0f) { SWAP(s32, endFrame, startFrame); } - Animation_Change(skelAnime, animations->animation, animations->playSpeed, startFrame, endFrame, animations->mode, - animations->morphFrames); + Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, startFrame, endFrame, + animationInfo->mode, animationInfo->morphFrames); return true; } @@ -1357,21 +1357,21 @@ s32 SubS_ActorPathing_SetNextPoint(PlayState* play, ActorPathing* actorPath) { return reupdate; } -void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex, - s32* curIndex) { - AnimationSpeedInfo* animation = &animations[nextIndex]; +void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animationInfo, s32 nextAnimIndex, + s32* curAnimIndex) { + AnimationSpeedInfo* animation = &animationInfo[nextAnimIndex]; f32 startFrame = skelAnime->curFrame; f32 endFrame; f32 morphFrames; - if ((*curIndex < 0) || (nextIndex == *curIndex)) { + if ((*curAnimIndex < 0) || (nextAnimIndex == *curAnimIndex)) { morphFrames = 0.0f; - if (*curIndex < 0) { + if (*curAnimIndex < 0) { startFrame = 0.0f; } } else { morphFrames = animation->morphFrames; - if (nextIndex != *curIndex) { + if (nextAnimIndex != *curAnimIndex) { startFrame = 0.0f; } } @@ -1383,7 +1383,7 @@ void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* a } Animation_Change(skelAnime, animation->animation, animation->playSpeed, startFrame, endFrame, animation->mode, morphFrames); - *curIndex = nextIndex; + *curAnimIndex = nextAnimIndex; } s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type) { diff --git a/src/overlays/actors/ovl_Dm_Al/z_dm_al.c b/src/overlays/actors/ovl_Dm_Al/z_dm_al.c index ce3e18ab22..6c7a1be690 100644 --- a/src/overlays/actors/ovl_Dm_Al/z_dm_al.c +++ b/src/overlays/actors/ovl_Dm_Al/z_dm_al.c @@ -27,16 +27,21 @@ const ActorInit Dm_Al_InitVars = { (ActorFunc)DmAl_Draw, }; -static AnimationInfoS sAnimationInfos[] = { +typedef enum { + /* 0 */ MADAME_AROMA_ANIM_0, + /* 1 */ MADAME_AROMA_ANIM_1 +} DmAlAnimation; + +static AnimationInfoS sAnimationInfo[] = { { &object_al_Anim_00DBE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; -s32 DmAl_ChangeAnimation(DmAl* this, s32 animationIndex) { +s32 DmAl_ChangeAnim(DmAl* this, s32 animIndex) { s32 didAnimationChange = false; - if (animationIndex != this->animationIndex) { - this->animationIndex = animationIndex; - didAnimationChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfos, animationIndex); + if (animIndex != this->animIndex) { + this->animIndex = animIndex; + didAnimationChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); } return didAnimationChange; } @@ -50,20 +55,20 @@ void func_80C1BDD8(DmAl* this, PlayState* play) { if (!this->unk_45C) { this->action = 0xFF; this->unk_45C = true; - this->animationIndex2 = this->animationIndex; + this->animIndex2 = this->animIndex; } if (Cutscene_CheckActorAction(play, 0x232)) { actionIndex = Cutscene_GetActorActionIndex(play, 0x232); csAction = play->csCtx.actorActions[actionIndex]->action; if (this->action != (u8)csAction) { this->action = csAction; - DmAl_ChangeAnimation(this, D_80C1C280[csAction]); + DmAl_ChangeAnim(this, D_80C1C280[csAction]); } Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); } } else if (this->unk_45C) { this->unk_45C = false; - DmAl_ChangeAnimation(this, this->animationIndex2); + DmAl_ChangeAnim(this, this->animIndex2); } } @@ -73,8 +78,8 @@ void DmAl_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gMadameAromaSkel, NULL, this->jointTable, this->morphTable, MADAME_AROMA_LIMB_MAX); - this->animationIndex = -1; - DmAl_ChangeAnimation(this, MADAME_AROMA_ANIMATION_0); + this->animIndex = -1; + DmAl_ChangeAnim(this, MADAME_AROMA_ANIM_0); this->actor.flags &= ~ACTOR_FLAG_1; Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80C1BDD8; diff --git a/src/overlays/actors/ovl_Dm_Al/z_dm_al.h b/src/overlays/actors/ovl_Dm_Al/z_dm_al.h index f15513177c..8f89a4448b 100644 --- a/src/overlays/actors/ovl_Dm_Al/z_dm_al.h +++ b/src/overlays/actors/ovl_Dm_Al/z_dm_al.h @@ -16,16 +16,11 @@ typedef struct DmAl { /* 0x30C */ Vec3s jointTable[MADAME_AROMA_LIMB_MAX]; /* 0x3AE */ Vec3s morphTable[MADAME_AROMA_LIMB_MAX]; /* 0x450 */ u8 action; - /* 0x454 */ s32 animationIndex; - /* 0x458 */ s32 animationIndex2; + /* 0x454 */ s32 animIndex; + /* 0x458 */ s32 animIndex2; /* 0x45C */ s32 unk_45C; } DmAl; // size = 0x460 -typedef enum { - /* 0x0 */ MADAME_AROMA_ANIMATION_0, - /* 0x1 */ MADAME_AROMA_ANIMATION_1 -} DmAlAnimations; - extern const ActorInit Dm_Al_InitVars; #endif // Z_DM_AL_H diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.c b/src/overlays/actors/ovl_Dm_An/z_dm_an.c index aec59f0326..64b6a7a98a 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.c +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.c @@ -33,7 +33,7 @@ const ActorInit Dm_An_InitVars = { (ActorFunc)NULL, }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, @@ -83,7 +83,7 @@ s32 func_80C1C4D8(DmAn* this, PlayState* play, s32 arg2) { if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment); this->unk_2C8 = arg2; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment); } return ret; diff --git a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c index e6864bf3e1..04dd13ca45 100644 --- a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c +++ b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c @@ -30,7 +30,7 @@ const ActorInit Dm_Bal_InitVars = { (ActorFunc)DmBal_Draw, }; -static AnimationInfo D_80C1F170[] = { +static AnimationInfo sAnimationInfo[] = { { &object_bal_Anim_0005FC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &object_bal_Anim_000840, 1.5f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &object_bal_Anim_000840, 1.5f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, @@ -86,14 +86,14 @@ void func_80C1EAE8(DmBal* this, PlayState* play) { case 1: this->unk_336 = 0; this->eyeIndex = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_80C1F170, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); break; case 2: this->unk_336 = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_80C1F170, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12); break; case 3: - Actor_ChangeAnimationByInfo(&this->skelAnime, D_80C1F170, 13); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 13); break; } } else if (D_80C1F2C0 == 3) { diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c index 5efd088ae8..177c5784dc 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c @@ -32,7 +32,7 @@ const ActorInit Dm_Char00_InitVars = { (ActorFunc)DmChar00_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gameplay_keep_Anim_02B2E8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &gameplay_keep_Anim_029140, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_delf_Anim_004FF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, @@ -542,7 +542,7 @@ void DmChar00_Init(Actor* thisx, PlayState* play) { SkelAnime_Init(play, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, this->jointTable, this->morphTable, 7); ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f); - func_80AA5580(&this->skelAnime, sAnimations, 0); + func_80AA5580(&this->skelAnime, sAnimationInfo, 0); Actor_SetScale(thisx, 0.01f); this->actionFunc = func_80AA67F8; } @@ -783,7 +783,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { this->unk_261 = 0; break; } - func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0); + func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); } } Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0); @@ -796,7 +796,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { case 0x4: case 0x5: this->unk_261 += 4; - func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0); + func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); this->skelAnime.curFrame = 37.0f; break; @@ -805,7 +805,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { case 0x14: case 0x15: this->unk_261 += 2; - func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0); + func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); break; case 0xA: @@ -833,18 +833,18 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { case 0x50: case 0x53: this->unk_261 += 1; - func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0); + func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); break; case 0x2D: this->unk_261 = 19; - func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0); + func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); break; case 0x46: case 0x4D: this->unk_261 = 0; - func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0); + func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); break; } } @@ -856,7 +856,7 @@ void func_80AA67F8(DmChar00* this, PlayState* play) { if ((play->csCtx.state == 0) && (gSaveContext.sceneSetupIndex == 0) && (play->csCtx.currentCsIndex == 1)) { if (this->unk_261 != 42) { this->unk_261 = 42; - func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0); + func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); } Math_SmoothStepToF(&this->actor.world.pos.x, 0.0f, 0.5f, 0.5f, 0.001f); @@ -865,7 +865,7 @@ void func_80AA67F8(DmChar00* this, PlayState* play) { if (player->actor.world.pos.z < -625.0f) { this->unk_261 = 43; - func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0); + func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); this->actionFunc = func_80AA695C; this->skelAnime.playSpeed = 1.5f; } diff --git a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c index 1844783ff5..5a66958169 100644 --- a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c +++ b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c @@ -32,32 +32,32 @@ const ActorInit Dm_Char02_InitVars = { }; typedef enum { - /* 0 */ DMCHAR02_ANIMATION_HIT_GROUND, - /* 1 */ DMCHAR02_ANIMATION_TURN_AROUND, - /* 2 */ DMCHAR02_ANIMATION_JUGGLE, - /* 3 */ DMCHAR02_ANIMATION_FALL, -} DmChar02AnimationIndex; + /* 0 */ DMCHAR02_ANIM_HIT_GROUND, + /* 1 */ DMCHAR02_ANIM_TURN_AROUND, + /* 2 */ DMCHAR02_ANIM_JUGGLE, + /* 3 */ DMCHAR02_ANIM_FALL, +} DmChar02Animation; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gClockTowerOcarinaOfTimeHitGroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, { &gClockTowerOcarinaOfTimeTurnAroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, { &gClockTowerOcarinaOfTimeJuggleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, { &gClockTowerOcarinaOfTimeFallAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, }; -void DmChar02_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo* animation, u16 index) { +void DmChar02_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) { f32 frameCount; - animation += index; + animationInfo += animIndex; - if (animation->frameCount < 0.0f) { - frameCount = Animation_GetLastFrame(animation->animation); + if (animationInfo->frameCount < 0.0f) { + frameCount = Animation_GetLastFrame(animationInfo->animation); } else { - frameCount = animation->frameCount; + frameCount = animationInfo->frameCount; } - Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, frameCount, - animation->mode, animation->morphFrames); + Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, + frameCount, animationInfo->mode, animationInfo->morphFrames); } void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play) { @@ -84,11 +84,11 @@ void DmChar02_Init(Actor* thisx, PlayState* play) { DmChar02* this = THIS; if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) { - this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND; + this->animIndex = DMCHAR02_ANIM_HIT_GROUND; this->actor.targetArrowOffset = 3000.0f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gClockTowerOcarinaOfTimeSkel, NULL, NULL, NULL, 0); - DmChar02_ChangeAnimation(&this->skelAnime, sAnimations, 0); + DmChar02_ChangeAnim(&this->skelAnime, sAnimationInfo, 0); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = DmChar02_PerformCutsceneActions; } else { @@ -108,25 +108,25 @@ void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) { if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { switch (play->csCtx.actorActions[actionIndex]->action) { default: - this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND; + this->animIndex = DMCHAR02_ANIM_HIT_GROUND; shouldChangeAnimation = false; break; case 1: - this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND; + this->animIndex = DMCHAR02_ANIM_HIT_GROUND; break; case 2: - this->animIndex = DMCHAR02_ANIMATION_TURN_AROUND; + this->animIndex = DMCHAR02_ANIM_TURN_AROUND; break; case 4: - this->animIndex = DMCHAR02_ANIMATION_FALL; + this->animIndex = DMCHAR02_ANIM_FALL; break; } if (shouldChangeAnimation) { - DmChar02_ChangeAnimation(&this->skelAnime, &sAnimations[this->animIndex], 0); + DmChar02_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } @@ -134,9 +134,9 @@ void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if (this->animIndex == DMCHAR02_ANIMATION_TURN_AROUND) { + if (this->animIndex == DMCHAR02_ANIM_TURN_AROUND) { this->animIndex++; - DmChar02_ChangeAnimation(&this->skelAnime, &sAnimations[this->animIndex], 0); + DmChar02_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } } diff --git a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c index 6c44fb5e68..397fbfa3c0 100644 --- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c +++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c @@ -32,20 +32,20 @@ const ActorInit Dm_Char03_InitVars = { (ActorFunc)DmChar03_Draw, }; -AnimationInfo sAnimations[] = { { &object_osn_Anim_020530, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f } }; +AnimationInfo sAnimationInfo[] = { { &object_osn_Anim_020530, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f } }; -void DmChar03_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 index) { +void DmChar03_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) { f32 frame; - animInfo += index; + animationInfo += animIndex; - if (animInfo->frameCount < 0.0f) { - frame = Animation_GetLastFrame(animInfo->animation); + if (animationInfo->frameCount < 0.0f) { + frame = Animation_GetLastFrame(animationInfo->animation); } else { - frame = animInfo->frameCount; + frame = animationInfo->frameCount; } - Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, frame, animInfo->mode, - animInfo->morphFrames); + Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, frame, + animationInfo->mode, animationInfo->morphFrames); } void DmChar03_Init(Actor* thisx, PlayState* play) { @@ -56,7 +56,7 @@ void DmChar03_Init(Actor* thisx, PlayState* play) { this->unk_18E = false; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gDekuMaskSkel, NULL, NULL, NULL, 0); - DmChar03_ChangeAnimation(&this->skelAnime, sAnimations, 0); + DmChar03_ChangeAnim(&this->skelAnime, sAnimationInfo, 0); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = DmChar03_DoNothing; } @@ -119,7 +119,7 @@ void func_80AAB710(DmChar03* this, PlayState* play) { } if (shouldChangeAnim) { - DmChar03_ChangeAnimation(&this->skelAnime, &sAnimations[this->animIndex], 0); + DmChar03_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } Cutscene_ActorTranslateAndYaw(&this->actor, play, index); diff --git a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c index 6c97624a8f..f7b4b47e84 100644 --- a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c +++ b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c @@ -30,10 +30,10 @@ const ActorInit Dm_Char04_InitVars = { (ActorFunc)DmChar04_Draw, }; -void DmChar04_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animation, u16 index) { +void DmChar04_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animation, u16 animIndex) { f32 endFrame; - animation += index; + animation += animIndex; if (animation->frameCount < 0.0f) { endFrame = Animation_GetLastFrame(animation->animation); @@ -44,7 +44,7 @@ void DmChar04_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animation, u16 ind animation->mode, animation->morphFrames); } -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gameplay_keep_Anim_02B2E8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, { &gameplay_keep_Anim_029140, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, }; @@ -72,7 +72,7 @@ void DmChar04_Init(Actor* thisx, PlayState* play) { SkelAnime_Init(play, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, this->jointTable, this->morphTable, 7); ActorShape_Init(&this->actor.shape, 0.0f, NULL, 15.0f); - DmChar04_ChangeAnim(&this->skelAnime, sAnimations, 0); + DmChar04_ChangeAnim(&this->skelAnime, sAnimationInfo, 0); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80AABE34; } @@ -90,11 +90,11 @@ void func_80AABE34(DmChar04* this, PlayState* play) { if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { this->csAction = play->csCtx.actorActions[actionIndex]->action; if (play->csCtx.actorActions[actionIndex]->action == 1) { - this->animationIndex = 0; + this->animIndex = 0; } else { - this->animationIndex = 0; + this->animIndex = 0; } - DmChar04_ChangeAnim(&this->skelAnime, &sAnimations[this->animationIndex], 0); + DmChar04_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); diff --git a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h index 91de6d567f..42c4a8501d 100644 --- a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h +++ b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h @@ -16,7 +16,7 @@ typedef struct DmChar04 { /* 0x240 */ Color_RGBAf primColors; /* 0x250 */ Color_RGBAf envColors; /* 0x260 */ u8 csAction; - /* 0x261 */ u8 animationIndex; + /* 0x261 */ u8 animIndex; /* 0x262 */ u16 timer; } DmChar04; // size = 0x264 diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c index 40807c77c3..44e5732add 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c @@ -47,7 +47,7 @@ const ActorInit Dm_Char05_InitVars = { (ActorFunc)DmChar05_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_dmask_Anim_001090, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dmask_Anim_004288, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dmask_Anim_0001A8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, @@ -76,9 +76,9 @@ void func_80AAC63C(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_010B0, NULL, NULL, NULL, 0); if (DMCHAR05_GET(&this->actor) == DMCHAR05_0) { - func_80AAC5A0(&this->skelAnime, &sAnimations[0], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[0], 0); } else { - func_80AAC5A0(&this->skelAnime, &sAnimations[1], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[1], 0); } this->actionFunc = func_80AACC48; } @@ -88,7 +88,7 @@ void func_80AAC6E4(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_042B0, NULL, NULL, NULL, 0); - func_80AAC5A0(&this->skelAnime, &sAnimations[1], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[1], 0); this->actionFunc = func_80AACC48; } @@ -97,7 +97,7 @@ void func_80AAC770(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_dmask_Skel_001D0, NULL, NULL, NULL, 0); - func_80AAC5A0(&this->skelAnime, &sAnimations[3], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[3], 0); this->actionFunc = func_80AACC48; } @@ -106,7 +106,7 @@ void func_80AAC7FC(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_013D0, NULL, NULL, NULL, 0); - func_80AAC5A0(&this->skelAnime, &sAnimations[4], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[4], 0); this->actionFunc = func_80AACC48; } @@ -347,7 +347,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } if (sp2F) { - func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0); } } @@ -391,7 +391,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } if (sp2F) { - func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0); } } @@ -434,7 +434,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } if (sp2F) { - func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0); } } @@ -470,7 +470,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } if (sp2F) { - func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0); } } @@ -484,7 +484,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (this->unk_18C == 4) { this->unk_18C++; - func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0); + func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0); } } break; diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c index 823aa7fa28..2b9c62e190 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c @@ -33,7 +33,7 @@ const ActorInit Dm_Gm_InitVars = { (ActorFunc)NULL, }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, @@ -83,7 +83,7 @@ s32 func_80C24428(DmGm* this, PlayState* play, s32 arg2) { if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment); this->unk_2C8 = arg2; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment); } return ret; diff --git a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c index 30cf308b62..3dcde37874 100644 --- a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c +++ b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c @@ -28,14 +28,14 @@ const ActorInit Dm_Nb_InitVars = { (ActorFunc)DmNb_Draw, }; -static AnimationInfoS D_80C1E200[] = { { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 } }; +static AnimationInfoS sAnimationInfo[] = { { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 } }; s32 func_80C1DED0(DmNb* this, s32 arg1) { s32 ret = false; if (arg1 != this->unk1F0) { this->unk1F0 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80C1E200, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); } return ret; } diff --git a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c index aaaeea362a..d9f775f6a2 100644 --- a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c +++ b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c @@ -30,7 +30,7 @@ const ActorInit Dm_Sa_InitVars = { (ActorFunc)DmSa_Draw, }; -static AnimationInfo D_80A2ED00[] = { { &gSkullKidTPoseAnim, 1.0f, 0, -1.0f, ANIMMODE_LOOP, 0 } }; +static AnimationInfo sAnimationInfo[] = { { &gSkullKidTPoseAnim, 1.0f, 0, -1.0f, ANIMMODE_LOOP, 0 } }; void func_80A2E960(SkelAnime* arg0, AnimationInfo* animations, u16 index) { f32 frameCount; @@ -53,7 +53,7 @@ void DmSa_Init(Actor* thisx, PlayState* play) { this->actor.targetArrowOffset = 3000.0f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gSkullKidSkel, NULL, NULL, NULL, 0); - func_80A2E960(&this->skelAnime, D_80A2ED00, 0); + func_80A2E960(&this->skelAnime, sAnimationInfo, 0); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = DmSa_DoNothing; } diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index a27cb4bd1c..1417d8094c 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -37,79 +37,79 @@ void DmStk_ClockTower_IdleWithOcarina(DmStk* this, PlayState* play); void DmStk_ClockTower_Idle(DmStk* this, PlayState* play); typedef enum { - /* 0 */ SK_ANIMATION_SHAKE_HEAD, - /* 1 */ SK_ANIMATION_WALK, - /* 2 */ SK_ANIMATION_LOOK_AROUND, // Not used in the final game - /* 3 */ SK_ANIMATION_IDLE, - /* 4 */ SK_ANIMATION_UNUSED_IDLE, // Unused duplicate of SK_ANIMATION_IDLE - /* 5 */ SK_ANIMATION_BENT_OVER_HEAD_TWITCH, - /* 6 */ SK_ANIMATION_GLITCHY_HORSE_RIDE_START, // Not used in the final game - /* 7 */ SK_ANIMATION_RECLINING_FLOAT, - /* 8 */ SK_ANIMATION_CURSE_START, - /* 9 */ SK_ANIMATION_CURSE_LOOP, - /* 10 */ SK_ANIMATION_LAUGH_START, - /* 11 */ SK_ANIMATION_LAUGH_LOOP, - /* 12 */ SK_ANIMATION_HIDE_OCARINA_START, - /* 13 */ SK_ANIMATION_HIDE_OCARINA_LOOP, - /* 14 */ SK_ANIMATION_PICK_UP_OCARINA_AND_START_PLAYING, - /* 15 */ SK_ANIMATION_PLAY_OCARINA_AND_LAUGH, - /* 16 */ SK_ANIMATION_PICK_UP_OCARINA, // Not used in the final game - /* 17 */ SK_ANIMATION_LOOK_AT_OCARINA, // Not used in the final game - /* 18 */ SK_ANIMATION_KICK_OVER_LINK, - /* 19 */ SK_ANIMATION_SEARCH_LINK, - /* 20 */ SK_ANIMATION_UNUSED_KICK_OVER_LINK, // Unused duplicate of SK_ANIMATION_KICK_OVER_LINK - /* 21 */ SK_ANIMATION_UNUSED_SEARCH_LINK, // Unused duplicate of SK_ANIMATION_SEARCH_LINK - /* 22 */ SK_ANIMATION_HORSE_RIDE_START, - /* 23 */ SK_ANIMATION_HORSE_RIDE_LOOP, - /* 24 */ SK_ANIMATION_RAISE_MASK_START, - /* 25 */ SK_ANIMATION_RAISE_MASK_LOOP, - /* 26 */ SK_ANIMATION_LOWER_MASK, - /* 27 */ SK_ANIMATION_JUMP_WHILE_HIDING_OCARINA, - /* 28 */ SK_ANIMATION_HORSE_RIDE_AND_ROTATE, // Used when Link gets thrown off his horse - /* 29 */ SK_ANIMATION_PLAY_OCARINA_WHILE_FLOATING, - /* 30 */ SK_ANIMATION_FLOATING_TURN_AROUND, - /* 31 */ SK_ANIMATION_OCARINA_JUGGLE, - /* 32 */ SK_ANIMATION_CALL_DOWN_MOON_START, - /* 33 */ SK_ANIMATION_CALL_DOWN_MOON_LOOP, - /* 34 */ SK_ANIMATION_SMACK_FAIRY_START, - /* 35 */ SK_ANIMATION_SMACK_FAIRY_LOOP, - /* 36 */ SK_ANIMATION_HIT_BY_BUBBLE, - /* 37 */ SK_ANIMATION_DROP_OCARINA, - /* 38 */ SK_ANIMATION_FLOATING_ARMS_CROSSED, - /* 39 */ SK_ANIMATION_DEFLECT_ATTACK, - /* 40 */ SK_ANIMATION_TELESCOPE_LOOK_UP_START, - /* 41 */ SK_ANIMATION_TELESCOPE_LOOK_UP_LOOP, - /* 42 */ SK_ANIMATION_SURPRISE_START, - /* 43 */ SK_ANIMATION_SURPRISE_LOOP, - /* 44 */ SK_ANIMATION_LOOK_AROUND_FOR_GIANTS_START, - /* 45 */ SK_ANIMATION_LOOK_AROUND_FOR_GIANTS_LOOP, - /* 46 */ SK_ANIMATION_HOLD_HEAD_AND_SHAKE_START, - /* 47 */ SK_ANIMATION_HOLD_HEAD_AND_SHAKE_LOOP, - /* 48 */ SK_ANIMATION_HOLD_HEAD_AND_SCREAM_START, - /* 49 */ SK_ANIMATION_HOLD_HEAD_AND_SCREAM_LOOP, - /* 50 */ SK_ANIMATION_HUDDLE_WITH_FAIRIES, - /* 51 */ SK_ANIMATION_SEARCH_MASK_SALESMAN, - /* 52 */ SK_ANIMATION_HOLD_UP_MASK_START, - /* 53 */ SK_ANIMATION_HOLD_UP_MASK_LOOP, - /* 54 */ SK_ANIMATION_SHIVER, - /* 55 */ SK_ANIMATION_DRAW, - /* 56 */ SK_ANIMATION_BENT_OVER_LOOK_UP, - /* 57 */ SK_ANIMATION_SPANK, - /* 58 */ SK_ANIMATION_HIP_SHAKE_AND_JUMP, - /* 59 */ SK_ANIMATION_PLAY_FLUTE, - /* 60 */ SK_ANIMATION_CARTWHEEL, - /* 61 */ SK_ANIMATION_LIE_FLAT, - /* 62 */ SK_ANIMATION_DANGLE_FROM_MASK_START, - /* 63 */ SK_ANIMATION_DANGLE_FROM_MASK_LOOP, - /* 64 */ SK_ANIMATION_DROPPED_FROM_MASK, - /* 65 */ SK_ANIMATION_LOOK_UP_AT_GIANTS, - /* 66 */ SK_ANIMATION_ASHAMED_START, - /* 67 */ SK_ANIMATION_ASHAMED_LOOP, - /* 68 */ SK_ANIMATION_LOOK_LEFT_START, - /* 69 */ SK_ANIMATION_LOOK_LEFT_LOOP, - /* 70 */ SK_ANIMATION_SNIFF, - /* 71 */ SK_ANIMATION_LAUGH_AFTER_SNIFF, -} SkullKidAnimationIndex; + /* 0 */ SK_ANIM_SHAKE_HEAD, + /* 1 */ SK_ANIM_WALK, + /* 2 */ SK_ANIM_LOOK_AROUND, // Not used in the final game + /* 3 */ SK_ANIM_IDLE, + /* 4 */ SK_ANIM_UNUSED_IDLE, // Unused duplicate of SK_ANIM_IDLE + /* 5 */ SK_ANIM_BENT_OVER_HEAD_TWITCH, + /* 6 */ SK_ANIM_GLITCHY_HORSE_RIDE_START, // Not used in the final game + /* 7 */ SK_ANIM_RECLINING_FLOAT, + /* 8 */ SK_ANIM_CURSE_START, + /* 9 */ SK_ANIM_CURSE_LOOP, + /* 10 */ SK_ANIM_LAUGH_START, + /* 11 */ SK_ANIM_LAUGH_LOOP, + /* 12 */ SK_ANIM_HIDE_OCARINA_START, + /* 13 */ SK_ANIM_HIDE_OCARINA_LOOP, + /* 14 */ SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING, + /* 15 */ SK_ANIM_PLAY_OCARINA_AND_LAUGH, + /* 16 */ SK_ANIM_PICK_UP_OCARINA, // Not used in the final game + /* 17 */ SK_ANIM_LOOK_AT_OCARINA, // Not used in the final game + /* 18 */ SK_ANIM_KICK_OVER_LINK, + /* 19 */ SK_ANIM_SEARCH_LINK, + /* 20 */ SK_ANIM_UNUSED_KICK_OVER_LINK, // Unused duplicate of SK_ANIM_KICK_OVER_LINK + /* 21 */ SK_ANIM_UNUSED_SEARCH_LINK, // Unused duplicate of SK_ANIM_SEARCH_LINK + /* 22 */ SK_ANIM_HORSE_RIDE_START, + /* 23 */ SK_ANIM_HORSE_RIDE_LOOP, + /* 24 */ SK_ANIM_RAISE_MASK_START, + /* 25 */ SK_ANIM_RAISE_MASK_LOOP, + /* 26 */ SK_ANIM_LOWER_MASK, + /* 27 */ SK_ANIM_JUMP_WHILE_HIDING_OCARINA, + /* 28 */ SK_ANIM_HORSE_RIDE_AND_ROTATE, // Used when Link gets thrown off his horse + /* 29 */ SK_ANIM_PLAY_OCARINA_WHILE_FLOATING, + /* 30 */ SK_ANIM_FLOATING_TURN_AROUND, + /* 31 */ SK_ANIM_OCARINA_JUGGLE, + /* 32 */ SK_ANIM_CALL_DOWN_MOON_START, + /* 33 */ SK_ANIM_CALL_DOWN_MOON_LOOP, + /* 34 */ SK_ANIM_SMACK_FAIRY_START, + /* 35 */ SK_ANIM_SMACK_FAIRY_LOOP, + /* 36 */ SK_ANIM_HIT_BY_BUBBLE, + /* 37 */ SK_ANIM_DROP_OCARINA, + /* 38 */ SK_ANIM_FLOATING_ARMS_CROSSED, + /* 39 */ SK_ANIM_DEFLECT_ATTACK, + /* 40 */ SK_ANIM_TELESCOPE_LOOK_UP_START, + /* 41 */ SK_ANIM_TELESCOPE_LOOK_UP_LOOP, + /* 42 */ SK_ANIM_SURPRISE_START, + /* 43 */ SK_ANIM_SURPRISE_LOOP, + /* 44 */ SK_ANIM_LOOK_AROUND_FOR_GIANTS_START, + /* 45 */ SK_ANIM_LOOK_AROUND_FOR_GIANTS_LOOP, + /* 46 */ SK_ANIM_HOLD_HEAD_AND_SHAKE_START, + /* 47 */ SK_ANIM_HOLD_HEAD_AND_SHAKE_LOOP, + /* 48 */ SK_ANIM_HOLD_HEAD_AND_SCREAM_START, + /* 49 */ SK_ANIM_HOLD_HEAD_AND_SCREAM_LOOP, + /* 50 */ SK_ANIM_HUDDLE_WITH_FAIRIES, + /* 51 */ SK_ANIM_SEARCH_MASK_SALESMAN, + /* 52 */ SK_ANIM_HOLD_UP_MASK_START, + /* 53 */ SK_ANIM_HOLD_UP_MASK_LOOP, + /* 54 */ SK_ANIM_SHIVER, + /* 55 */ SK_ANIM_DRAW, + /* 56 */ SK_ANIM_BENT_OVER_LOOK_UP, + /* 57 */ SK_ANIM_SPANK, + /* 58 */ SK_ANIM_HIP_SHAKE_AND_JUMP, + /* 59 */ SK_ANIM_PLAY_FLUTE, + /* 60 */ SK_ANIM_CARTWHEEL, + /* 61 */ SK_ANIM_LIE_FLAT, + /* 62 */ SK_ANIM_DANGLE_FROM_MASK_START, + /* 63 */ SK_ANIM_DANGLE_FROM_MASK_LOOP, + /* 64 */ SK_ANIM_DROPPED_FROM_MASK, + /* 65 */ SK_ANIM_LOOK_UP_AT_GIANTS, + /* 66 */ SK_ANIM_ASHAMED_START, + /* 67 */ SK_ANIM_ASHAMED_LOOP, + /* 68 */ SK_ANIM_LOOK_LEFT_START, + /* 69 */ SK_ANIM_LOOK_LEFT_LOOP, + /* 70 */ SK_ANIM_SNIFF, + /* 71 */ SK_ANIM_LAUGH_AFTER_SNIFF, +} SkullKidAnimation; typedef enum { /* 0 */ SK_MASK_TYPE_NO_MASK, @@ -219,7 +219,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gSkullKidShakeHeadAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, { &gSkullKidWalkAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, { &gSkullKidLookAroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, @@ -300,13 +300,11 @@ static AnimationInfo sAnimations[] = { void DmStk_LoadObjectForAnimation(DmStk* this, PlayState* play) { s32 objectIndex; - if (((this->animIndex >= SK_ANIMATION_SHAKE_HEAD) && (this->animIndex <= SK_ANIMATION_BENT_OVER_HEAD_TWITCH)) || - (this->animIndex == SK_ANIMATION_CALL_DOWN_MOON_START) || - (this->animIndex == SK_ANIMATION_CALL_DOWN_MOON_LOOP) || - (this->animIndex == SK_ANIMATION_TELESCOPE_LOOK_UP_START) || - (this->animIndex == SK_ANIMATION_TELESCOPE_LOOK_UP_LOOP)) { + if (((this->animIndex >= SK_ANIM_SHAKE_HEAD) && (this->animIndex <= SK_ANIM_BENT_OVER_HEAD_TWITCH)) || + (this->animIndex == SK_ANIM_CALL_DOWN_MOON_START) || (this->animIndex == SK_ANIM_CALL_DOWN_MOON_LOOP) || + (this->animIndex == SK_ANIM_TELESCOPE_LOOK_UP_START) || (this->animIndex == SK_ANIM_TELESCOPE_LOOK_UP_LOOP)) { objectIndex = this->objectStkObjectIndex; - } else if (this->animIndex >= SK_ANIMATION_LOOK_UP_AT_GIANTS) { + } else if (this->animIndex >= SK_ANIM_LOOK_UP_AT_GIANTS) { objectIndex = this->objectStk3ObjectIndex; } else { objectIndex = this->objectStk2ObjectIndex; @@ -320,16 +318,16 @@ void DmStk_LoadObjectForAnimation(DmStk* this, PlayState* play) { /** * This function is always called with unusedExtraOffset = 0. */ -void DmStk_ChangeAnimation(DmStk* this, PlayState* play, SkelAnime* skelAnime, AnimationInfo* animation, - u16 unusedExtraOffset) { +void DmStk_ChangeAnim(DmStk* this, PlayState* play, SkelAnime* skelAnime, AnimationInfo* animationInfo, + u16 unusedExtraOffset) { DmStk_LoadObjectForAnimation(this, play); - animation += unusedExtraOffset; + animationInfo += unusedExtraOffset; - Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, - (animation->frameCount < 0.0f) ? Animation_GetLastFrame(&animation->animation->common) - : animation->frameCount, - animation->mode, animation->morphFrames); + Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, + (animationInfo->frameCount < 0.0f) ? Animation_GetLastFrame(animationInfo->animation) + : animationInfo->frameCount, + animationInfo->mode, animationInfo->morphFrames); } /** @@ -596,7 +594,7 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(DmStk* this, PlayState* pla break; } - if ((this->animIndex == SK_ANIMATION_OCARINA_JUGGLE) && (play->csCtx.frames < 700)) { + if ((this->animIndex == SK_ANIM_OCARINA_JUGGLE) && (play->csCtx.frames < 700)) { if (Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA1); } else if (Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 40.0f)) { @@ -735,7 +733,7 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) { break; } - if (this->animIndex == SK_ANIMATION_SHAKE_HEAD) { + if (this->animIndex == SK_ANIM_SHAKE_HEAD) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); } @@ -743,12 +741,12 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 28.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); } - } else if (this->animIndex == SK_ANIMATION_LAUGH_AFTER_SNIFF) { + } else if (this->animIndex == SK_ANIM_LAUGH_AFTER_SNIFF) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); } - } else if ((this->animIndex == SK_ANIMATION_SNIFF) && + } else if ((this->animIndex == SK_ANIM_SNIFF) && (Animation_OnFrame(&this->skelAnime, 16.0f) || Animation_OnFrame(&this->skelAnime, 23.0f))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_NOSE); } @@ -984,20 +982,20 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { } } - if (this->animIndex == SK_ANIMATION_WALK) { + if (this->animIndex == SK_ANIM_WALK) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_WALK); } - } else if (this->animIndex == SK_ANIMATION_SEARCH_LINK) { + } else if (this->animIndex == SK_ANIM_SEARCH_LINK) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 20.0f) || Animation_OnFrame(&this->skelAnime, 27.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_CALM_HIT); } - } else if (this->animIndex == SK_ANIMATION_PICK_UP_OCARINA_AND_START_PLAYING) { + } else if (this->animIndex == SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING) { if (Animation_OnFrame(&this->skelAnime, 3.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_PUT_OUT_ITEM); } - } else if (this->animIndex == SK_ANIMATION_PLAY_OCARINA_AND_LAUGH) { + } else if (this->animIndex == SK_ANIM_PLAY_OCARINA_AND_LAUGH) { if (Animation_OnFrame(&this->skelAnime, 14.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_UNSKILLFUL_OCARINA); } @@ -1025,7 +1023,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->tatlMessageTimer = 0; this->deflectCount = 0; this->maskType = SK_MASK_TYPE_NORMAL; - this->animIndex = SK_ANIMATION_IDLE; + this->animIndex = SK_ANIM_IDLE; this->fogR = play->lightCtx.unk7; this->fogG = play->lightCtx.unk8; this->fogB = play->lightCtx.unk9; @@ -1063,7 +1061,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { } } else if (gSaveContext.sceneSetupIndex == 3) { - this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED; + this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED; if (gSaveContext.unk_3DD0[3] == 0) { // This code is called when the Giants fail to stop the moon. // Starts a 1 minute (60 second) timer until the moon falls. @@ -1076,12 +1074,12 @@ void DmStk_Init(Actor* thisx, PlayState* play) { sCylinderInit.base.colType = COLTYPE_WOOD; this->actionFunc = DmStk_ClockTower_Idle; } else { - this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED; + this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED; this->actionFunc = DmStk_ClockTower_DoNothing; } } else { this->dekuPipesCutsceneState = SK_DEKU_PIPES_CS_STATE_READY; - this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED; + this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED; this->actor.world.pos.y = 120.0f; sCylinderInit.base.colType = COLTYPE_WOOD; this->actionFunc = DmStk_ClockTower_Idle; @@ -1100,7 +1098,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->fogN = 996; this->fogF = 1000; this->fogScale = 0.7f; - this->animIndex = SK_ANIMATION_BENT_OVER_HEAD_TWITCH; + this->animIndex = SK_ANIM_BENT_OVER_HEAD_TWITCH; this->actionFunc = DmStk_WaitForTelescope; } else { if ((play->sceneNum == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) { @@ -1124,7 +1122,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->csAction = 99; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gSkullKidSkel, NULL, NULL, NULL, 0); - DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0); + DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); } Actor_SetScale(&this->actor, 0.01f); @@ -1202,9 +1200,9 @@ void DmStk_ClockTower_StartIntroCutsceneVersion1(DmStk* this, PlayState* play) { void DmStk_ClockTower_WaitForIntroCutsceneVersion1ToEnd(DmStk* this, PlayState* play) { if (play->csCtx.state == 0) { - this->animIndex = SK_ANIMATION_CALL_DOWN_MOON_LOOP; + this->animIndex = SK_ANIM_CALL_DOWN_MOON_LOOP; this->handType = SK_HAND_TYPE_HOLDING_OCARINA; - DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0); + DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); this->actionFunc = DmStk_ClockTower_IdleWithOcarina; } } @@ -1220,8 +1218,8 @@ void DmStk_ClockTower_StartIntroCutsceneVersion2(DmStk* this, PlayState* play) { void DmStk_ClockTower_WaitForIntroCutsceneVersion2ToEnd(DmStk* this, PlayState* play) { if (play->csCtx.state == 0) { - this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED; - DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0); + this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED; + DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); this->actionFunc = DmStk_ClockTower_Idle; } } @@ -1281,8 +1279,8 @@ void DmStk_ClockTower_DeflectHit(DmStk* this, PlayState* play) { } } - this->animIndex = SK_ANIMATION_DEFLECT_ATTACK; - DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0); + this->animIndex = SK_ANIM_DEFLECT_ATTACK; + DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); this->actionFunc = DmStk_ClockTower_WaitForDeflectionToEnd; } @@ -1294,8 +1292,8 @@ void DmStk_ClockTower_DeflectHit(DmStk* this, PlayState* play) { void DmStk_ClockTower_WaitForDeflectionToEnd(DmStk* this, PlayState* play) { DmStk_ClockTower_AdjustHeightAndRotation(this, play); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED; - DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0); + this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED; + DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); this->actionFunc = DmStk_ClockTower_Idle; } @@ -1327,96 +1325,96 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { switch (play->csCtx.actorActions[actorActionIndex]->action) { case 0: case 1: - this->animIndex = SK_ANIMATION_IDLE; + this->animIndex = SK_ANIM_IDLE; break; case 2: - this->animIndex = SK_ANIMATION_WALK; + this->animIndex = SK_ANIM_WALK; break; case 3: - this->animIndex = SK_ANIMATION_UNUSED_KICK_OVER_LINK; + this->animIndex = SK_ANIM_UNUSED_KICK_OVER_LINK; break; case 4: - this->animIndex = SK_ANIMATION_KICK_OVER_LINK; + this->animIndex = SK_ANIM_KICK_OVER_LINK; break; case 6: - this->animIndex = SK_ANIMATION_PICK_UP_OCARINA; + this->animIndex = SK_ANIM_PICK_UP_OCARINA; this->handType = SK_HAND_TYPE_HOLDING_OCARINA; break; case 7: - this->animIndex = SK_ANIMATION_PICK_UP_OCARINA_AND_START_PLAYING; + this->animIndex = SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING; this->handType = SK_HAND_TYPE_HOLDING_OCARINA; break; case 8: - this->animIndex = SK_ANIMATION_SHAKE_HEAD; + this->animIndex = SK_ANIM_SHAKE_HEAD; break; case 9: - this->animIndex = SK_ANIMATION_IDLE; + this->animIndex = SK_ANIM_IDLE; this->fadeInState = SK_FADE_IN_STATE_START; break; case 12: - this->animIndex = SK_ANIMATION_HIDE_OCARINA_START; + this->animIndex = SK_ANIM_HIDE_OCARINA_START; this->handType = SK_HAND_TYPE_HOLDING_OCARINA; break; case 13: - this->animIndex = SK_ANIMATION_JUMP_WHILE_HIDING_OCARINA; + this->animIndex = SK_ANIM_JUMP_WHILE_HIDING_OCARINA; this->handType = SK_HAND_TYPE_HOLDING_OCARINA; break; case 14: - this->animIndex = SK_ANIMATION_HORSE_RIDE_START; + this->animIndex = SK_ANIM_HORSE_RIDE_START; break; case 15: - this->animIndex = SK_ANIMATION_HORSE_RIDE_LOOP; + this->animIndex = SK_ANIM_HORSE_RIDE_LOOP; break; case 16: - this->animIndex = SK_ANIMATION_HORSE_RIDE_AND_ROTATE; + this->animIndex = SK_ANIM_HORSE_RIDE_AND_ROTATE; break; case 17: - this->animIndex = SK_ANIMATION_RECLINING_FLOAT; + this->animIndex = SK_ANIM_RECLINING_FLOAT; break; case 18: - this->animIndex = SK_ANIMATION_CURSE_START; + this->animIndex = SK_ANIM_CURSE_START; break; case 19: - this->animIndex = SK_ANIMATION_LAUGH_START; + this->animIndex = SK_ANIM_LAUGH_START; break; case 20: - this->animIndex = SK_ANIMATION_RAISE_MASK_START; + this->animIndex = SK_ANIM_RAISE_MASK_START; break; case 21: - this->animIndex = SK_ANIMATION_LOWER_MASK; + this->animIndex = SK_ANIM_LOWER_MASK; break; case 22: - this->animIndex = SK_ANIMATION_PLAY_OCARINA_WHILE_FLOATING; + this->animIndex = SK_ANIM_PLAY_OCARINA_WHILE_FLOATING; if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) { this->handType = SK_HAND_TYPE_HOLDING_OCARINA; } break; case 23: - this->animIndex = SK_ANIMATION_FLOATING_TURN_AROUND; + this->animIndex = SK_ANIM_FLOATING_TURN_AROUND; this->handType = SK_HAND_TYPE_JUGGLING_OR_DROPPING_OCARINA; break; case 24: - this->animIndex = SK_ANIMATION_CALL_DOWN_MOON_START; + this->animIndex = SK_ANIM_CALL_DOWN_MOON_START; if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) { this->handType = SK_HAND_TYPE_HOLDING_OCARINA; } @@ -1427,148 +1425,148 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { break; case 26: - this->animIndex = SK_ANIMATION_SMACK_FAIRY_START; + this->animIndex = SK_ANIM_SMACK_FAIRY_START; if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) { this->handType = SK_HAND_TYPE_HOLDING_OCARINA; } break; case 27: - this->animIndex = SK_ANIMATION_HIT_BY_BUBBLE; + this->animIndex = SK_ANIM_HIT_BY_BUBBLE; if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) { this->handType = SK_HAND_TYPE_HOLDING_OCARINA; } break; case 28: - this->animIndex = SK_ANIMATION_DROP_OCARINA; + this->animIndex = SK_ANIM_DROP_OCARINA; this->handType = SK_HAND_TYPE_JUGGLING_OR_DROPPING_OCARINA; break; case 30: - this->animIndex = SK_ANIMATION_FLOATING_ARMS_CROSSED; + this->animIndex = SK_ANIM_FLOATING_ARMS_CROSSED; break; case 31: - this->animIndex = SK_ANIMATION_DEFLECT_ATTACK; + this->animIndex = SK_ANIM_DEFLECT_ATTACK; break; case 32: - this->animIndex = SK_ANIMATION_SURPRISE_START; + this->animIndex = SK_ANIM_SURPRISE_START; break; case 33: - this->animIndex = SK_ANIMATION_LOOK_AROUND_FOR_GIANTS_START; + this->animIndex = SK_ANIM_LOOK_AROUND_FOR_GIANTS_START; break; case 34: - this->animIndex = SK_ANIMATION_HOLD_HEAD_AND_SHAKE_START; + this->animIndex = SK_ANIM_HOLD_HEAD_AND_SHAKE_START; break; case 35: - this->animIndex = SK_ANIMATION_HOLD_HEAD_AND_SCREAM_START; + this->animIndex = SK_ANIM_HOLD_HEAD_AND_SCREAM_START; break; case 36: - this->animIndex = SK_ANIMATION_HUDDLE_WITH_FAIRIES; + this->animIndex = SK_ANIM_HUDDLE_WITH_FAIRIES; break; case 37: - this->animIndex = SK_ANIMATION_SEARCH_MASK_SALESMAN; + this->animIndex = SK_ANIM_SEARCH_MASK_SALESMAN; break; case 38: - this->animIndex = SK_ANIMATION_HOLD_UP_MASK_START; + this->animIndex = SK_ANIM_HOLD_UP_MASK_START; break; case 39: - this->animIndex = SK_ANIMATION_SHIVER; + this->animIndex = SK_ANIM_SHIVER; break; case 40: - this->animIndex = SK_ANIMATION_DRAW; + this->animIndex = SK_ANIM_DRAW; break; case 41: - this->animIndex = SK_ANIMATION_TELESCOPE_LOOK_UP_START; + this->animIndex = SK_ANIM_TELESCOPE_LOOK_UP_START; break; case 42: - this->animIndex = SK_ANIMATION_BENT_OVER_HEAD_TWITCH; + this->animIndex = SK_ANIM_BENT_OVER_HEAD_TWITCH; break; case 43: - this->animIndex = SK_ANIMATION_BENT_OVER_LOOK_UP; + this->animIndex = SK_ANIM_BENT_OVER_LOOK_UP; break; case 44: - this->animIndex = SK_ANIMATION_SPANK; + this->animIndex = SK_ANIM_SPANK; break; case 45: - this->animIndex = SK_ANIMATION_HIP_SHAKE_AND_JUMP; + this->animIndex = SK_ANIM_HIP_SHAKE_AND_JUMP; this->fadeOutState = SK_FADE_OUT_STATE_FADING_OUT; break; case 46: this->handType = SK_HAND_TYPE_HOLDING_FLUTE; - this->animIndex = SK_ANIMATION_PLAY_FLUTE; + this->animIndex = SK_ANIM_PLAY_FLUTE; break; case 47: - this->animIndex = SK_ANIMATION_CARTWHEEL; + this->animIndex = SK_ANIM_CARTWHEEL; break; case 48: - this->animIndex = SK_ANIMATION_CARTWHEEL; + this->animIndex = SK_ANIM_CARTWHEEL; break; case 49: - this->animIndex = SK_ANIMATION_LOOK_UP_AT_GIANTS; + this->animIndex = SK_ANIM_LOOK_UP_AT_GIANTS; break; case 50: - this->animIndex = SK_ANIMATION_ASHAMED_START; + this->animIndex = SK_ANIM_ASHAMED_START; break; case 51: - this->animIndex = SK_ANIMATION_LOOK_LEFT_START; + this->animIndex = SK_ANIM_LOOK_LEFT_START; break; case 52: - this->animIndex = SK_ANIMATION_SNIFF; + this->animIndex = SK_ANIM_SNIFF; break; case 53: - this->animIndex = SK_ANIMATION_CARTWHEEL; + this->animIndex = SK_ANIM_CARTWHEEL; break; case 54: - this->animIndex = SK_ANIMATION_LIE_FLAT; + this->animIndex = SK_ANIM_LIE_FLAT; break; case 55: - this->animIndex = SK_ANIMATION_DANGLE_FROM_MASK_START; + this->animIndex = SK_ANIM_DANGLE_FROM_MASK_START; break; case 56: - this->animIndex = SK_ANIMATION_DROPPED_FROM_MASK; + this->animIndex = SK_ANIM_DROPPED_FROM_MASK; break; case 57: - this->animIndex = SK_ANIMATION_LOOK_UP_AT_GIANTS; + this->animIndex = SK_ANIM_LOOK_UP_AT_GIANTS; break; case 58: - this->animIndex = SK_ANIMATION_ASHAMED_START; + this->animIndex = SK_ANIM_ASHAMED_START; break; case 59: - this->animIndex = SK_ANIMATION_LOOK_LEFT_START; + this->animIndex = SK_ANIM_LOOK_LEFT_START; break; case 60: - this->animIndex = SK_ANIMATION_SNIFF; + this->animIndex = SK_ANIM_SNIFF; break; case 5: @@ -1576,11 +1574,11 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { break; default: - this->animIndex = SK_ANIMATION_SHAKE_HEAD; + this->animIndex = SK_ANIM_SHAKE_HEAD; break; } - DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0); + DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } @@ -1645,57 +1643,56 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { switch (this->animIndex) { - case SK_ANIMATION_LOOK_AROUND: - case SK_ANIMATION_CURSE_START: - case SK_ANIMATION_LAUGH_START: - case SK_ANIMATION_HIDE_OCARINA_START: - case SK_ANIMATION_PICK_UP_OCARINA_AND_START_PLAYING: - case SK_ANIMATION_PICK_UP_OCARINA: - case SK_ANIMATION_KICK_OVER_LINK: - case SK_ANIMATION_UNUSED_KICK_OVER_LINK: - case SK_ANIMATION_HORSE_RIDE_START: - case SK_ANIMATION_RAISE_MASK_START: - case SK_ANIMATION_FLOATING_TURN_AROUND: - case SK_ANIMATION_CALL_DOWN_MOON_START: - case SK_ANIMATION_SMACK_FAIRY_START: - case SK_ANIMATION_TELESCOPE_LOOK_UP_START: - case SK_ANIMATION_SURPRISE_START: - case SK_ANIMATION_LOOK_AROUND_FOR_GIANTS_START: - case SK_ANIMATION_HOLD_HEAD_AND_SHAKE_START: - case SK_ANIMATION_HOLD_HEAD_AND_SCREAM_START: - case SK_ANIMATION_HOLD_UP_MASK_START: - case SK_ANIMATION_DANGLE_FROM_MASK_START: - case SK_ANIMATION_ASHAMED_START: - case SK_ANIMATION_LOOK_LEFT_START: - case SK_ANIMATION_SNIFF: + case SK_ANIM_LOOK_AROUND: + case SK_ANIM_CURSE_START: + case SK_ANIM_LAUGH_START: + case SK_ANIM_HIDE_OCARINA_START: + case SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING: + case SK_ANIM_PICK_UP_OCARINA: + case SK_ANIM_KICK_OVER_LINK: + case SK_ANIM_UNUSED_KICK_OVER_LINK: + case SK_ANIM_HORSE_RIDE_START: + case SK_ANIM_RAISE_MASK_START: + case SK_ANIM_FLOATING_TURN_AROUND: + case SK_ANIM_CALL_DOWN_MOON_START: + case SK_ANIM_SMACK_FAIRY_START: + case SK_ANIM_TELESCOPE_LOOK_UP_START: + case SK_ANIM_SURPRISE_START: + case SK_ANIM_LOOK_AROUND_FOR_GIANTS_START: + case SK_ANIM_HOLD_HEAD_AND_SHAKE_START: + case SK_ANIM_HOLD_HEAD_AND_SCREAM_START: + case SK_ANIM_HOLD_UP_MASK_START: + case SK_ANIM_DANGLE_FROM_MASK_START: + case SK_ANIM_ASHAMED_START: + case SK_ANIM_LOOK_LEFT_START: + case SK_ANIM_SNIFF: this->animIndex++; - DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0); + DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); break; - case SK_ANIMATION_LOWER_MASK: - this->animIndex = SK_ANIMATION_IDLE; + case SK_ANIM_LOWER_MASK: + this->animIndex = SK_ANIM_IDLE; this->maskType = SK_MASK_TYPE_NORMAL; this->handType = SK_HAND_TYPE_DEFAULT; - DmStk_ChangeAnimation(this, play, &this->skelAnime, &sAnimations[this->animIndex], 0); + DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); break; } } - if (((this->animIndex == SK_ANIMATION_RAISE_MASK_START) && (this->skelAnime.curFrame >= 16.0f)) || - (this->animIndex == SK_ANIMATION_RAISE_MASK_LOOP) || (this->animIndex == SK_ANIMATION_LOWER_MASK)) { + if (((this->animIndex == SK_ANIM_RAISE_MASK_START) && (this->skelAnime.curFrame >= 16.0f)) || + (this->animIndex == SK_ANIM_RAISE_MASK_LOOP) || (this->animIndex == SK_ANIM_LOWER_MASK)) { this->maskType = SK_MASK_TYPE_RAISED; this->handType = SK_HAND_TYPE_HOLDING_MAJORAS_MASK; - } else if (((this->animIndex >= SK_ANIMATION_HUDDLE_WITH_FAIRIES) && (this->animIndex <= SK_ANIMATION_DRAW)) || - ((this->animIndex >= SK_ANIMATION_PLAY_FLUTE) && (this->animIndex <= SK_ANIMATION_CARTWHEEL)) || + } else if (((this->animIndex >= SK_ANIM_HUDDLE_WITH_FAIRIES) && (this->animIndex <= SK_ANIM_DRAW)) || + ((this->animIndex >= SK_ANIM_PLAY_FLUTE) && (this->animIndex <= SK_ANIM_CARTWHEEL)) || ((play->sceneNum == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 7))) { this->maskType = SK_MASK_TYPE_NO_MASK; - if ((this->animIndex == SK_ANIMATION_HOLD_UP_MASK_START) || - (this->animIndex == SK_ANIMATION_HOLD_UP_MASK_LOOP)) { + if ((this->animIndex == SK_ANIM_HOLD_UP_MASK_START) || (this->animIndex == SK_ANIM_HOLD_UP_MASK_LOOP)) { this->handType = SK_HAND_TYPE_HOLDING_MAJORAS_MASK_AND_FLUTE; } } - if (this->animIndex == SK_ANIMATION_DROPPED_FROM_MASK) { + if (this->animIndex == SK_ANIM_DROPPED_FROM_MASK) { this->maskType = SK_MASK_TYPE_NO_MASK; } } @@ -1747,7 +1744,7 @@ void DmStk_ClockTower_Idle(DmStk* this, PlayState* play) { DmStk_ClockTower_AdjustHeightAndRotation(this, play); this->actor.flags |= ACTOR_FLAG_1; - if (this->animIndex == SK_ANIMATION_CALL_DOWN_MOON_LOOP) { + if (this->animIndex == SK_ANIM_CALL_DOWN_MOON_LOOP) { this->actor.targetArrowOffset = 3100.0f; } else { this->actor.targetArrowOffset = 200.0f; @@ -1764,7 +1761,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) { DmStk* this = THIS; if (DM_STK_GET_TYPE(&this->actor) != DM_STK_TYPE_MAJORAS_MASK) { - if (this->animIndex == SK_ANIMATION_CALL_DOWN_MOON_LOOP) { + if (this->animIndex == SK_ANIM_CALL_DOWN_MOON_LOOP) { Actor_SetFocus(&this->actor, 40.0f); } else { Actor_SetFocus(&this->actor, 6.0f); @@ -1772,7 +1769,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) { DmStk_LoadObjectForAnimation(this, play); - if (this->animIndex != SK_ANIMATION_LIE_FLAT) { + if (this->animIndex != SK_ANIM_LIE_FLAT) { SkelAnime_Update(&this->skelAnime); } @@ -1876,8 +1873,8 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if ((this->animIndex == SK_ANIMATION_LOOK_LEFT_LOOP) || (this->animIndex == SK_ANIMATION_LAUGH_LOOP) || - (this->animIndex == SK_ANIMATION_LAUGH_AFTER_SNIFF)) { + if ((this->animIndex == SK_ANIM_LOOK_LEFT_LOOP) || (this->animIndex == SK_ANIM_LAUGH_LOOP) || + (this->animIndex == SK_ANIM_LAUGH_AFTER_SNIFF)) { gSPDisplayList(POLY_OPA_DISP++, gSkullKidLaughingHeadDL); gSPDisplayList(POLY_OPA_DISP++, gSkullKidLaughingEyesDL); } else { diff --git a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c index 57ef38bf66..47706cb9fa 100644 --- a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c +++ b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c @@ -29,7 +29,7 @@ const ActorInit Dm_Zl_InitVars = { (ActorFunc)DmZl_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gDmZl4FacingAwayHandsOverEmblemLoop, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f }, { &gDmZl4TurningAround2Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, -10.0f }, { &gDmZl4HandsOverEmblemLoopAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f }, @@ -48,7 +48,7 @@ typedef enum { /* 5 */ ZELDA_ANIM_PLAYING_OCARINA_START, /* 6 */ ZELDA_ANIM_PLAYING_OCARINA, /* 7 */ ZELDA_ANIM_MAX, -} DmZlAnimations; +} DmZlAnimation; static TexturePtr sMouthTextures[] = { gZl4MouthNeutralTex, @@ -98,27 +98,28 @@ typedef enum { /** * This function is always called with unusedExtraOffset = 0. */ -void DmZl_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo animation[], u16 unusedExtraOffset) { +void DmZl_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo animationInfo[], u16 unusedExtraOffset) { f32 endFrame; - animation += unusedExtraOffset; - endFrame = (animation->frameCount < 0.0f) ? Animation_GetLastFrame(animation->animation) : animation->frameCount; + animationInfo += unusedExtraOffset; + endFrame = (animationInfo->frameCount < 0.0f) ? Animation_GetLastFrame(animationInfo->animation) + : animationInfo->frameCount; - Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, endFrame, - animation->mode, animation->morphFrames); + Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, endFrame, + animationInfo->mode, animationInfo->morphFrames); } void DmZl_Init(Actor* thisx, PlayState* play) { s32 pad; DmZl* this = THIS; - this->animationIndex = ZELDA_ANIM_FACING_AWAY; + this->animIndex = ZELDA_ANIM_FACING_AWAY; this->unk_2BA = 0; this->actor.targetArrowOffset = 1000.0f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); // these three set to NULL should mean they are dynamically allocated SkelAnime_InitFlex(play, &this->skelAnime, &gZl4Skeleton, NULL, NULL, NULL, 0); - DmZl_ChangeAnimation(&this->skelAnime, &sAnimations[this->animationIndex], 0); + DmZl_ChangeAnimation(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = DmZl_DoNothing; } @@ -135,26 +136,26 @@ void DmZl_UpdateCutscene(DmZl* this, PlayState* play) { if (Cutscene_CheckActorAction(play, 0x66)) { actionIndex = Cutscene_GetActorActionIndex(play, 0x66); if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - s16 nextAnimationIndex = ZELDA_ANIM_FACING_AWAY; + s16 nextAnimIndex = ZELDA_ANIM_FACING_AWAY; switch (play->csCtx.actorActions[actionIndex]->action) { default: case 1: break; case 2: - nextAnimationIndex = ZELDA_ANIM_TURNING_TOWARD_PLAYER; + nextAnimIndex = ZELDA_ANIM_TURNING_TOWARD_PLAYER; break; case 3: - nextAnimationIndex = ZELDA_ANIM_GIVING_OCARINA_START; + nextAnimIndex = ZELDA_ANIM_GIVING_OCARINA_START; break; case 4: - nextAnimationIndex = ZELDA_ANIM_PLAYING_OCARINA_START; + nextAnimIndex = ZELDA_ANIM_PLAYING_OCARINA_START; break; } - if (nextAnimationIndex != this->animationIndex) { - this->animationIndex = nextAnimationIndex; - DmZl_ChangeAnimation(&this->skelAnime, &sAnimations[this->animationIndex], 0); + if (nextAnimIndex != this->animIndex) { + this->animIndex = nextAnimIndex; + DmZl_ChangeAnimation(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } @@ -162,13 +163,13 @@ void DmZl_UpdateCutscene(DmZl* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - actionIndex = this->animationIndex; + actionIndex = this->animIndex; if ((actionIndex == ZELDA_ANIM_TURNING_TOWARD_PLAYER) || (actionIndex == ZELDA_ANIM_GIVING_OCARINA_START) || (actionIndex == ZELDA_ANIM_PLAYING_OCARINA_START)) { // these animations don't loop at the end, they lead into the next animation - this->animationIndex++; - DmZl_ChangeAnimation(&this->skelAnime, &sAnimations[this->animationIndex], 0); + this->animIndex++; + DmZl_ChangeAnimation(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } } @@ -245,7 +246,7 @@ void DmZl_UpdateFace(DmZl* this) { break; } - if (this->animationIndex == ZELDA_ANIM_PLAYING_OCARINA) { + if (this->animIndex == ZELDA_ANIM_PLAYING_OCARINA) { this->eyeTextureIndexLeft = this->eyeTextureIndexRight = ZELDA_EYE_CLOSED; } } @@ -267,8 +268,7 @@ void DmZl_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, DmZl* this = THIS; if (limbIndex == ZL4_LIMB_RIGHT_HAND) { - if ((this->animationIndex >= ZELDA_ANIM_GIVING_OCARINA_START) && - (this->animationIndex <= ZELDA_ANIM_PLAYING_OCARINA)) { + if ((this->animIndex >= ZELDA_ANIM_GIVING_OCARINA_START) && (this->animIndex <= ZELDA_ANIM_PLAYING_OCARINA)) { OPEN_DISPS(play->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, gDmZl4OcarinaDL); diff --git a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h index 1d9a80166d..c267d9ae94 100644 --- a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h +++ b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h @@ -15,7 +15,7 @@ typedef struct DmZl { /* 0x1F4 */ Vec3s morphTable[ZL4_LIMB_MAX]; /* 0x260 */ DmZlActionFunc actionFunc; /* 0x264 */ ColliderCylinder collider; // unused, assumed to be here based on OoT documentation - /* 0x2B0 */ s16 animationIndex; + /* 0x2B0 */ s16 animIndex; /* 0x2B2 */ u8 eyeTextureIndexLeft; /* 0x2B3 */ u8 eyeTextureIndexRight; /* 0x2B4 */ u8 mouthTextureIndex; diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c index bfc6d197bd..bdb6236e53 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -81,7 +81,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_ah_Anim_001860, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_ah_Anim_001860, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_ah_Anim_002280, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -146,7 +146,7 @@ s32 func_80BD2B0C(EnAh* this, s32 arg1) { if (phi_v1) { this->unk_300 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); this->unk_2DC = this->skelAnime.playSpeed; } return ret; diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index faf39aecec..4e7a51c971 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -62,7 +62,7 @@ static ColliderCylinderInitType1 sCylinderInit = { { 27, 32, 0, { 0, 0, 0 } }, }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -1154,7 +1154,7 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { void func_80BEEB20(EnAkindonuts* this, PlayState* play) { s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common); + s16 sp24 = Animation_GetLastFrame(&sAnimationInfo[this->unk_338].animation->common); s16 phi_v0; Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); @@ -1177,7 +1177,7 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) { this->actionFunc = func_80BEEDC0; this->unk_338 = 3; this->collider.dim.height = 64; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); return; } } @@ -1187,19 +1187,19 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) { this->unk_338 = 17; this->collider.dim.height = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 17); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); } else if (this->unk_338 == 2) { this->unk_338 = 16; this->collider.dim.height = 32; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 16); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16); } else if (this->unk_338 == 17) { phi_v0 = DECR(this->unk_33A); if (phi_v0 == 0) { this->unk_33A = Rand_ZeroOne() * 10.0f; this->unk_338 = 2; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 2); } } else if (this->unk_338 == 16) { phi_v0 = DECR(this->unk_33A); @@ -1207,7 +1207,7 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) { this->unk_33A = Rand_S16Offset(40, 40); this->unk_338 = 18; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 18); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 18); } } } @@ -1216,7 +1216,7 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) { void func_80BEEDC0(EnAkindonuts* this, PlayState* play) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { this->actionFunc = func_80BEEE10; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); } } @@ -1234,7 +1234,7 @@ void func_80BEEE10(EnAkindonuts* this, PlayState* play) { } else if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) || !((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { this->unk_338 = 4; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); this->actionFunc = func_80BEEB20; } } @@ -1258,7 +1258,7 @@ void func_80BEEFA8(EnAkindonuts* this, PlayState* play) { play->msgCtx.stateTimer = 4; this->unk_338 = 8; this->unk_33C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338); this->actionFunc = func_80BEF518; } else { this->unk_2DC(this, play); @@ -1296,18 +1296,18 @@ void func_80BEF18C(EnAkindonuts* this, PlayState* play) { void func_80BEF20C(EnAkindonuts* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); s16 sp24 = this->skelAnime.curFrame; - s16 sp22 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common); + s16 sp22 = Animation_GetLastFrame(&sAnimationInfo[this->unk_338].animation->common); if (this->unk_356 == 40) { this->unk_338 = 5; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 5); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 5); } this->unk_356++; if ((sp24 == sp22) && (this->unk_338 == 5)) { this->unk_338 = 6; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 6); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 6); } if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { @@ -1358,7 +1358,7 @@ void func_80BEF4B8(EnAkindonuts* this, PlayState* play) { void func_80BEF518(EnAkindonuts* this, PlayState* play) { s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common); + s16 sp24 = Animation_GetLastFrame(&sAnimationInfo[this->unk_338].animation->common); switch (sp26) { case 10: @@ -1432,7 +1432,7 @@ void func_80BEF518(EnAkindonuts* this, PlayState* play) { if (sp26 == sp24) { this->unk_33E = 3; this->unk_338 = 19; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_32C &= ~2; this->unk_32C |= 0x80; @@ -1465,7 +1465,7 @@ void func_80BEF770(EnAkindonuts* this, PlayState* play) { void func_80BEF83C(EnAkindonuts* this, PlayState* play) { Vec3f sp34; s16 sp32 = this->skelAnime.curFrame; - s16 sp30 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common); + s16 sp30 = Animation_GetLastFrame(&sAnimationInfo[this->unk_338].animation->common); if (sp32 == sp30) { Math_SmoothStepToS(&this->unk_362, 0x1C71, 3, 0x100, 0); @@ -1491,7 +1491,7 @@ void func_80BEF83C(EnAkindonuts* this, PlayState* play) { if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { this->unk_34C = 0.3f; this->unk_338 = 9; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80BEF9F0; } @@ -1510,7 +1510,7 @@ void func_80BEF9F0(EnAkindonuts* this, PlayState* play) { if ((this->actor.home.pos.y + 200.0f) < this->actor.world.pos.y) { Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f); this->unk_338 = 10; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338); if (ENAKINDONUTS_GET_3(&this->actor) == ENAKINDONUTS_3_2) { this->unk_32C |= 0x2; } @@ -1613,7 +1613,7 @@ void EnAkindonuts_Init(Actor* thisx, PlayState* play) { } } - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); this->unk_32C |= 0x2; this->unk_32C |= 0x4; this->unk_338 = 4; diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c index c3b893a5dd..2ab56f795c 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -119,7 +119,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_al_Anim_000C54, 1.0f, 0, -1, 0, -4 }, { &object_al_Anim_00DBE0, 1.0f, 0, -1, 0, 0 }, { &object_al_Anim_00DBE0, 1.0f, 0, -1, 0, -4 }, { &object_al_Anim_00ACA0, 1.0f, 0, -1, 2, 0 }, { &object_al_Anim_00ACA0, -1.0f, 0, -1, 2, 0 }, { &object_al_Anim_00CA28, 1.0f, 0, -1, 0, -4 }, @@ -178,7 +178,7 @@ s32 func_80BDE27C(EnAl* this, s32 arg1) { if (phi_v1) { this->unk_4F8 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); this->unk_4C8 = this->skelAnime.playSpeed; } diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c index 1b11699339..33f8225d35 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c @@ -44,7 +44,7 @@ const ActorInit En_Aob_01_InitVars = { (ActorFunc)EnAob01_Draw, }; -static AnimationInfo D_809C3790[6] = { +static AnimationInfo sAnimationInfo[] = { { &gMamamuYanIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, { &gMamamuYanLaughStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, { &gMamamuYanLaughLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, @@ -144,12 +144,12 @@ void func_809C1304(EnAob01* this, PlayState* play) { s32 func_809C1424(EnAob01* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(D_809C3790[this->unk_43C].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_43C].animation); if (this->unk_43C == 1) { if (curFrame == lastFrame) { this->unk_43C = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); return true; } } else if (this->unk_43C == 2) { @@ -160,18 +160,18 @@ s32 func_809C1424(EnAob01* this) { s32 func_809C14D0(EnAob01* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(D_809C3790[this->unk_43C].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_43C].animation); if ((this->unk_43C == 0) || (this->unk_43C == 5)) { if (curFrame == lastFrame) { this->unk_43C = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); return true; } } else if (this->unk_43C == 3) { if (curFrame == lastFrame) { this->unk_43C = 4; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); return true; } } else if (this->unk_43C == 4) { @@ -182,12 +182,12 @@ s32 func_809C14D0(EnAob01* this) { s32 func_809C15BC(EnAob01* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(D_809C3790[this->unk_43C].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_43C].animation); if ((this->unk_43C != 0) && (this->unk_43C != 5)) { if (curFrame == lastFrame) { this->unk_43C = 5; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); return true; } } else { @@ -329,7 +329,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) { this->unk_2D2 |= 0x40; this->unk_2D2 |= 0x10; this->unk_43C = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; case 0x3525: @@ -344,7 +344,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) { this->unk_2D2 |= 0x40; this->unk_2D2 |= 0x10; this->unk_43C = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; } @@ -359,7 +359,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) { this->unk_2D2 |= 4; this->unk_2D2 |= 0x10; this->unk_43C = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; case 0x3527: @@ -371,7 +371,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) { this->unk_210 = 0x3536; this->unk_2D2 |= 0x40; this->unk_43C = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; } @@ -379,7 +379,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) { this->unk_210 = 0x3537; this->unk_2D2 |= 0x40; this->unk_43C = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; } @@ -556,7 +556,7 @@ void func_809C21E0(EnAob01* this, PlayState* play) { this->unk_2D2 |= 0x10; this->unk_2D2 |= 0x40; this->unk_43C = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Message_StartTextbox(play, 0x354B, &this->actor); } this->unk_2D2 &= ~8; @@ -734,7 +734,7 @@ void func_809C28B8(EnAob01* this, PlayState* play) { this->unk_210 = 0x352D; this->unk_2D2 |= 0x40; this->unk_43C = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; } @@ -930,7 +930,7 @@ void EnAob01_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->unk_43C = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); Actor_SetScale(&this->actor, 0.01f); switch (gSaveContext.eventInf[0] & 7) { 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 6a7bd87ad3..72ca1ba8e9 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 @@ -103,12 +103,12 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animati this->unkToggle28A &= 1; switch (animationState) { // only case 2 and 5 are ever called in AttackNiw - case NIW_ANIMATION_STILL: + case NIW_ANIM_STILL: this->targetLeftWingRotZ = 0.0f; this->targetRightWingRotZ = 0.0f; break; - case NIW_ANIMATION_HEAD_PECKING: + case NIW_ANIM_HEAD_PECKING: this->unkTimer250 = 3; this->targetLeftWingRotZ = 7000.0f; this->targetRightWingRotZ = 7000.0f; @@ -118,7 +118,7 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animati } break; - case NIW_ANIMATION_PECKING_AND_WAVING: + case NIW_ANIM_PECKING_AND_WAVING: this->unkTimer250 = 2; this->targetLeftWingRotZ = -10000.0f; this->targetRightWingRotZ = -10000.0f; @@ -132,7 +132,7 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animati } break; - case NIW_ANIMATION_PECKING_AND_FORFLAPPING: + case NIW_ANIM_PECKING_AND_FORFLAPPING: this->unkTimer250 = 2; this->targetRightWingRotY = 10000.0f; this->targetLeftWingRotY = 10000.0f; @@ -142,12 +142,12 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animati } break; - case NIW_ANIMATION_FREEZE: + case NIW_ANIM_FREEZE: this->unusedTimer24E = 5; this->unkTimer24C = this->unusedTimer24E; break; - case NIW_ANIMATION_PECKING_SLOW_FORFLAPPING: + case NIW_ANIM_PECKING_SLOW_FORFLAPPING: this->unkTimer250 = 5; this->targetRightWingRotY = 14000.0f; this->targetLeftWingRotY = 14000.0f; @@ -276,7 +276,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) { this->unkTimer24C = 10; this->targetBodyRotY = -10000.0f; this->targetHeadRotZ = -3000.0f; - EnAttackNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING); + EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING); } } @@ -325,10 +325,10 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) { this->actionFunc = EnAttackNiw_FlyAway; } else if (this->actor.bgCheckFlags & 1) { // touching floor - EnAttackNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_SLOW_FORFLAPPING); + EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_SLOW_FORFLAPPING); } else { - EnAttackNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING); + EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING); } } @@ -341,7 +341,7 @@ void EnAttackNiw_FlyAway(EnAttackNiw* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.x, this->targetRotX, 5, this->rotStep, 0); Math_ApproachF(&this->rotStep, 5000.0f, 1.0f, 100.0f); Math_ApproachF(&this->actor.velocity.y, 5.0f, 0.3f, 1.0f); - EnAttackNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING); + EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING); } void EnAttackNiw_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Baba/z_en_baba.c b/src/overlays/actors/ovl_En_Baba/z_en_baba.c index ea2f12143a..ad9ee847a6 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c @@ -62,7 +62,7 @@ const ActorInit En_Baba_InitVars = { (ActorFunc)EnBaba_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gBbaIdleHoldingBagAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, { &gBbaIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, { &gBbaWalkingHoldingBagAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, @@ -488,7 +488,7 @@ void EnBaba_HandleSchedule(EnBaba* this, PlayState* play) { this->actor.speedXZ = 0.0f; Enemy_StartFinishingBlow(play, &this->actor); this->stateFlags |= BOMB_SHOP_LADY_STATE_KNOCKED_OVER; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnBaba_KnockedOver; break; } @@ -506,7 +506,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { if (play->sceneNum == SCENE_BOMYA) { this->stateFlags |= BOMB_SHOP_LADY_STATE_VISIBLE; this->animIndex = BOMB_SHOP_LADY_ANIM_IDLE; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnBaba_Idle; } else if (play->sceneNum == SCENE_BACKTOWN) { if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_FOLLOW_SCHEDULE) && @@ -520,7 +520,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { this->sakonDeadTimer = 50; this->animIndex = BOMB_SHOP_LADY_ANIM_WALKING_HOLDING_BAG; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnBaba_FollowSchedule; } else if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_IDLE) && (gSaveContext.save.entrance == ENTRANCE(NORTH_CLOCK_TOWN, 7))) { @@ -536,7 +536,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { this->animIndex = BOMB_SHOP_LADY_ANIM_IDLE; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->stateFlags |= BOMB_SHOP_LADY_STATE_AUTOTALK; this->actionFunc = EnBaba_Idle; } else { @@ -548,15 +548,15 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { if (BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_SWAY) { this->actor.flags &= ~ACTOR_FLAG_1; this->animIndex = BOMB_SHOP_LADY_ANIM_SWAY; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnBaba_DoNothing; } else if (BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != 0x3F) { this->animIndex = BOMB_SHOP_LADY_ANIM_WALKING_HOLDING_BAG; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnBaba_Walk; } else { this->animIndex = BOMB_SHOP_LADY_ANIM_IDLE_HOLDING_BAG; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnBaba_FaceForward; } } @@ -683,7 +683,7 @@ void EnBaba_FollowSchedule(EnBaba* this, PlayState* play) { void EnBaba_KnockedOver(EnBaba* this, PlayState* play) { s16 curFrame = this->skelAnime.curFrame; - s16 endFrame = Animation_GetLastFrame(sAnimations[this->animIndex].animation); + s16 endFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); this->collider.dim.height = 37; this->collider.dim.radius = 23; @@ -695,7 +695,7 @@ void EnBaba_KnockedOver(EnBaba* this, PlayState* play) { if (curFrame == endFrame) { this->animIndex = BOMB_SHOP_LADY_ANIM_LYING_DOWN; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } } else { if ((gSaveContext.save.weekEventReg[79] & 0x40) && (DECR(this->sakonDeadTimer) == 0)) { diff --git a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c index e14bc8ce53..3555f09982 100644 --- a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c +++ b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c @@ -57,9 +57,9 @@ static ColliderCylinderInit sCylinderInit = { static u16 sTextIds[] = { 0x2ABD, 0x2ABB, 0x2AD5, 0x2AD6, 0x2AD7, 0x2AD8, 0x2AC6 }; -static AnimationHeader* D_80BE8E4C[] = { &object_bai_Anim_0011C0, &object_bai_Anim_0008B4, &object_bai_Anim_008198 }; +static AnimationHeader* sAnimations[] = { &object_bai_Anim_0011C0, &object_bai_Anim_0008B4, &object_bai_Anim_008198 }; -static u8 sAnimModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP }; +static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP }; void EnBaisen_Init(Actor* thisx, PlayState* play) { EnBaisen* this = THIS; @@ -100,11 +100,11 @@ void EnBaisen_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void EnBaisen_ChangeAnimation(EnBaisen* this, s32 animIndex) { +void EnBaisen_ChangeAnim(EnBaisen* this, s32 animIndex) { this->animIndex = animIndex; - this->frameCount = Animation_GetLastFrame(D_80BE8E4C[animIndex]); - Animation_Change(&this->skelAnime, D_80BE8E4C[this->animIndex], 1.0f, 0.0f, this->frameCount, - sAnimModes[this->animIndex], -10.0f); + this->frameCount = Animation_GetLastFrame(sAnimations[animIndex]); + Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->frameCount, + sAnimationModes[this->animIndex], -10.0f); } void func_80BE871C(EnBaisen* this) { @@ -138,10 +138,10 @@ void func_80BE87B0(EnBaisen* this, PlayState* play) { void func_80BE87FC(EnBaisen* this) { if (this->paramCopy == 0) { this->textIdIndex = 2; - EnBaisen_ChangeAnimation(this, 2); + EnBaisen_ChangeAnim(this, 2); this->unk29E = this->actor.world.rot.y; } else { - EnBaisen_ChangeAnimation(this, 0); + EnBaisen_ChangeAnim(this, 0); } this->actor.textId = sTextIds[this->textIdIndex]; @@ -190,12 +190,12 @@ void func_80BE89D8(EnBaisen* this, PlayState* play) { if (&this->actor == this->unk2A4) { this->unk29E = this->actor.world.rot.y; if (this->animIndex == 0) { - EnBaisen_ChangeAnimation(this, 1); + EnBaisen_ChangeAnim(this, 1); } } else { this->unk29E = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk2A4->world.pos); if (this->animIndex != 0) { - EnBaisen_ChangeAnimation(this, 0); + EnBaisen_ChangeAnim(this, 0); } } if ((play->msgCtx.currentTextId == 0x2AC6) || (play->msgCtx.currentTextId == 0x2AC7) || @@ -212,14 +212,14 @@ void func_80BE8AAC(EnBaisen* this, PlayState* play) { if ((this->textIdIndex % 2) != 0) { this->unk29E = this->actor.world.rot.y; if (this->animIndex == 0) { - EnBaisen_ChangeAnimation(this, 1); + EnBaisen_ChangeAnim(this, 1); } } else { if (this->unk2A4 != NULL) { this->unk29E = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk2A4->world.pos); } if (this->animIndex != 0) { - EnBaisen_ChangeAnimation(this, 0); + EnBaisen_ChangeAnim(this, 0); } } if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { diff --git a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c index 7bfbf596c6..6954be57d2 100644 --- a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c +++ b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c @@ -158,7 +158,7 @@ s32 func_809CC270(EnBba01* this, PlayState* play) { void EnBba01_FinishInit(EnHy* this, PlayState* play) { //! @bug: gBbaSkel does not match EnHy's skeleton assumptions. //! Since gBbaSkel has more limbs than expected, joint and morph tables will overflow - if (EnHy_Init(this, play, &gBbaSkel, ENHY_ANIMATION_BBA_6)) { + if (EnHy_Init(this, play, &gBbaSkel, ENHY_ANIM_BBA_6)) { this->actor.flags |= ACTOR_FLAG_1; this->actor.draw = EnBba01_Draw; this->waitingOnInit = false; diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c index dbe39261fe..5437e8deea 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c @@ -62,7 +62,7 @@ static ColliderCylinderInit sCylinderInit = { }; /* Animations struct */ -static AnimationSpeedInfo D_809CDC7C[] = { +static AnimationSpeedInfo sAnimationInfo[] = { { &object_bji_Anim_000FDC, 1.0f, ANIMMODE_LOOP, 0.0f }, /* Looking through telescope */ { &object_bji_Anim_005B58, 1.0f, ANIMMODE_LOOP, 10.0f }, /* Breathing? Unused? */ { &object_bji_Anim_000AB0, 1.0f, ANIMMODE_LOOP, 0.0f }, /* Talking */ @@ -82,7 +82,7 @@ void func_809CCDE0(EnBji01* this, PlayState* play) { } void func_809CCE98(EnBji01* this, PlayState* play) { - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 0, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 0, &this->animIndex); this->actor.textId = 0; this->actionFunc = func_809CCEE8; } @@ -191,7 +191,7 @@ void func_809CD028(EnBji01* this, PlayState* play) { } break; } - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 2, &this->animIndex); this->actionFunc = EnBji01_DialogueHandler; } @@ -237,7 +237,7 @@ void EnBji01_DialogueHandler(EnBji01* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_10000; switch (play->msgCtx.currentTextId) { case 0x5DE: - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 3, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 3, &this->animIndex); func_80151938(play, 0x5DF); break; case 0x5E4: @@ -287,8 +287,8 @@ void EnBji01_DialogueHandler(EnBji01* this, PlayState* play) { func_809CCE98(this, play); break; } - if ((this->animationIndex == 3) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) { - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); + if ((this->animIndex == 3) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) { + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 2, &this->animIndex); } } @@ -307,7 +307,7 @@ void EnBji01_DoNothing(EnBji01* this, PlayState* play) { } void func_809CD6C0(EnBji01* this, PlayState* play) { - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, 2, &this->animIndex); this->actionFunc = func_809CD70C; } @@ -337,7 +337,7 @@ void EnBji01_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.targetMode = 0; this->actor.child = NULL; - this->animationIndex = -1; + this->animIndex = -1; Actor_SetScale(&this->actor, 0.01f); SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h index ac738bc715..8ab601e1b4 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h @@ -22,7 +22,7 @@ typedef struct EnBji01 { /* 0x18C */ ColliderCylinder collider; /* 0x1D8 */ Vec3s jointTable[SHIKASHI_LIMB_MAX]; /* 0x238 */ Vec3s morphTable[SHIKASHI_LIMB_MAX]; - /* 0x298 */ s32 animationIndex; + /* 0x298 */ s32 animIndex; /* 0x29C */ s16 eyeTexIndex; /* 0x29E */ s16 blinkSeqIndex; /* 0x2A0 */ s16 blinkTimer; diff --git a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c index 91c6d6a4f6..063e5b522e 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c @@ -88,9 +88,9 @@ typedef enum { /* 3 */ TOILET_HAND_ANIM_THUMBS_UP, // Right /* 4 */ TOILET_HAND_ANIM_OPEN_HAND, /* 5 */ TOILET_HAND_ANIM_FIST // i.e. holding the reward -} ToiletHandAnimations; +} ToiletHandAnimation; -static AnimationInfoS sAnimationInfos[] = { +static AnimationInfoS sAnimationInfo[] = { /* 0 */ { &gToiletHandWaitingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, /* 1 */ { &gToiletHandWaitingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, /* 2 */ { &gToiletHandWaggingFingerAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, @@ -104,22 +104,21 @@ void EnBjt_UpdateSkelAnime(EnBjt* this) { SkelAnime_Update(&this->skelAnime); } -s32 EnBjt_ChangeAnimation(EnBjt* this, s32 animIndex) { +s32 EnBjt_ChangeAnim(EnBjt* this, s32 animIndex) { s32 changeAnim = false; s32 changed = false; if ((animIndex == TOILET_HAND_ANIM_WAITING) || (animIndex == TOILET_HAND_ANIM_WAITING_MORPH)) { - if (!((this->curAnimIndex == TOILET_HAND_ANIM_WAITING) || - (this->curAnimIndex == TOILET_HAND_ANIM_WAITING_MORPH))) { + if (!((this->animIndex == TOILET_HAND_ANIM_WAITING) || (this->animIndex == TOILET_HAND_ANIM_WAITING_MORPH))) { changeAnim = true; } - } else if (this->curAnimIndex != animIndex) { + } else if (this->animIndex != animIndex) { changeAnim = true; } if (changeAnim) { - this->curAnimIndex = animIndex; - changed = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfos, animIndex); + this->animIndex = animIndex; + changed = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); this->animPlaySpeed = this->skelAnime.playSpeed; } @@ -254,7 +253,7 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) { if ((itemAP == EXCH_ITEM_DEED_LAND) || (itemAP == EXCH_ITEM_LETTER_TO_KAFEI) || (itemAP == EXCH_ITEM_DEED_SWAMP) || (itemAP == EXCH_ITEM_DEED_MOUNTAIN) || (itemAP == EXCH_ITEM_DEED_OCEAN) || (itemAP == EXCH_ITEM_LETTER_MAMA)) { - EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_WAITING_MORPH); + EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAITING_MORPH); this->playedSfx = false; this->behaviour++; scriptBranch = 1; // Right item @@ -288,7 +287,7 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) { case TOILET_HAND_BEHAVIOUR_USE_ITEM: if (DECR(this->timer) == 0) { - EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_FIST); // change while not visible + EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_FIST); // change while not visible this->playedSfx = false; this->behaviour++; } else if (this->timer == 10) { @@ -304,7 +303,7 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) { break; case TOILET_HAND_BEHAVIOUR_REWARD_GIVEN: - EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_OPEN_HAND); + EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_OPEN_HAND); this->behaviour++; scriptBranch = 1; // Right item break; @@ -339,11 +338,11 @@ s32 EnBjt_ChooseAnimation(EnBjt* this, PlayState* play) { if (this->textId != curTextId) { switch (curTextId) { case 0x2949: // Wrong item - EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_WAGGING_FINGER); + EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAGGING_FINGER); break; case 0x294A: // Right item - EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_THUMBS_UP); + EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_THUMBS_UP); break; default: @@ -353,7 +352,7 @@ s32 EnBjt_ChooseAnimation(EnBjt* this, PlayState* play) { this->textId = curTextId; } else if (this->stateFlags & TOILET_HAND_STATE_TEXTBOX) { this->stateFlags &= ~TOILET_HAND_STATE_TEXTBOX; - EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_WAITING); + EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAITING); } return 0; } @@ -422,8 +421,8 @@ void EnBjt_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gToiletHandSkel, NULL, this->jointTable, this->morphTable, TOILET_HAND_LIMB_MAX); - this->curAnimIndex = TOILET_HAND_ANIM_NONE; - EnBjt_ChangeAnimation(this, TOILET_HAND_ANIM_WAITING); + this->animIndex = TOILET_HAND_ANIM_NONE; + EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAITING); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h index d1aabb9999..f26be4d223 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h @@ -27,7 +27,7 @@ typedef struct EnBjt { /* 0x244 */ UNK_TYPE1 unk_244[4]; /* 0x248 */ s32 playedSfx; // to only play once /* 0x24C */ MsgEventFunc msgEventCallback; - /* 0x250 */ s32 curAnimIndex; + /* 0x250 */ s32 animIndex; /* 0x254 */ UNK_TYPE1 pad_254[8]; } EnBjt; // size = 0x25C diff --git a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c index 490ddaea9e..9f70629e62 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c @@ -64,7 +64,7 @@ static AnimationHeader* sAnimations[] = { &object_cs_Anim_0060E8, &object_cs_Anim_005DC4, &object_cs_Anim_0026B0, }; -static u8 sAnimModes[] = { +static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, }; @@ -120,7 +120,7 @@ void EnBombers2_ChangeAnim(EnBombers2* this, s32 animIndex, f32 playSpeed) { lastFrame = Animation_GetLastFrame(sAnimations[this->animIndex]); this->lastAnimFrame = lastFrame; Animation_Change(&this->skelAnime, sAnimations[this->animIndex], playSpeed, 0.0f, lastFrame, - sAnimModes[this->animIndex], -10.0f); + sAnimationModes[this->animIndex], -10.0f); } void func_80C04B40(EnBombers2* this) { diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index f9426a0a2a..a9d9756bea 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -81,7 +81,7 @@ static AnimationHeader* sAnimations[] = { &object_cs_Anim_0031C4, &object_cs_Anim_010B68, }; -static u8 sAnimModes[] = { +static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, @@ -177,8 +177,8 @@ void EnBomjimb_Destroy(Actor* thisx, PlayState* play) { void func_80C0113C(EnBomjimb* this, s32 arg1, f32 arg2) { this->unk_2DC = arg1; this->unk_2B8 = Animation_GetLastFrame(sAnimations[arg1]); - Animation_Change(&this->skelAnime, sAnimations[this->unk_2DC], arg2, 0.0f, this->unk_2B8, sAnimModes[this->unk_2DC], - -4.0f); + Animation_Change(&this->skelAnime, sAnimations[this->unk_2DC], arg2, 0.0f, this->unk_2B8, + sAnimationModes[this->unk_2DC], -4.0f); } void func_80C011CC(EnBomjimb* this) { diff --git a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c index a9aa59c7b9..1519bc31cc 100644 --- a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c +++ b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c @@ -148,7 +148,7 @@ s32 func_809CB4A0(EnCne01* this, PlayState* play) { } void EnCne01_FinishInit(EnHy* this, PlayState* play) { - if (EnHy_Init(this, play, &gCneSkel, ENHY_ANIMATION_OS_ANIME_11)) { + if (EnHy_Init(this, play, &gCneSkel, ENHY_ANIM_OS_ANIME_11)) { this->actor.flags |= ACTOR_FLAG_1; this->actor.draw = EnCne01_Draw; this->waitingOnInit = false; diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c index 61eefbe1ee..a8f24c8d2e 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -128,7 +128,7 @@ s32 func_80B3E5B4(EnDai* this, PlayState* play) { } s32 func_80B3E5DC(EnDai* this, s32 arg1) { - static AnimationInfoS D_80B3FBFC[] = { + static AnimationInfoS sAnimationInfo[] = { { &object_dai_Anim_0079E4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dai_Anim_0079E4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_dai_Anim_007354, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, @@ -167,7 +167,7 @@ s32 func_80B3E5DC(EnDai* this, s32 arg1) { if (phi_v1) { this->unk_A70 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80B3FBFC, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); } return ret; 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 2e7442fa48..45777c6810 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -63,7 +63,7 @@ static AnimationHeader* sAnimations[] = { &object_daiku_Anim_001114, &object_daiku_Anim_00B690, &object_daiku_Anim_00BEAC, }; -static u8 sAnimModes[] = { +static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE, }; @@ -131,7 +131,7 @@ void EnDaiku_Destroy(Actor* thisx, PlayState* play) { void func_8094373C(EnDaiku* this, s32 arg1) { this->unk_284 = Animation_GetLastFrame(sAnimations[arg1]); - Animation_Change(&this->skelAnime, sAnimations[arg1], 1.0f, 0.0f, this->unk_284, sAnimModes[arg1], -4.0f); + Animation_Change(&this->skelAnime, sAnimations[arg1], 1.0f, 0.0f, this->unk_284, sAnimationModes[arg1], -4.0f); } void func_809437C8(EnDaiku* this) { diff --git a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c index 4b6eae5bb2..47e11a2e8d 100644 --- a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c +++ b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c @@ -15,7 +15,7 @@ void EnDemoheishi_Destroy(Actor* thisx, PlayState* play); void EnDemoheishi_Update(Actor* thisx, PlayState* play); void EnDemoheishi_Draw(Actor* thisx, PlayState* play); -void EnDemoheishi_ChangeAnimation(EnDemoheishi* this, s32 animIndex); +void EnDemoheishi_ChangeAnim(EnDemoheishi* this, s32 animIndex); void EnDemoheishi_SetupIdle(EnDemoheishi* this); void EnDemoheishi_Idle(EnDemoheishi* this, PlayState* play); void EnDemoheishi_SetupTalk(EnDemoheishi* this); @@ -23,12 +23,12 @@ void EnDemoheishi_Talk(EnDemoheishi* this, PlayState* play); s32 EnDemoheishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); typedef enum { - /* 0 */ DEMOHEISHI_ANIMATION_STAND_HAND_ON_HIP, - /* 1 */ DEMOHEISHI_ANIMATION_CHEER_WITH_SPEAR, - /* 2 */ DEMOHEISHI_ANIMATION_WAVE, - /* 3 */ DEMOHEISHI_ANIMATION_SIT_AND_REACH, - /* 4 */ DEMOHEISHI_ANIMATION_STAND_UP -} EnDemoheishiAnimationIndex; + /* 0 */ DEMOHEISHI_ANIM_STAND_HAND_ON_HIP, + /* 1 */ DEMOHEISHI_ANIM_CHEER_WITH_SPEAR, + /* 2 */ DEMOHEISHI_ANIM_WAVE, + /* 3 */ DEMOHEISHI_ANIM_SIT_AND_REACH, + /* 4 */ DEMOHEISHI_ANIM_STAND_UP +} EnDemoheishiAnimation; const ActorInit En_Demo_heishi_InitVars = { ACTOR_EN_DEMO_HEISHI, @@ -83,19 +83,19 @@ void EnDemoheishi_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->colliderCylinder); } -void EnDemoheishi_ChangeAnimation(EnDemoheishi* this, s32 animIndex) { +void EnDemoheishi_ChangeAnim(EnDemoheishi* this, s32 animIndex) { static AnimationHeader* sAnimations[] = { &gSoldierStandHandOnHip, &gSoldierCheerWithSpear, &gSoldierWave, &gSoldierSitAndReach, &gSoldierStandUp, }; - static u8 sAnimModes[] = { + static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, - ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP + ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, }; this->animIndex = animIndex; this->frameCount = Animation_GetLastFrame(sAnimations[animIndex]); Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->frameCount, - sAnimModes[this->animIndex], -10.0f); + sAnimationModes[this->animIndex], -10.0f); } void EnDemoheishi_SetHeadRotation(EnDemoheishi* this) { @@ -114,7 +114,7 @@ void EnDemoheishi_SetHeadRotation(EnDemoheishi* this) { } void EnDemoheishi_SetupIdle(EnDemoheishi* this) { - EnDemoheishi_ChangeAnimation(this, DEMOHEISHI_ANIMATION_STAND_HAND_ON_HIP); + EnDemoheishi_ChangeAnim(this, DEMOHEISHI_ANIM_STAND_HAND_ON_HIP); this->textIdIndex = 0; this->actor.textId = sTextIds[this->textIdIndex]; this->isTalking = false; diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c index 8b9d67e64d..ef93a501a6 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -165,26 +165,26 @@ static DamageTable sDamageTable = { }; typedef enum { - /* 0 */ DOG_ANIMATION_WALK_AFTER_TALKING, - /* 1 */ DOG_ANIMATION_WALK, - /* 2 */ DOG_ANIMATION_RUN, - /* 3 */ DOG_ANIMATION_BARK, - /* 4 */ DOG_ANIMATION_SIT_DOWN_ONCE, // unused - /* 5 */ DOG_ANIMATION_SIT_DOWN, - /* 6 */ DOG_ANIMATION_LYING_DOWN_START_1, // unused - /* 7 */ DOG_ANIMATION_LYING_DOWN_LOOP, // unused - /* 8 */ DOG_ANIMATION_LYING_DOWN_START_2, // unused - /* 9 */ DOG_ANIMATION_LYING_DOWN_START_3, // unused - /* 10 */ DOG_ANIMATION_LYING_DOWN_START_4, // unused - /* 11 */ DOG_ANIMATION_WALK_BACKWARDS, - /* 12 */ DOG_ANIMATION_JUMP, - /* 13 */ DOG_ANIMATION_LONG_JUMP, // unused - /* 14 */ DOG_ANIMATION_JUMP_ATTACK, - /* 15 */ DOG_ANIMATION_SWIM, - /* 16 */ DOG_ANIMATION_MAX -} DogAnimationIndex; + /* 0 */ DOG_ANIM_WALK_AFTER_TALKING, + /* 1 */ DOG_ANIM_WALK, + /* 2 */ DOG_ANIM_RUN, + /* 3 */ DOG_ANIM_BARK, + /* 4 */ DOG_ANIM_SIT_DOWN_ONCE, // unused + /* 5 */ DOG_ANIM_SIT_DOWN, + /* 6 */ DOG_ANIM_LYING_DOWN_START_1, // unused + /* 7 */ DOG_ANIM_LYING_DOWN_LOOP, // unused + /* 8 */ DOG_ANIM_LYING_DOWN_START_2, // unused + /* 9 */ DOG_ANIM_LYING_DOWN_START_3, // unused + /* 10 */ DOG_ANIM_LYING_DOWN_START_4, // unused + /* 11 */ DOG_ANIM_WALK_BACKWARDS, + /* 12 */ DOG_ANIM_JUMP, + /* 13 */ DOG_ANIM_LONG_JUMP, // unused + /* 14 */ DOG_ANIM_JUMP_ATTACK, + /* 15 */ DOG_ANIM_SWIM, + /* 16 */ DOG_ANIM_MAX +} DogAnimation; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gDogWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gDogWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -6 }, { &gDogRunAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gDogBarkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -6 }, { &gDogSitAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -6 }, { &gDogSitAnim, 1.0f, 0, -1, ANIMMODE_LOOP_PARTIAL, -6 }, @@ -199,10 +199,10 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_STOP), }; -void EnDg_ChangeAnimation(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 index) { +void EnDg_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex) { f32 frameCount; - animationInfo += index; + animationInfo += animIndex; if (animationInfo->frameCount < 0) { frameCount = Animation_GetLastFrame(animationInfo->animation); } else { @@ -398,15 +398,15 @@ void EnDg_SetupIdleMove(EnDg* this, PlayState* play) { if (!(this->actor.bgCheckFlags & 0x20)) { if ((this->index == ENDG_INDEX_SWAMP_SPIDER_HOUSE) || ((this->index == ENDG_INDEX_ROMANI_RANCH) && (play->sceneNum == SCENE_OMOYA))) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); } else if (this->index == ENDG_INDEX_ROMANI_RANCH) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); } else if (play->sceneNum == SCENE_CLOCKTOWER) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); } else if (sRacetrackDogInfo[this->index].textId & 0x11) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); } else { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); } this->actionFunc = EnDg_IdleMove; @@ -488,7 +488,7 @@ void EnDg_TryPickUp(EnDg* this, PlayState* play) { this->dogFlags |= DOG_FLAG_HELD; } - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_SIT_DOWN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN); this->actor.flags &= ~ACTOR_FLAG_1; this->actor.speedXZ = 0.0f; if (Player_GetMask(play) == PLAYER_MASK_TRUTH) { @@ -555,7 +555,7 @@ void EnDg_CheckForBremenMaskMarch(EnDg* this, PlayState* play) { if (this->index == sBremenMaskFollowerIndex) { if (!(this->dogFlags & DOG_FLAG_FOLLOWING_BREMEN_MASK)) { this->dogFlags |= DOG_FLAG_FOLLOWING_BREMEN_MASK; - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); this->actionFunc = EnDg_SetupBremenMaskApproachPlayer; } else if ((this->actionFunc == EnDg_ApproachPlayer) || (this->actionFunc == EnDg_SitNextToPlayer)) { if (DECR(this->bremenBarkTimer) == 0) { @@ -620,7 +620,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) { this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING; if ((this->behavior != DOG_BEHAVIOR_ZORA) && (player->actor.speedXZ > 1.0f)) { this->behavior = DOG_BEHAVIOR_ZORA; - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_ApproachPlayer; } @@ -634,7 +634,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) { this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING; if ((this->behavior != DOG_BEHAVIOR_GORON) && (player->actor.speedXZ > 1.0f)) { this->behavior = DOG_BEHAVIOR_GORON; - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS); this->timer = 50; this->actionFunc = EnDg_BackAwayFromGoron; } @@ -649,7 +649,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) { this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING; if ((this->behavior != DOG_BEHAVIOR_DEKU) && (player->actor.speedXZ > 1.0f)) { this->behavior = DOG_BEHAVIOR_DEKU; - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_ApproachPlayerToAttack; } @@ -684,7 +684,7 @@ void EnDg_IdleMove(EnDg* this, PlayState* play) { if (DECR(this->timer) == 0) { this->timer = Rand_S16Offset(20, 20); - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_BARK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK); this->actionFunc = EnDg_IdleBark; } } @@ -722,7 +722,7 @@ void EnDg_BackAwayFromGoron(EnDg* this, PlayState* play) { if (DECR(this->timer) == 0) { this->timer = 50; - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_RunAwayFromGoron; } else { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1); @@ -764,7 +764,7 @@ void EnDg_RunAwayFromGoron(EnDg* this, PlayState* play) { Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); } } else { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_BARK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK); this->actionFunc = EnDg_BarkAtGoron; } @@ -789,7 +789,7 @@ void EnDg_BarkAtGoron(EnDg* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.xzDistToPlayer < 250.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS); this->timer = 50; this->actionFunc = EnDg_BackAwayFromGoron; } @@ -815,11 +815,11 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) { this->attackTimer = 20; if (yawDiff < 0x4000) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_JUMP_ATTACK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_JUMP_ATTACK); this->actionFunc = EnDg_JumpAttack; } else { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS); - sAnimations[DOG_ANIMATION_WALK_BACKWARDS].playSpeed = -1.0f; + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS); + sAnimationInfo[DOG_ANIM_WALK_BACKWARDS].playSpeed = -1.0f; this->actionFunc = EnDg_SlowlyBackUpBeforeAttacking; } } @@ -866,9 +866,9 @@ void EnDg_SitNextToPlayer(EnDg* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; } else { if (player->stateFlags3 & 0x20000000) { // bremen mask march - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); } else { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); } this->actionFunc = EnDg_ApproachPlayer; @@ -892,7 +892,7 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) { this->dogFlags |= DOG_FLAG_BOUNCED; this->collider.base.atFlags &= ~AT_BOUNCED; this->actor.speedXZ *= -1.0f; - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_RunAfterAttacking; return; } @@ -900,13 +900,13 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) { if (DECR(this->attackTimer) == 0) { this->attackTimer = 60; this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING; - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_RunAfterAttacking; } if (curFrame < 9) { if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - sAnimations[DOG_ANIMATION_JUMP_ATTACK].playSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f; + sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f; } EnDg_SpawnFloorDustRing(this, play); @@ -915,7 +915,7 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 9.0f)) { f32 rand = randPlusMinusPoint5Scaled(1.5f); - sAnimations[DOG_ANIMATION_JUMP_ATTACK].playSpeed = 1.2f; + sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = 1.2f; this->actor.velocity.y = 2.0f * rand + 3.0f; this->actor.speedXZ = 8.0f + rand; } else if (curFrame > 20) { @@ -939,10 +939,10 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) { */ void EnDg_WalkToPlayer(EnDg* this, PlayState* play) { if (this->actor.xzDistToPlayer < 150.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS); this->actionFunc = EnDg_BackAwayFromPlayer; } else if (this->actor.xzDistToPlayer < 200.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_BARK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK); this->actionFunc = EnDg_BarkAtPlayer; } else { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); @@ -965,7 +965,7 @@ void EnDg_SetupBremenMaskApproachPlayer(EnDg* this, PlayState* play) { void EnDg_Fall(EnDg* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_IdleMove; } @@ -990,7 +990,7 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.xzDistToPlayer < 40.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_SIT_DOWN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN); this->actionFunc = EnDg_SitNextToPlayer; } else if (player->stateFlags3 & 0x20000000) { // bremen mask march if ((this->actor.xzDistToPlayer > 40.0f) && (player->linearVelocity == 0.0f)) { @@ -1019,14 +1019,14 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) { */ void EnDg_SlowlyBackUpBeforeAttacking(EnDg* this, PlayState* play) { if (this->actor.xzDistToPlayer > 72.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_JUMP_ATTACK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_JUMP_ATTACK); this->actionFunc = EnDg_JumpAttack; } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1); if (this->actor.bgCheckFlags & 8) { this->actor.shape.rot.y = this->actor.wallYaw; - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_JUMP_ATTACK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_JUMP_ATTACK); this->actionFunc = EnDg_JumpAttack; } @@ -1045,10 +1045,10 @@ void EnDg_SlowlyBackUpBeforeAttacking(EnDg* this, PlayState* play) { */ void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) { if (this->actor.xzDistToPlayer > 200.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); this->actionFunc = EnDg_WalkToPlayer; } else if (this->actor.xzDistToPlayer > 150.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_BARK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK); this->actionFunc = EnDg_BarkAtPlayer; } else { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1); @@ -1073,10 +1073,10 @@ void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) { */ void EnDg_BarkAtPlayer(EnDg* this, PlayState* play) { if (this->actor.xzDistToPlayer < 150.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_BACKWARDS); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS); this->actionFunc = EnDg_BackAwayFromPlayer; } else if (this->actor.xzDistToPlayer > 200.0f) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); this->actionFunc = EnDg_WalkToPlayer; } @@ -1180,7 +1180,7 @@ void EnDg_Swim(EnDg* this, PlayState* play) { this->behavior = DOG_BEHAVIOR_DEFAULT; this->timer = Rand_S16Offset(60, 60); Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); this->actionFunc = EnDg_IdleMove; } @@ -1226,7 +1226,7 @@ void EnDg_JumpOutOfWater(EnDg* this, PlayState* play) { this->actor.gravity = -3.0f; this->timer = Rand_S16Offset(60, 60); Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_RUN); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_IdleMove; Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); } else { @@ -1292,7 +1292,7 @@ void EnDg_SetupTalk(EnDg* this, PlayState* play) { void EnDg_Talk(EnDg* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_WALK_AFTER_TALKING); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_AFTER_TALKING); this->actionFunc = EnDg_Held; } } @@ -1349,7 +1349,7 @@ void EnDg_Update(Actor* thisx, PlayState* play) { } if ((this->actor.bgCheckFlags & 0x40) && Actor_HasNoParent(&this->actor, play)) { - EnDg_ChangeAnimation(&this->skelAnime, sAnimations, DOG_ANIMATION_SWIM); + EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SWIM); this->actionFunc = EnDg_SetupSwim; } diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index 7a2f1cf80f..7afd4e2242 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -93,7 +93,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gDekuPalaceGuardStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &gDekuPalaceGuardStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, { &gDekuPalaceGuardWaitAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, @@ -138,18 +138,18 @@ s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) { s32 sp30 = false; if (animIndex >= 0) { - if (animIndex < ARRAY_COUNT(sAnimations)) { + if (animIndex < ARRAY_COUNT(sAnimationInfo)) { sp30 = true; - frameCount = sAnimations[animIndex].frameCount; + frameCount = sAnimationInfo[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation); + frameCount = Animation_GetLastFrame(sAnimationInfo[animIndex].animation); } - frame = sAnimations[animIndex].startFrame; + frame = sAnimationInfo[animIndex].startFrame; if (frame < 0) { frame = frameCount; } - Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, frame, - frameCount, sAnimations[animIndex].mode, sAnimations[animIndex].morphFrames); + Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed, frame, + frameCount, sAnimationInfo[animIndex].mode, sAnimationInfo[animIndex].morphFrames); } } return sp30; diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index 3d084d8493..855b289a47 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -56,7 +56,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_dnp_Anim_0007D8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, { &object_dnp_Anim_0021DC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dnp_Anim_0021DC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, @@ -135,7 +135,7 @@ s32 func_80B3CC38(EnDnp* this, s32 arg1) { if (arg1 != this->unk_340) { this->unk_340 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); } return ret; diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c index 218b41cb6b..e9f29db4af 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -57,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS D_80A5349C[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_dnq_Anim_008328, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dnq_Anim_008328, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_dnq_Anim_007528, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, @@ -105,7 +105,7 @@ s32 func_80A5257C(EnDnq* this, s32 arg1) { if (phi_v1) { this->unk_398 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80A5349C, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); } return ret; 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 1202a4933e..b4a5ffac2c 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -20,18 +20,18 @@ void EnDns_DoNothing(EnDns* this, PlayState* play); void func_8092D4D8(EnDns* this, PlayState* play); typedef enum { - /* 0 */ EN_DNS_ANIMATION_IDLE_1, - /* 1 */ EN_DNS_ANIMATION_IDLE_2, - /* 2 */ EN_DNS_ANIMATION_WALK_1, - /* 3 */ EN_DNS_ANIMATION_WALK_2, - /* 4 */ EN_DNS_ANIMATION_SURPRISE_START, - /* 5 */ EN_DNS_ANIMATION_SURPRISE_LOOP, - /* 6 */ EN_DNS_ANIMATION_RUN_START, - /* 7 */ EN_DNS_ANIMATION_RUN_LOOP, - /* 8 */ EN_DNS_ANIMATION_DANCE, - /* 9 */ EN_DNS_ANIMATION_FLIP, - /* 10 */ EN_DNS_ANIMATION_MAX, -} EnDnsAnimationIndex; + /* 0 */ EN_DNS_ANIM_IDLE_1, + /* 1 */ EN_DNS_ANIM_IDLE_2, + /* 2 */ EN_DNS_ANIM_WALK_1, + /* 3 */ EN_DNS_ANIM_WALK_2, + /* 4 */ EN_DNS_ANIM_SURPRISE_START, + /* 5 */ EN_DNS_ANIM_SURPRISE_LOOP, + /* 6 */ EN_DNS_ANIM_RUN_START, + /* 7 */ EN_DNS_ANIM_RUN_LOOP, + /* 8 */ EN_DNS_ANIM_DANCE, + /* 9 */ EN_DNS_ANIM_FLIP, + /* 10 */ EN_DNS_ANIM_MAX, +} EnDnsAnimation; static s32 D_8092DCB0[] = { 0x00172000, 0x050E082F, 0x0C100E08, 0x200C1000, 0x00172000, 0x050E0830, 0x0C100E08, 0x210C1000, @@ -73,7 +73,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &gKingsChamberDekuGuardWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, @@ -89,8 +89,8 @@ static AnimationInfoS sAnimations[] = { void func_8092C5C0(EnDns* this) { s32 pad; - if (((this->animationIndex == EN_DNS_ANIMATION_WALK_1) || (this->animationIndex == EN_DNS_ANIMATION_WALK_2) || - (this->animationIndex == EN_DNS_ANIMATION_RUN_START) || (this->animationIndex == EN_DNS_ANIMATION_RUN_LOOP)) && + if (((this->animIndex == EN_DNS_ANIM_WALK_1) || (this->animIndex == EN_DNS_ANIM_WALK_2) || + (this->animIndex == EN_DNS_ANIM_RUN_START) || (this->animIndex == EN_DNS_ANIM_RUN_LOOP)) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 3.0f))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); } @@ -101,31 +101,29 @@ s32 func_8092C63C(EnDns* this, s32 arg1) { s32 ret = false; switch (arg1) { - case EN_DNS_ANIMATION_IDLE_1: - case EN_DNS_ANIMATION_IDLE_2: - if ((this->animationIndex != EN_DNS_ANIMATION_IDLE_1) && - (this->animationIndex != EN_DNS_ANIMATION_IDLE_2)) { + case EN_DNS_ANIM_IDLE_1: + case EN_DNS_ANIM_IDLE_2: + if ((this->animIndex != EN_DNS_ANIM_IDLE_1) && (this->animIndex != EN_DNS_ANIM_IDLE_2)) { phi_v1 = true; } break; - case EN_DNS_ANIMATION_WALK_1: - case EN_DNS_ANIMATION_WALK_2: - if ((this->animationIndex != EN_DNS_ANIMATION_WALK_1) && - (this->animationIndex != EN_DNS_ANIMATION_WALK_2)) { + case EN_DNS_ANIM_WALK_1: + case EN_DNS_ANIM_WALK_2: + if ((this->animIndex != EN_DNS_ANIM_WALK_1) && (this->animIndex != EN_DNS_ANIM_WALK_2)) { phi_v1 = true; } break; default: - if (this->animationIndex != arg1) { + if (this->animIndex != arg1) { phi_v1 = true; } } if (phi_v1) { - this->animationIndex = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); + this->animIndex = arg1; + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); } return ret; @@ -236,7 +234,7 @@ s32 func_8092CAD0(EnDns* this, PlayState* play) { this->unk_2F0 = 0.0f; if (this->unk_2D2 != 0) { this->unk_2F0 = this->skelAnime.curFrame; - func_8092C63C(this, EN_DNS_ANIMATION_WALK_1); + func_8092C63C(this, EN_DNS_ANIM_WALK_1); } this->unk_2DA = this->actor.world.rot.y; } @@ -306,7 +304,7 @@ s32 func_8092CCEC(EnDns* this, PlayState* play) { } s32 func_8092CE38(EnDns* this) { - static s32 D_8092DE00[] = { EN_DNS_ANIMATION_DANCE, EN_DNS_ANIMATION_DANCE, EN_DNS_ANIMATION_FLIP }; + static s32 D_8092DE00[] = { EN_DNS_ANIM_DANCE, EN_DNS_ANIM_DANCE, EN_DNS_ANIM_FLIP }; s16 frame; s32 pad; Vec3f sp2C; @@ -406,11 +404,11 @@ void func_8092D1B8(EnDns* this, PlayState* play) { play_sound(NA_SE_SY_FOUND); gSaveContext.eventInf[1] |= 0x20; this->unk_2F4 = func_8092CCEC; - func_8092C63C(this, EN_DNS_ANIMATION_WALK_1); + func_8092C63C(this, EN_DNS_ANIM_WALK_1); this->actionFunc = EnDns_DoNothing; } else if (gSaveContext.eventInf[1] & 0x40) { func_8092CCEC(this, play); - func_8092C63C(this, EN_DNS_ANIMATION_WALK_1); + func_8092C63C(this, EN_DNS_ANIM_WALK_1); this->actionFunc = func_8092D330; } Math_ApproachS(&this->actor.shape.rot.y, sp22, 3, 0x2AA8); @@ -452,7 +450,7 @@ void func_8092D4D8(EnDns* this, PlayState* play) { if (ENDNS_GET_4000(&this->actor) && (this->unk_2D2 == 0)) { if (func_8092CE38(this)) { - func_8092C63C(this, EN_DNS_ANIMATION_WALK_1); + func_8092C63C(this, EN_DNS_ANIM_WALK_1); } } else if (func_8010BF58(&this->actor, play, this->unk_1E0, this->unk_2F4, &this->unk_1DC)) { SubS_UpdateFlags(&this->unk_2C6, 3, 7); @@ -461,7 +459,7 @@ void func_8092D4D8(EnDns* this, PlayState* play) { if (!(gSaveContext.eventInf[1] & 0x20)) { this->skelAnime.curFrame = this->unk_2F0; this->actor.world.rot.y = this->unk_2DA; - func_8092C63C(this, EN_DNS_ANIMATION_DANCE); + func_8092C63C(this, EN_DNS_ANIM_DANCE); } this->unk_2CC = 0; this->unk_2CE = 0; @@ -475,10 +473,10 @@ void func_8092D4D8(EnDns* this, PlayState* play) { void func_8092D5E8(EnDns* this, PlayState* play) { static s32 D_8092DE0C[] = { - EN_DNS_ANIMATION_IDLE_1, - EN_DNS_ANIMATION_IDLE_1, - EN_DNS_ANIMATION_SURPRISE_START, - EN_DNS_ANIMATION_RUN_START, + EN_DNS_ANIM_IDLE_1, + EN_DNS_ANIM_IDLE_1, + EN_DNS_ANIM_SURPRISE_START, + EN_DNS_ANIM_RUN_START, }; s32 temp_v0; u32 temp_v1; @@ -491,10 +489,9 @@ void func_8092D5E8(EnDns* this, PlayState* play) { this->unk_1D8 = temp_v1; } - if (((this->animationIndex == EN_DNS_ANIMATION_SURPRISE_START) || - (this->animationIndex == EN_DNS_ANIMATION_RUN_START)) && + if (((this->animIndex == EN_DNS_ANIM_SURPRISE_START) || (this->animIndex == EN_DNS_ANIM_RUN_START)) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_8092C63C(this, this->animationIndex + 1); + func_8092C63C(this, this->animIndex + 1); } Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0); @@ -512,8 +509,8 @@ void EnDns_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 18.0f); SkelAnime_Init(play, &this->skelAnime, &gKingsChamberDekuGuardSkel, NULL, this->jointTable, this->morphTable, KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX); - this->animationIndex = -1; - func_8092C63C(this, EN_DNS_ANIMATION_WALK_1); + this->animIndex = -1; + func_8092C63C(this, EN_DNS_ANIM_WALK_1); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); Actor_SetScale(&this->actor, 0.01f); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/src/overlays/actors/ovl_En_Dns/z_en_dns.h index 3a252b1ec7..3a382c192c 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h @@ -53,7 +53,7 @@ typedef struct EnDns { /* 0x2EC */ f32 unk_2EC; /* 0x2F0 */ f32 unk_2F0; /* 0x2F4 */ EnDnsFunc unk_2F4; - /* 0x2F8 */ s32 animationIndex; + /* 0x2F8 */ s32 animIndex; /* 0x2FC */ s32 unk_2FC; } EnDns; // size = 0x300 diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c index 76c2e08978..901efc0d2c 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -25,11 +25,11 @@ void EnDragon_Attack(EnDragon* this, PlayState* play); void EnDragon_Dead(EnDragon* this, PlayState* play); typedef enum { - /* 0 */ DEEP_PYTHON_ANIMATION_SMALL_SIDE_SWAY, - /* 1 */ DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY, - /* 2 */ DEEP_PYTHON_ANIMATION_VERTICAL_SWAY, - /* 3 */ DEEP_PYTHON_ANIMATION_IDLE -} DeepPythonAnimationIndex; + /* 0 */ DEEP_PYTHON_ANIM_SMALL_SIDE_SWAY, + /* 1 */ DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY, + /* 2 */ DEEP_PYTHON_ANIM_VERTICAL_SWAY, + /* 3 */ DEEP_PYTHON_ANIM_IDLE +} DeepPythonAnimation; typedef enum { /* 0 */ DEEP_PYTHON_EXTEND_STATE_NOT_FULLY_EXTENDED, @@ -264,18 +264,18 @@ static AnimationHeader* sAnimations[] = { static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE }; -void EnDragon_ChangeAnimation(EnDragon* this, s32 animationIndex) { +void EnDragon_ChangeAnim(EnDragon* this, s32 animIndex) { f32 startFrame; - this->animationIndex = animationIndex; - this->endFrame = Animation_GetLastFrame(sAnimations[animationIndex]); + this->animIndex = animIndex; + this->endFrame = Animation_GetLastFrame(sAnimations[animIndex]); startFrame = 0.0f; - if (this->animationIndex == DEEP_PYTHON_ANIMATION_IDLE) { + if (this->animIndex == DEEP_PYTHON_ANIM_IDLE) { startFrame = this->endFrame; } - Animation_Change(&this->skelAnime, sAnimations[animationIndex], 1.0f, startFrame, this->endFrame, - sAnimationModes[this->animationIndex], -4.0f); + Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, startFrame, this->endFrame, + sAnimationModes[this->animIndex], -4.0f); } static Color_RGBA8 sBubblePrimColors[] = { @@ -329,7 +329,7 @@ void EnDragon_RetreatOnceTimerEnds(EnDragon* this, PlayState* play) { } void EnDragon_SetupRetreatOrIdle(EnDragon* this) { - EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_IDLE); + EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_IDLE); this->state = 0; this->unk_2CC = 0; this->hasGrabbedPlayer = false; @@ -397,8 +397,8 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) { Math_ApproachF(&this->actor.world.pos.z, extendedPos.z, 0.3f, 50.0f); if ((fabsf(this->actor.world.pos.x - extendedPos.x) < 4.0f) && (fabsf(this->actor.world.pos.z - extendedPos.z) < 4.0f)) { - if (this->animationIndex != DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY) { - EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY); + if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) { + EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY); } this->state = DEEP_PYTHON_EXTEND_STATE_FULLY_EXTENDED; @@ -419,8 +419,8 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) { if (yaw < 0x5000) { // Player is in front of the jaw if ((this->endFrame <= currentFrame) && (this->largeSwayWaitTimer == 0)) { - if (this->animationIndex != DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY) { - EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY); + if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) { + EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY); } this->state = DEEP_PYTHON_EXTEND_STATE_REPEAT_LARGE_SWAY; @@ -430,7 +430,7 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) { } else { // Player is in behind the jaw if (this->state == DEEP_PYTHON_EXTEND_STATE_REPEAT_LARGE_SWAY) { - EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_SMALL_SIDE_SWAY); + EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_SMALL_SIDE_SWAY); this->largeSwayWaitTimer = Rand_ZeroFloat(20.0f) + this->endFrame; this->state = DEEP_PYTHON_EXTEND_STATE_REPEAT_SMALL_SWAY; } @@ -471,7 +471,7 @@ void EnDragon_SetupGrab(EnDragon* this, PlayState* play) { this->state = DEEP_PYTHON_GRAB_STATE_START; this->grabTimer = 0; this->hasGrabbedPlayer = false; - EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_IDLE); + EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_IDLE); this->actionFunc = EnDragon_Grab; } } @@ -548,8 +548,8 @@ void EnDragon_Grab(EnDragon* this, PlayState* play) { } void EnDragon_SetupAttack(EnDragon* this) { - if (this->animationIndex != DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY) { - EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY); + if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) { + EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY); } this->behindJawRetreatTimer = 0; @@ -603,8 +603,8 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) { if ((this->state <= DEEP_PYTHON_ATTACK_STATE_START) && (this->endFrame <= currentFrame)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_BITE); - if (this->animationIndex != DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY) { - EnDragon_ChangeAnimation(this, DEEP_PYTHON_ANIMATION_LARGE_SIDE_SWAY); + if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) { + EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY); } this->state++; diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h index b12c63dd05..321d0ad950 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h @@ -26,7 +26,7 @@ typedef struct EnDragon { /* 0x188 */ Vec3s jointTable[DEEP_PYTHON_LIMB_MAX]; /* 0x1E8 */ Vec3s morphTable[DEEP_PYTHON_LIMB_MAX]; /* 0x248 */ EnDragonActionFunc actionFunc; - /* 0x24C */ s32 animationIndex; + /* 0x24C */ s32 animIndex; /* 0x250 */ s32 pythonIndex; /* 0x254 */ Vec3f jawPos; /* 0x260 */ Vec3f burrowEntrancePos; // Vertically and horizontally centered on the burrow opening. Set by Bg_Sinkai_Kabe diff --git a/src/overlays/actors/ovl_En_Drs/z_en_drs.c b/src/overlays/actors/ovl_En_Drs/z_en_drs.c index eecd6be2d4..5ecab4fd48 100644 --- a/src/overlays/actors/ovl_En_Drs/z_en_drs.c +++ b/src/overlays/actors/ovl_En_Drs/z_en_drs.c @@ -51,7 +51,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS sAnimations = { &gWeddingDressMannequinIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }; +static AnimationInfoS sAnimationInfo = { &gWeddingDressMannequinIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }; void EnDrs_CollisionUpdate(EnDrs* this, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); @@ -65,7 +65,7 @@ void EnDrs_Setup(EnDrs* this, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gWeddingDressMannequinSkel, NULL, this->jointTable, this->morphTable, WEDDING_DRESS_MANNEQUIN_LIMB_MAX); - SubS_ChangeAnimationByInfoS(&this->skelAnime, &sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, &sAnimationInfo, 0); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); Actor_SetScale(&this->actor, 0.01f); diff --git a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c index 0d274c0e41..7e517ce092 100644 --- a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c +++ b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c @@ -32,7 +32,7 @@ const ActorInit En_Ds2n_InitVars = { (ActorFunc)EnDs2n_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gDs2nIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, }; @@ -43,7 +43,7 @@ static TexturePtr sEyeTextures[] = { gDs2nEyeOpenTex, gDs2nEyeHalfTex, gDs2nEyeC void EnDs2n_SetupIdle(EnDs2n* this) { this->blinkTimer = 20; this->blinkState = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = EnDs2n_Idle; } diff --git a/src/overlays/actors/ovl_En_Fg/z_en_fg.c b/src/overlays/actors/ovl_En_Fg/z_en_fg.c index 065f2c3707..8ad22ff53d 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -95,27 +95,27 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_fr_Anim_001534, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_fr_Anim_001534, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_fr_Anim_0011C0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_fr_Anim_0007BC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, }; -s32 EnFg_UpdateAnimation(SkelAnime* skelAnime, s16 animIndex) { +s32 EnFg_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) { s16 frameCount; s32 ret; ret = false; if (animIndex >= 0 && animIndex < 4) { ret = true; - frameCount = sAnimations[animIndex].frameCount; + frameCount = sAnimationInfo[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation); + frameCount = Animation_GetLastFrame(sAnimationInfo[animIndex].animation); } - Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, - sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode, - sAnimations[animIndex].morphFrames); + Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed, + sAnimationInfo[animIndex].startFrame, frameCount, sAnimationInfo[animIndex].mode, + sAnimationInfo[animIndex].morphFrames); } return ret; } @@ -221,7 +221,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) { default: if (DECR(this->timer) == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_JUMP); - EnFg_UpdateAnimation(&this->skelAnime, 3); + EnFg_ChangeAnim(&this->skelAnime, 3); this->actor.velocity.y = 10.0f; this->timer = Rand_S16Offset(30, 30); this->actionFunc = EnFg_Jump; @@ -256,7 +256,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) { case FG_DMGEFFECT_EXPLOSION: this->actor.flags &= ~ACTOR_FLAG_1; Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_0); - EnFg_UpdateAnimation(&this->skelAnime, 0); + EnFg_ChangeAnim(&this->skelAnime, 0); this->actor.params = FG_BLACK; this->skelAnime.playSpeed = 0.0f; ac = this->collider.base.ac; @@ -276,7 +276,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) { } if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & 1)) { - EnFg_UpdateAnimation(&this->skelAnime, 0); + EnFg_ChangeAnim(&this->skelAnime, 0); this->actionFunc = EnFg_Idle; this->actor.velocity.y = 0.0f; } else { @@ -316,7 +316,7 @@ void EnFg_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 10.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_fr_Skel_00B538, NULL, this->jointTable, this->morphTable, 24); - EnFg_UpdateAnimation(&this->skelAnime, 0); + EnFg_ChangeAnim(&this->skelAnime, 0); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index b67c61c43b..da250cd6ef 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -81,7 +81,7 @@ const ActorInit En_Fsn_InitVars = { (ActorFunc)EnFsn_Draw, }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gFsnIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gFsnScratchBackAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gFsnTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -711,21 +711,21 @@ void EnFsn_InitShop(EnFsn* this, PlayState* play) { this->stickAnimTween = this->arrowAnimTween = 0.0f; } this->blinkTimer = 20; - this->animationIndex = FSN_ANIM_HANDS_ON_COUNTER_START; + this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_START; this->eyeTextureIdx = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnFsn_Idle; } void EnFsn_Idle(EnFsn* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->animationIndex == FSN_ANIM_HANDS_ON_COUNTER_START) { + if (this->animIndex == FSN_ANIM_HANDS_ON_COUNTER_START) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (curFrame == frameCount) { - this->animationIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } return; } @@ -758,29 +758,29 @@ void EnFsn_Idle(EnFsn* this, PlayState* play) { void EnFsn_Haggle(EnFsn* this, PlayState* play) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (this->flags & ENFSN_ANGRY) { this->flags &= ~ENFSN_ANGRY; - this->animationIndex = FSN_ANIM_SLAM_COUNTER_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = FSN_ANIM_SLAM_COUNTER_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } else { - if (this->animationIndex == FSN_ANIM_SLAM_COUNTER_LOOP && Animation_OnFrame(&this->skelAnime, 18.0f)) { + if (this->animIndex == FSN_ANIM_SLAM_COUNTER_LOOP && Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); } if (this->flags & ENFSN_CALM_DOWN) { this->flags &= ~ENFSN_CALM_DOWN; - this->animationIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } else if (this->flags & ENFSN_OFFER_FINAL_PRICE) { this->flags &= ~ENFSN_OFFER_FINAL_PRICE; - this->animationIndex = FSN_ANIM_MAKE_OFFER; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = FSN_ANIM_MAKE_OFFER; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } else { - if (this->animationIndex == FSN_ANIM_MAKE_OFFER) { + if (this->animIndex == FSN_ANIM_MAKE_OFFER) { if (curFrame == frameCount) { - this->animationIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } else { if (Animation_OnFrame(&this->skelAnime, 28.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); @@ -1430,8 +1430,8 @@ void EnFsn_Init(Actor* thisx, PlayState* play) { this->eyeTextureIdx = 0; this->actor.flags |= ACTOR_FLAG_1; this->actor.targetMode = 0; - this->animationIndex = FSN_ANIM_IDLE; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = FSN_ANIM_IDLE; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnFsn_IdleBackroom; } } diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h index f003a79212..9479e982ea 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h @@ -64,7 +64,7 @@ typedef struct EnFsn { /* 0x444 */ u8 arrowAnimState; /* 0x445 */ u8 stickAnimState; /* 0x448 */ f32 shopItemSelectedTween; - /* 0x44C */ s16 animationIndex; + /* 0x44C */ s16 animIndex; /* 0x44E */ u16 flags; } EnFsn; // size = 0x450 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 1fc17535f7..d700290b50 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -73,7 +73,7 @@ static Vec3f D_80964B0C = { 0.0f, 60.0f, -8.0f }; static Vec3f D_80964B18 = { 0.0f, 55.0f, 12.0f }; static Vec3f D_80964B24 = { 0.0f, 60.0f, 0.0f }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_mu_Anim_0053E0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_mu_Anim_001F74, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_mu_Anim_002F64, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, @@ -371,7 +371,7 @@ void func_8096209C(EnFu* this, PlayState* play) { } void func_809622FC(EnFu* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80962340; } @@ -536,7 +536,7 @@ void func_80962660(EnFu* this, PlayState* play) { func_801477B4(play); player->stateFlags1 |= 0x20; this->unk_53C = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_801A2BB8(NA_BGM_MINI_GAME_2); if (this->unk_542 == 0) { if (this->unk_546 == 1) { @@ -1214,7 +1214,7 @@ void func_80964190(EnFu* this, PlayState* play) { case 0x2842: case 0x2844: case 0x2848: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; case 0x2840: @@ -1240,21 +1240,21 @@ void func_80964190(EnFu* this, PlayState* play) { case 0x286B: case 0x286D: case 0x2871: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); break; case 0x2860: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); break; case 0x285F: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); break; case 0x287E: case 0x2880: case 0x2883: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); break; } } 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 a222a1905e..ad0d3de241 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -72,7 +72,7 @@ typedef enum { /* 9 */ GERUDO_WHITE_ANIM_BLOWN_AWAY, } GerudoWhiteAnimations; -void EnGe1_SetAnimation(EnGe1* this, s16 index, u8 mode, f32 morphFrames); +void EnGe1_ChangeAnim(EnGe1* this, s16 animIndex, u8 mode, f32 morphFrames); void EnGe1_ShadowDraw(Actor* actor, Lights* lights, PlayState* play); void EnGe1_Wait(EnGe1* this, PlayState* play); void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play); @@ -88,9 +88,9 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { this->picto.actor.colChkInfo.mass = MASS_IMMOVABLE; this->picto.actor.targetMode = 6; Actor_SetScale(&this->picto.actor, 0.01f); - this->curAnim = this->csAction = -1; // GERUDO_WHITE_ANIM_NONE + this->animIndex = this->csAction = -1; // GERUDO_WHITE_ANIM_NONE this->stateFlags = 0; - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f); this->actionFunc = EnGe1_Wait; this->picto.validationFunc = EnGe1_ValidatePictograph; @@ -127,7 +127,7 @@ void EnGe1_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void EnGe1_SetAnimation(EnGe1* this, s16 index, u8 mode, f32 morphFrames) { +void EnGe1_ChangeAnim(EnGe1* this, s16 animIndex, u8 mode, f32 morphFrames) { static AnimationHeader* sAnimations[] = { &gGerudoWhiteArmsFoldedAnim, // GERUDO_WHITE_ANIM_ARMS_FOLDED, &gGerudoWhiteUnfoldingArmsAnim, // GERUDO_WHITE_ANIM_UNFOLDING_ARMS @@ -143,22 +143,22 @@ void EnGe1_SetAnimation(EnGe1* this, s16 index, u8 mode, f32 morphFrames) { // The GERUDO_WHITE_ANIM_LEADING_BOAT / GERUDO_WHITE_ANIM_BLOWN_AWAY cases are single frames of an "animation" used // as static poses. - switch (index) { + switch (animIndex) { case GERUDO_WHITE_ANIM_LEADING_BOAT: - Animation_Change(&this->skelAnime, sAnimations[index], 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); + Animation_Change(&this->skelAnime, sAnimations[animIndex], 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); break; case GERUDO_WHITE_ANIM_BLOWN_AWAY: - Animation_Change(&this->skelAnime, sAnimations[index], 0.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 0.0f); + Animation_Change(&this->skelAnime, sAnimations[animIndex], 0.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 0.0f); break; default: - Animation_Change(&this->skelAnime, sAnimations[index], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimations[index]), mode, morphFrames); + Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimations[animIndex]), mode, morphFrames); break; } - this->curAnim = index; + this->animIndex = animIndex; } void EnGe1_LookAtPlayer(EnGe1* this, PlayState* play) { @@ -257,7 +257,7 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { s16 csAction; if (SkelAnime_Update(&this->skelAnime) && (this->csAction == 3)) { - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_STIFF_SHIVERING, ANIMMODE_LOOP, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_STIFF_SHIVERING, ANIMMODE_LOOP, 0.0f); } if (Cutscene_CheckActorAction(play, 0x79)) { @@ -284,27 +284,27 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { switch (this->csAction) { // Aveil cutscene case 1: - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f); break; case 2: - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_STANDING_HEAD_BOWED, ANIMMODE_LOOP, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_STANDING_HEAD_BOWED, ANIMMODE_LOOP, 0.0f); break; case 3: - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_STIFFENING, ANIMMODE_ONCE, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_STIFFENING, ANIMMODE_ONCE, 0.0f); break; case 4: - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_TRUDGING_OFF, ANIMMODE_ONCE, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_TRUDGING_OFF, ANIMMODE_ONCE, 0.0f); break; case 5: - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_EXCITED_CLAPPING, ANIMMODE_LOOP, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_EXCITED_CLAPPING, ANIMMODE_LOOP, 0.0f); break; case 6: - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_SALUTE, ANIMMODE_ONCE, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_SALUTE, ANIMMODE_ONCE, 0.0f); break; case 7: @@ -313,11 +313,11 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { // Twister cutscene case 8: - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_LEADING_BOAT, ANIMMODE_ONCE, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_LEADING_BOAT, ANIMMODE_ONCE, 0.0f); break; case 9: - EnGe1_SetAnimation(this, GERUDO_WHITE_ANIM_BLOWN_AWAY, ANIMMODE_ONCE, 0.0f); + EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_BLOWN_AWAY, ANIMMODE_ONCE, 0.0f); EnGe1_SetupPath(this, play); this->stateFlags |= GERUDO_WHITE_STATE_DISABLE_MOVEMENT; this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f); @@ -327,12 +327,12 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); } - if ((this->curAnim == GERUDO_WHITE_ANIM_TRUDGING_OFF) && + if ((this->animIndex == GERUDO_WHITE_ANIM_TRUDGING_OFF) && (Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 25.0f))) { Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK); } - if ((this->curAnim == GERUDO_WHITE_ANIM_SALUTE) && Animation_OnFrame(&this->skelAnime, 14.0f)) { + if ((this->animIndex == GERUDO_WHITE_ANIM_SALUTE) && Animation_OnFrame(&this->skelAnime, 14.0f)) { Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK); } } else { @@ -401,7 +401,7 @@ s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p rot->x += this->headRot.y; rot->z += this->headRot.x; } - if (this->curAnim == GERUDO_WHITE_ANIM_ARMS_FOLDED) { + if (this->animIndex == GERUDO_WHITE_ANIM_ARMS_FOLDED) { // Make small fidgeting movements if in standing animation. if ((limbIndex == GERUDO_WHITE_LIMB_TORSO) || (limbIndex == GERUDO_WHITE_LIMB_LEFT_FOREARM) || (limbIndex == GERUDO_WHITE_LIMB_RIGHT_FOREARM)) { diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index b27a3c3de5..ae6cc601ea 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -33,7 +33,7 @@ typedef struct EnGe1 { /* 0x2B8 */ s16 eyeIndex; /* 0x2BA */ s16 blinkTimer; /* 0x2BC */ u16 stateFlags; - /* 0x2BE */ s16 curAnim; // Index + /* 0x2BE */ s16 animIndex; /* 0x2C0 */ s16 csAction; /* 0x2C2 */ s16 screamTimer; /* 0x2C4 */ u8 hairstyle; diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index 18adc2e83b..1766b8e322 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -126,7 +126,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gGoronLyingDownIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gGoronLyingDownIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &gGoronUnrollAnim, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -379,7 +379,7 @@ void func_80BB1FCC(EnGeg* this, PlayState* play) { void func_80BB2020(EnGeg* this, PlayState* play) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_248].segment); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_4AC); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_4AC); } s32 func_80BB2088(EnGeg* this, PlayState* play) { @@ -609,7 +609,7 @@ void func_80BB27D4(EnGeg* this, PlayState* play) { void func_80BB2944(EnGeg* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_4AC].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_4AC].animation); if (this->unk_4AC == 19) { if (curFrame == lastFrame) { @@ -705,7 +705,7 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) { void func_80BB2E00(EnGeg* this, PlayState* play) { s16 sp2E = this->skelAnime.curFrame; - s16 sp2C = Animation_GetLastFrame(sAnimations[this->unk_4AC].animation); + s16 sp2C = Animation_GetLastFrame(sAnimationInfo[this->unk_4AC].animation); if (this->unk_4AC == 2) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100); diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c index 04acac9dce..5c46061856 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -95,7 +95,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_gg_Anim_00F578, 1.0f, 0.0f, 0.0f, 0, -10.0f }, { &object_gg_Anim_00D528, 1.0f, 0.0f, 0.0f, 2, -10.0f }, { &object_gg_Anim_00D174, 1.0f, 0.0f, 0.0f, 2, -10.0f }, { &object_gg_Anim_00ECC0, 1.0f, 0.0f, 0.0f, 2, -10.0f }, { &object_gg_Anim_00BAF0, 1.0f, 0.0f, 0.0f, 0, -10.0f }, { &object_gg_Anim_00AF40, 1.0f, 0.0f, 0.0f, 0, -10.0f }, @@ -170,46 +170,46 @@ void func_80B35250(EnGg* this) { this->unk_2E4 = 20; this->unk_2E2 = 0; this->unk_2E6 = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80B35450; } void func_80B352A4(EnGg* this, PlayState* play) { s16 sp26 = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E6].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E6].animation); if (sp26 == lastFrame) { switch (this->actor.textId) { case 0xCE5: this->unk_2E6 = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; case 0xCE6: case 0xCEC: this->unk_2E6 = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); break; case 0xCE8: this->unk_2E6 = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); break; case 0xCE9: this->unk_2E6 = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); break; case 0xCED: case 0xCEE: this->unk_2E6 = 4; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); break; default: this->unk_2E6 = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); break; } gSaveContext.save.weekEventReg[19] |= 0x80; @@ -219,7 +219,7 @@ void func_80B352A4(EnGg* this, PlayState* play) { this->skelAnime.playSpeed = 2.0f; } else { this->unk_2E6 = 4; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); } } } @@ -326,7 +326,7 @@ void func_80B35634(EnGg* this, PlayState* play) { this->unk_2DA = 0; break; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2DA); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_2DA); } if (this->unk_2DA == 14) { @@ -366,11 +366,11 @@ void func_80B3584C(EnGg* this) { void func_80B358D8(EnGg* this, PlayState* play) { s16 sp1E = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2DA].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2DA].animation); if ((this->unk_2E6 == 14) && (sp1E == lastFrame)) { this->unk_2E6 = 15; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 15); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 15); } } diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.c b/src/overlays/actors/ovl_En_Giant/z_en_giant.c index 61eac74f8b..7021b0e0cf 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c @@ -32,23 +32,23 @@ void EnGiant_PerformCutsceneActions(EnGiant* this, PlayState* play); * These values are used to index into sAnimations to pick the appropriate animation. */ typedef enum { - /* 0 */ GIANT_ANIMATION_LOOK_UP_START, - /* 1 */ GIANT_ANIMATION_LOOK_UP_LOOP, - /* 2 */ GIANT_ANIMATION_FALLING_OVER, - /* 3 */ GIANT_ANIMATION_RAISED_ARMS_START, - /* 4 */ GIANT_ANIMATION_RAISED_ARMS_LOOP, - /* 5 */ GIANT_ANIMATION_STRUGGLE_START, - /* 6 */ GIANT_ANIMATION_STRUGGLE_LOOP, - /* 7 */ GIANT_ANIMATION_IDLE_LOOP, - /* 8 */ GIANT_ANIMATION_WALKING_LOOP, - /* 9 */ GIANT_ANIMATION_BIG_CALL_START, - /* 10 */ GIANT_ANIMATION_BIG_CALL_LOOP, - /* 11 */ GIANT_ANIMATION_BIG_CALL_END, - /* 12 */ GIANT_ANIMATION_SMALL_CALL_START, - /* 13 */ GIANT_ANIMATION_SMALL_CALL_LOOP, - /* 14 */ GIANT_ANIMATION_SMALL_CALL_END, - /* 15 */ GIANT_ANIMATION_MAX -} GiantAnimationIndex; + /* 0 */ GIANT_ANIM_LOOK_UP_START, + /* 1 */ GIANT_ANIM_LOOK_UP_LOOP, + /* 2 */ GIANT_ANIM_FALLING_OVER, + /* 3 */ GIANT_ANIM_RAISED_ARMS_START, + /* 4 */ GIANT_ANIM_RAISED_ARMS_LOOP, + /* 5 */ GIANT_ANIM_STRUGGLE_START, + /* 6 */ GIANT_ANIM_STRUGGLE_LOOP, + /* 7 */ GIANT_ANIM_IDLE_LOOP, + /* 8 */ GIANT_ANIM_WALKING_LOOP, + /* 9 */ GIANT_ANIM_BIG_CALL_START, + /* 10 */ GIANT_ANIM_BIG_CALL_LOOP, + /* 11 */ GIANT_ANIM_BIG_CALL_END, + /* 12 */ GIANT_ANIM_SMALL_CALL_START, + /* 13 */ GIANT_ANIM_SMALL_CALL_LOOP, + /* 14 */ GIANT_ANIM_SMALL_CALL_END, + /* 15 */ GIANT_ANIM_MAX +} GiantAnimation; /** * Used as values for csAction. The UNKNOWN ones are never used in-game. @@ -91,16 +91,16 @@ static AnimationHeader* sAnimations[] = { &gGiantSmallCallStartAnim, &gGiantSmallCallLoopAnim, &gGiantSmallCallEndAnim, }; -void EnGiant_ChangeAnimation(EnGiant* this, s16 newAnimationId) { - if (newAnimationId >= GIANT_ANIMATION_LOOK_UP_START && newAnimationId < GIANT_ANIMATION_MAX) { - if ((this->animationId == GIANT_ANIMATION_WALKING_LOOP && newAnimationId != GIANT_ANIMATION_WALKING_LOOP) || - (newAnimationId == GIANT_ANIMATION_WALKING_LOOP && this->animationId != GIANT_ANIMATION_WALKING_LOOP)) { - Animation_Change(&this->skelAnime, sAnimations[newAnimationId], 1.0f, 0.0f, - Animation_GetLastFrame(&sAnimations[newAnimationId]->common), ANIMMODE_ONCE, 10.0f); +void EnGiant_ChangeAnim(EnGiant* this, s16 animIndex) { + if (animIndex >= GIANT_ANIM_LOOK_UP_START && animIndex < GIANT_ANIM_MAX) { + if (((this->animIndex == GIANT_ANIM_WALKING_LOOP) && (animIndex != GIANT_ANIM_WALKING_LOOP)) || + ((animIndex == GIANT_ANIM_WALKING_LOOP) && (this->animIndex != GIANT_ANIM_WALKING_LOOP))) { + Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(&sAnimations[animIndex]->common), ANIMMODE_ONCE, 10.0f); } else { - Animation_PlayOnce(&this->skelAnime, sAnimations[newAnimationId]); + Animation_PlayOnce(&this->skelAnime, sAnimations[animIndex]); } - this->animationId = newAnimationId; + this->animIndex = animIndex; } } @@ -153,7 +153,7 @@ void EnGiant_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.32f); SkelAnime_InitFlex(play, &this->skelAnime, &gGiantSkel, &gGiantLargeStrideAnim, this->jointTable, this->morphTable, GIANT_LIMB_MAX); - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); this->csAction = GIANT_CS_ACTION_NONE; this->actionFunc = EnGiant_PerformCutsceneActions; this->actor.draw = NULL; @@ -246,14 +246,14 @@ void EnGiant_Destroy(Actor* thisx, PlayState* play) { * this function is to play the requested start animation if it has not been * played yet and play the respetive looping animation otherwise. */ -void EnGiant_ChangeToStartOrLoopAnimation(EnGiant* this, s16 requestedAnimationId) { - s16 nextAnimationId = requestedAnimationId + 1; +void EnGiant_ChangeToStartOrLoopAnimation(EnGiant* this, s16 requestedAnimIndex) { + s16 nextAnimIndex = requestedAnimIndex + 1; - if (this->animationId != nextAnimationId) { - if (this->animationId != requestedAnimationId) { - EnGiant_ChangeAnimation(this, requestedAnimationId); + if (this->animIndex != nextAnimIndex) { + if (this->animIndex != requestedAnimIndex) { + EnGiant_ChangeAnim(this, requestedAnimIndex); } else { - EnGiant_ChangeAnimation(this, nextAnimationId); + EnGiant_ChangeAnim(this, nextAnimIndex); } } } @@ -261,45 +261,45 @@ void EnGiant_ChangeToStartOrLoopAnimation(EnGiant* this, s16 requestedAnimationI /** * Immediately switches to the specified animation for this cutscene action. */ -void EnGiant_ChangeAnimationBasedOnCsAction(EnGiant* this) { +void EnGiant_ChangeAnimBasedOnCsAction(EnGiant* this) { switch (this->csAction) { case GIANT_CS_ACTION_IDLE: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); break; case GIANT_CS_ACTION_WALKING: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_WALKING_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP); break; case GIANT_CS_ACTION_STRUGGLING: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_STRUGGLE_START); + EnGiant_ChangeAnim(this, GIANT_ANIM_STRUGGLE_START); break; case GIANT_CS_ACTION_FALLING_OVER: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_FALLING_OVER); + EnGiant_ChangeAnim(this, GIANT_ANIM_FALLING_OVER); break; case GIANT_CS_ACTION_IDLE_FADE_IN: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); this->alpha = 0; break; case GIANT_CS_ACTION_TALKING: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_BIG_CALL_START); + EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_START); break; case GIANT_CS_ACTION_DONE_TALKING: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_BIG_CALL_END); + EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_END); break; case GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_SMALL_CALL_START); + EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_START); break; case GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_SMALL_CALL_END); + EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_END); break; case GIANT_CS_ACTION_UNKNOWN_12: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); break; case GIANT_CS_ACTION_UNKNOWN_13: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_WALKING_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP); break; case GIANT_CS_ACTION_UNKNOWN_14: - if (this->animationId != GIANT_ANIMATION_WALKING_LOOP) { - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_WALKING_LOOP); + if (this->animIndex != GIANT_ANIM_WALKING_LOOP) { + EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP); } break; case GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER: @@ -336,31 +336,31 @@ void EnGiant_UpdateAlpha(EnGiant* this) { */ void EnGiant_PlayAndUpdateAnimation(EnGiant* this) { if (SkelAnime_Update(&this->skelAnime) && - (this->animationId != GIANT_ANIMATION_FALLING_OVER || this->csAction != GIANT_CS_ACTION_FALLING_OVER)) { - EnGiant_ChangeAnimation(this, this->animationId); + (this->animIndex != GIANT_ANIM_FALLING_OVER || this->csAction != GIANT_CS_ACTION_FALLING_OVER)) { + EnGiant_ChangeAnim(this, this->animIndex); switch (this->csAction) { case GIANT_CS_ACTION_LOOKING_UP: - EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIMATION_LOOK_UP_START); + EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_LOOK_UP_START); break; case GIANT_CS_ACTION_RAISING_ARMS: - EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIMATION_RAISED_ARMS_START); + EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_RAISED_ARMS_START); break; case GIANT_CS_ACTION_STRUGGLING: - EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIMATION_STRUGGLE_START); + EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_STRUGGLE_START); break; case GIANT_CS_ACTION_FALLING_OVER: // Unused - EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIMATION_FALLING_OVER); + EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_FALLING_OVER); break; case GIANT_CS_ACTION_TALKING: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_BIG_CALL_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_LOOP); break; case GIANT_CS_ACTION_DONE_TALKING: case GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); break; case GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER: - EnGiant_ChangeAnimation(this, GIANT_ANIMATION_SMALL_CALL_LOOP); + EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_LOOP); break; } SkelAnime_Update(&this->skelAnime); @@ -369,20 +369,20 @@ void EnGiant_PlayAndUpdateAnimation(EnGiant* this) { void EnGiant_PlaySound(EnGiant* this) { if (this->actor.draw != NULL && this->alpha > 0) { - if (this->animationId == GIANT_ANIMATION_WALKING_LOOP && + if (this->animIndex == GIANT_ANIM_WALKING_LOOP && (Animation_OnFrame(&this->skelAnime, 40.0f) || Animation_OnFrame(&this->skelAnime, 100.0f))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_WALK); } - if (this->animationId == GIANT_ANIMATION_FALLING_OVER && Animation_OnFrame(&this->skelAnime, 40.0f)) { + if (this->animIndex == GIANT_ANIM_FALLING_OVER && Animation_OnFrame(&this->skelAnime, 40.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_VOICE_FAIL); } if (this->sfxId != 0xFFFF && - ((this->animationId == GIANT_ANIMATION_BIG_CALL_START && this->skelAnime.curFrame >= 18.0f) || - this->animationId == GIANT_ANIMATION_BIG_CALL_LOOP)) { + ((this->animIndex == GIANT_ANIM_BIG_CALL_START && this->skelAnime.curFrame >= 18.0f) || + this->animIndex == GIANT_ANIM_BIG_CALL_LOOP)) { func_800B9010(&this->actor, this->sfxId); } - if ((this->animationId == GIANT_ANIMATION_SMALL_CALL_START && this->skelAnime.curFrame >= 18.0f) || - this->animationId == GIANT_ANIMATION_SMALL_CALL_LOOP) { + if ((this->animIndex == GIANT_ANIM_SMALL_CALL_START && this->skelAnime.curFrame >= 18.0f) || + this->animIndex == GIANT_ANIM_SMALL_CALL_LOOP) { func_800B9010(&this->actor, NA_SE_EV_KYOJIN_SIGN - SFX_FLAG); } } @@ -405,7 +405,7 @@ void EnGiant_PerformClockTowerSuccessActions(EnGiant* this, PlayState* play) { play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action) { this->csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action; - EnGiant_ChangeAnimationBasedOnCsAction(this); + EnGiant_ChangeAnimBasedOnCsAction(this); } EnGiant_UpdateAlpha(this); } @@ -430,7 +430,7 @@ void EnGiant_PerformCutsceneActions(EnGiant* this, PlayState* play) { play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action) { this->csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action; - EnGiant_ChangeAnimationBasedOnCsAction(this); + EnGiant_ChangeAnimBasedOnCsAction(this); } EnGiant_UpdateAlpha(this); } diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.h b/src/overlays/actors/ovl_En_Giant/z_en_giant.h index ff4a79485c..3b2cac192c 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.h +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.h @@ -47,7 +47,7 @@ typedef struct EnGiant { /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ Vec3s jointTable[GIANT_LIMB_MAX]; /* 0x1E8 */ Vec3s morphTable[GIANT_LIMB_MAX]; - /* 0x248 */ s16 animationId; + /* 0x248 */ s16 animIndex; /* 0x24A */ u16 actorActionCommand; /* 0x24C */ u16 csAction; /* 0x24E */ s16 alpha; diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index 585f5df17c..ca6c27b0eb 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -42,7 +42,15 @@ const ActorInit En_Ginko_Man_InitVars = { (ActorFunc)EnGinkoMan_Draw, }; -static AnimationInfo sAnimations[] = { +typedef enum { + /* 0 */ GINKO_ANIM_LEGSMACKING, + /* 1 */ GINKO_ANIM_SITTING, + /* 2 */ GINKO_ANIM_REACHING, + /* 3 */ GINKO_ANIM_AMAZED, + /* 4 */ GINKO_ANIM_ADVERTISING, +} GinkoAnimation; + +static AnimationInfo sAnimationInfo[] = { { &object_boj_Anim_0008C0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_boj_Anim_0043F0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_boj_Anim_004F40, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, @@ -72,7 +80,7 @@ void EnGinkoMan_Destroy(Actor* thisx, PlayState* play) { void EnGinkoMan_SetupIdle(EnGinkoMan* this) { this->actor.flags |= ACTOR_FLAG_1; // targetable - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); this->actionFunc = EnGinkoMan_Idle; } @@ -82,11 +90,11 @@ void EnGinkoMan_Idle(EnGinkoMan* this, PlayState* play) { EnGinkoMan_SwitchAnimation(this, play); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if ((gSaveContext.save.bankRupees & 0xFFFF) == 0) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); Message_StartTextbox(play, 0x44C, &this->actor); this->curTextId = 0x44C; // would you like to make an account } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) { Message_StartTextbox(play, 0x467, &this->actor); this->curTextId = 0x467; // "What's this? You need somethin' on a day like this? @@ -109,7 +117,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { switch (this->curTextId) { case 0x44C: // "Hey there, little guy! Won't you deposit some Rupees? (first dialogue) - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); if (gSaveContext.save.weekEventReg[10] & 8) { Message_StartTextbox(play, 0x44E, &this->actor); this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees" @@ -124,7 +132,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees" break; case 0x44F: // "...So, what'll it be? Deposit Rupees Don't deposit Rupees" - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); Message_StartTextbox(play, 0x450, &this->actor); this->curTextId = 0x450; // "How much? How much? [rupee prompt] break; @@ -135,14 +143,14 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { if (this->isNewAccount == true) { this->isNewAccount = false; if (this->curTextId != 0x453) { // "That's it? That ain't nothing at all, big spender! - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); } Message_StartTextbox(play, 0x461, &this->actor); this->curTextId = 0x461; // So, little guy, what's your name? } else { if (this->curTextId == 0x453) { // "That's it? That ain't nothing at all, big spender! - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); } play->msgCtx.bankRupees = gSaveContext.save.bankRupees & 0xFFFF; @@ -172,17 +180,17 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { Message_StartTextbox(play, 0x45D, &this->actor); this->curTextId = 0x45D; // "What's this? You've already saved up 5000 Rupees?! } else if (this->previousBankValue < (s16)(gSaveContext.save.bankRupees & 0xFFFF)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); Message_StartTextbox(play, 0x45E, &this->actor); this->curTextId = 0x45E; // "...Hang on there, little guy. I can't take any more deposits. Sorry..." } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); Message_StartTextbox(play, 0x460, &this->actor); this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!" } } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); Message_StartTextbox(play, 0x460, &this->actor); this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!" } @@ -212,7 +220,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { EnGinkoMan_SetupStamp(this); // stamp player break; case 0x465: // "There! Now I'll know you when I see you!" - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); play->msgCtx.bankRupees = gSaveContext.save.bankRupees & 0xFFFF; Message_StartTextbox(play, 0x45A, &this->actor); this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!" @@ -269,7 +277,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { break; case 0x476: // "...You haven't deposited that many Rupees, so that much isn't available for withdrawal. Do the // math! - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); case 0x475: // "What's this? Look, little guy, you can't hold this many rupees! You got that?" case 0x47C: // "Is that so? Think it over, little guy! So what are you gonna do?" case 0x47D: // duplicate of 48 @@ -336,7 +344,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) { if (play->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) { if (gSaveContext.save.playerData.rupees < play->msgCtx.bankRupeesSelected) { play_sound(NA_SE_SY_ERROR); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); Message_StartTextbox(play, 0x459, &this->actor); this->curTextId = 0x459; // HEY you dont have that much } else { @@ -348,7 +356,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) { Message_StartTextbox(play, 0x454, &this->actor); this->curTextId = 0x454; // Seriously? that's a lot. A lot! } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); Message_StartTextbox(play, 0x453, &this->actor); this->curTextId = 0x453; // That's it? That aint nothing at all } @@ -365,7 +373,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) { } } else { // GINKOMAN_CHOICE_NO func_8019F230(); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); if ((gSaveContext.save.bankRupees & 0xFFFF) == 0) { Message_StartTextbox(play, 0x456, &this->actor); this->curTextId = 0x456; // Is that so? think about it @@ -398,7 +406,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) { if ((s32)((gSaveContext.save.bankRupees & 0xFFFF)) < ((s32)(play->msgCtx.bankRupeesSelected + this->serviceFee))) { play_sound(NA_SE_SY_ERROR); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); Message_StartTextbox(play, 0x476, &this->actor); this->curTextId = 0x476; // you dont have enough deposited to withdrawl } else if (CUR_CAPACITY(UPG_WALLET) < @@ -441,7 +449,7 @@ void EnGinkoMan_WaitForRupeeCount(EnGinkoMan* this, PlayState* play) { switch (this->curTextId) { case 0x450: // "How much? How much?" [rupee prompt] Set the amount with [Control Stick] and if (play->msgCtx.bankRupeesSelected == 0) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); Message_StartTextbox(play, 0x457, &this->actor); this->curTextId = 0x457; // Zero Rupees? Cruel joke! } else { @@ -545,7 +553,7 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, PlayState* play) { Message_StartTextbox(play, 0x47A, &this->actor); this->curTextId = 0x47A; // Message after receiving reward for depositing 200 rupees. } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); Message_StartTextbox(play, 0x47B, &this->actor); this->curTextId = 0x47B; // Message after receiving reward for depositing 1000 rupees. } @@ -564,7 +572,7 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, PlayState* play) { } void EnGinkoMan_SetupStamp(EnGinkoMan* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_REACHING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_REACHING); this->actionFunc = EnGinkoMan_Stamp; } @@ -577,12 +585,12 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { switch (this->curTextId) { case 0x464: // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt." - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); Message_StartTextbox(play, 0x465, &this->actor); this->curTextId = 0x465; // "There! Now I'll know you when I see you!" break; case 0x469: // "Excuse me, but let me take a look at you..." - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); play->msgCtx.bankRupees = (gSaveContext.save.bankRupees & 0xFFFF); if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) { Message_StartTextbox(play, 0x46C, &this->actor); @@ -603,12 +611,12 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, PlayState* play) { if (this->animTimer == 0) { if (this->skelAnime.animation != &object_boj_Anim_004A7C) { this->animTimer = 40; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_ADVERTISING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_ADVERTISING); } } } else if ((this->animTimer == 0) && (this->skelAnime.animation != &object_boj_Anim_000AC4)) { this->animTimer = 40; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_AMAZED); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_AMAZED); } DECR(this->animTimer); diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h index 3ed6bc89be..808ea7c2f6 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h @@ -34,12 +34,4 @@ extern const ActorInit En_Ginko_Man_InitVars; #define GINKOMAN_CHOICE_YES 0 #define GINKOMAN_CHOICE_NO 1 -typedef enum { - /* 0 */ GINKO_FLOORSMACKING, - /* 1 */ GINKO_SITTING, - /* 2 */ GINKO_REACHING, - /* 3 */ GINKO_AMAZED, - /* 4 */ GINKO_ADVERTISING, -} GinkoAnimationIndex; - #endif // Z_EN_GINKO_MAN_H diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c index d2d843d19b..235b4ba9ff 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -102,7 +102,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_gk_Anim_00787C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_007DC4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_gk_Anim_0092C0, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_005EDC, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_009638, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_008774, 1.0f, 0.0f, 0.0f, 0, 0.0f }, @@ -259,7 +259,7 @@ s32 func_80B50854(EnGk* this, PlayState* play) { (play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY)) { Flags_SetSwitch(play, ENGK_GET_3F00(&this->actor)); this->unk_2E4 = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->actionFunc = func_80B521E8; return true; } @@ -483,21 +483,21 @@ s32 func_80B5123C(EnGk* this, PlayState* play) { void func_80B51308(EnGk* this, PlayState* play) { s16 sp1E = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_31A].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_31A].animation); if ((this->unk_2E4 == 7) && (sp1E == lastFrame)) { this->unk_2E4 = 8; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); } } void func_80B51398(EnGk* this, PlayState* play) { s16 sp1E = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[9].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[9].animation); if ((this->unk_2E4 == 9) && (sp1E == lastFrame)) { this->unk_2E4 = 10; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 10); } } @@ -577,7 +577,7 @@ void func_80B51510(EnGk* this, PlayState* play) { Flags_SetSwitch(play, ENGK_GET_3F00(&this->actor)); break; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_31A); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_31A); } if (this->unk_31A == 7) { @@ -593,19 +593,19 @@ void func_80B51510(EnGk* this, PlayState* play) { void func_80B51698(EnGk* this, PlayState* play) { s16 sp26 = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation); if (sp26 == lastFrame) { switch (this->unk_2E4) { case 0: this->unk_2E4 = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80B5216C; break; case 2: this->unk_2E4 = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80B5202C; break; } @@ -617,16 +617,16 @@ void func_80B51760(EnGk* this, PlayState* play) { s16 lastFrame; if (this->unk_2E4 == 11) { - lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation); + lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation); if (sp2E == lastFrame) { this->unk_2E4 = 5; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2E4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_2E4); } } else if (this->unk_2E4 == 10) { - lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation); + lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation); if (sp2E == lastFrame) { this->unk_2E4 = 11; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2E4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_2E4); } } else { if (Flags_GetSwitch(play, ENGK_GET_3F00(&this->actor))) { @@ -692,7 +692,7 @@ void func_80B51970(EnGk* this, PlayState* play) { if (this->unk_2E4 != 10) { if (this->unk_2E4 != 9) { this->unk_2E4 = 9; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); } else { func_80B51398(this, play); } @@ -759,7 +759,7 @@ void func_80B51B40(EnGk* this, PlayState* play) { if (this->unk_2E4 != 10) { if (this->unk_2E4 != 9) { this->unk_2E4 = 9; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); } else { func_80B51398(this, play); } @@ -778,7 +778,7 @@ void func_80B51D9C(EnGk* this, PlayState* play) { if (this->unk_1E4 & 4) { this->unk_1E4 &= ~4; this->unk_2E4 = 6; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); this->actionFunc = func_80B51EA4; } else { this->unk_1E4 |= 4; @@ -879,18 +879,18 @@ void func_80B5216C(EnGk* this, PlayState* play) { void func_80B521E8(EnGk* this, PlayState* play) { s16 sp1E = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation); if (sp1E == lastFrame) { this->unk_2E4 = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80B5227C; } } void func_80B5227C(EnGk* this, PlayState* play) { s16 sp26 = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_2E4].animation); if ((sp26 + 1) == lastFrame) { func_800B14D4(play, 20.0f, &this->actor.home.pos); @@ -1018,7 +1018,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) { if (ENGK_GET_F(&this->actor) == ENGK_F_1) { this->unk_2E4 = 5; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); if (play->sceneNum == SCENE_17SETUGEN2) { if (Flags_GetSwitch(play, ENGK_GET_3F00(&this->actor))) { Actor_MarkForDeath(&this->actor); @@ -1056,7 +1056,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) { this->unk_318 = this->actor.cutscene; this->actor.flags |= ACTOR_FLAG_10; this->actor.flags |= ACTOR_FLAG_2000000; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80B5202C; } else { this->actionFunc = func_80B52654; 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 0a49db1d14..5bffff8d21 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -209,7 +209,7 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS D_80951CC0[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_in2_Anim_009CDC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_in2_Anim_009CDC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_in2_Anim_00A5E0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, @@ -317,7 +317,7 @@ s32 func_8094E054(EnGm* this, PlayState* play, s32 arg2) { if (phi_v1) { if (tmp >= 0) { this->unk_3E8 = arg2; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80951CC0, arg2); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2); this->unk_3A8 = this->skelAnime.playSpeed; } } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 0a88c26f3d..48095aef2e 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -186,7 +186,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gGoronLyingDownIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gGoronLyingDownIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &gGoronUnrollAnim, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -793,7 +793,7 @@ s32 func_80A12C48(EnGo* this, PlayState* play, s32 arg2) { if (objIdx2 >= 0) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIdx2].segment); this->unk_3DC = arg2; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2); this->unk_398 = this->skelAnime.playSpeed; gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIdx].segment); } diff --git a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c index 843657b601..a08d0835f2 100644 --- a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c +++ b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c @@ -16,7 +16,7 @@ void EnGuardNuts_Destroy(Actor* thisx, PlayState* play); void EnGuardNuts_Update(Actor* thisx, PlayState* play); void EnGuardNuts_Draw(Actor* thisx, PlayState* play); -void EnGuardNuts_ChangeAnim(EnGuardNuts* this, s32 index); +void EnGuardNuts_ChangeAnim(EnGuardNuts* this, s32 animIndex); void EnGuardNuts_SetupWait(EnGuardNuts* this); void EnGuardNuts_Wait(EnGuardNuts* this, PlayState* play); void func_80ABB540(EnGuardNuts* this); @@ -72,7 +72,7 @@ static AnimationHeader* sAnimations[] = { &gDekuPalaceGuardWalkAnim, }; -static u8 sAnimModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE }; +static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE }; static TexturePtr sEyeTextures[] = { gDekuPalaceGuardEyeOpenTex, @@ -126,13 +126,13 @@ void EnGuardNuts_Destroy(Actor* thisx, PlayState* play) { * @brief Changes the animation to the provided index. Updates animIndex and animFrameCount for the animation. * * @param this - * @param index the index of sAnimations to change to + * @param animIndex the index of sAnimations to change to */ -void EnGuardNuts_ChangeAnim(EnGuardNuts* this, s32 index) { - this->animIndex = index; +void EnGuardNuts_ChangeAnim(EnGuardNuts* this, s32 animIndex) { + this->animIndex = animIndex; this->animFrameCount = Animation_GetLastFrame(sAnimations[this->animIndex]); Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->animFrameCount, - sAnimModes[this->animIndex], -2.0f); + sAnimationModes[this->animIndex], -2.0f); } void EnGuardNuts_SetupWait(EnGuardNuts* this) { diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c index 8fe8d58f7d..01f0015f0d 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c @@ -62,9 +62,9 @@ static ColliderCylinderInit sCylinderInit = { { 15, 20, 0, { 0, 0, 0 } }, }; -static AnimationHeader* D_80BC79CC[] = { &object_fu_Anim_000B04, &object_fu_Anim_00057C }; -static u8 D_80BC79D4[] = { ANIMMODE_LOOP, ANIMMODE_LOOP }; -static f32 D_80BC79D8[] = { 1.0f, 1.0f }; +static AnimationHeader* sAnimations[] = { &object_fu_Anim_000B04, &object_fu_Anim_00057C }; +static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP }; +static f32 sPlaySpeeds[] = { 1.0f, 1.0f }; static TexturePtr sEyeTextures[] = { object_fu_Tex_005F20, object_fu_Tex_006320 }; static TexturePtr sMouthTextures[] = { object_fu_Tex_006720, object_fu_Tex_006920 }; @@ -105,17 +105,17 @@ void EnGuruguru_Destroy(Actor* thisx, PlayState* play) { } } -void EnGuruguru_ChangeAnimation(EnGuruguru* this, s32 arg1) { - this->frameCount = Animation_GetLastFrame(D_80BC79CC[arg1]); - Animation_Change(&this->skelAnime, D_80BC79CC[arg1], D_80BC79D8[arg1], 0.0f, this->frameCount, D_80BC79D4[arg1], - -4.0f); +void EnGuruguru_ChangeAnim(EnGuruguru* this, s32 animIndex) { + this->frameCount = Animation_GetLastFrame(sAnimations[animIndex]); + Animation_Change(&this->skelAnime, sAnimations[animIndex], sPlaySpeeds[animIndex], 0.0f, this->frameCount, + sAnimationModes[animIndex], -4.0f); } void EnGuruguru_DoNothing(EnGuruguru* this, PlayState* play) { } void func_80BC6E10(EnGuruguru* this) { - EnGuruguru_ChangeAnimation(this, 0); + EnGuruguru_ChangeAnim(this, 0); this->textIdIndex = 0; this->unk270 = 0; if (this->actor.params == 0) { diff --git a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c index aba6b4f900..b69429d1af 100644 --- a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c +++ b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c @@ -15,18 +15,18 @@ void EnHeishi_Destroy(Actor* thisx, PlayState* play); void EnHeishi_Update(Actor* thisx, PlayState* play); void EnHeishi_Draw(Actor* thisx, PlayState* play); -void EnHeishi_ChangeAnimation(EnHeishi* this, s32 animIndex); +void EnHeishi_ChangeAnim(EnHeishi* this, s32 animIndex); void EnHeishi_SetHeadRotation(EnHeishi* this); void EnHeishi_SetupIdle(EnHeishi* this); void EnHeishi_Idle(EnHeishi* this, PlayState* play); typedef enum { - /* 0 */ HEISHI_ANIMATION_STAND_HAND_ON_HIP, - /* 1 */ HEISHI_ANIMATION_CHEER_WITH_SPEAR, - /* 2 */ HEISHI_ANIMATION_WAVE, - /* 3 */ HEISHI_ANIMATION_SIT_AND_REACH, - /* 4 */ HEISHI_ANIMATION_STAND_UP -} EnHeishiAnimationIndex; + /* 0 */ HEISHI_ANIM_STAND_HAND_ON_HIP, + /* 1 */ HEISHI_ANIM_CHEER_WITH_SPEAR, + /* 2 */ HEISHI_ANIM_WAVE, + /* 3 */ HEISHI_ANIM_SIT_AND_REACH, + /* 4 */ HEISHI_ANIM_STAND_UP +} EnHeishiAnimation; const ActorInit En_Heishi_InitVars = { ACTOR_EN_HEISHI, @@ -99,11 +99,11 @@ void EnHeishi_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->colliderCylinder); } -void EnHeishi_ChangeAnimation(EnHeishi* this, s32 animIndex) { +void EnHeishi_ChangeAnim(EnHeishi* this, s32 animIndex) { static AnimationHeader* sAnimations[] = { &gSoldierStandHandOnHip, &gSoldierCheerWithSpear, &gSoldierWave, &gSoldierSitAndReach, &gSoldierStandUp, }; - static u8 sAnimModes[] = { + static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, @@ -112,7 +112,7 @@ void EnHeishi_ChangeAnimation(EnHeishi* this, s32 animIndex) { this->animIndex = animIndex; this->frameCount = Animation_GetLastFrame(sAnimations[this->animIndex]); Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->frameCount, - sAnimModes[this->animIndex], -10.0f); + sAnimationModes[this->animIndex], -10.0f); } void EnHeishi_SetHeadRotation(EnHeishi* this) { @@ -131,9 +131,9 @@ void EnHeishi_SetHeadRotation(EnHeishi* this) { } void EnHeishi_SetupIdle(EnHeishi* this) { - s8 animIndex = HEISHI_ANIMATION_STAND_HAND_ON_HIP; + s8 animIndex = HEISHI_ANIM_STAND_HAND_ON_HIP; - EnHeishi_ChangeAnimation(this, animIndex); + EnHeishi_ChangeAnim(this, animIndex); this->unk278 = animIndex; this->actionFunc = EnHeishi_Idle; } diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c index 8c0be4adf2..83e0935f5c 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -101,7 +101,7 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, 0x80, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_harfgibud_Anim_00260C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_harfgibud_Anim_009D44, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_harfgibud_Anim_00A164, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, @@ -148,7 +148,7 @@ void EnHg_Destroy(Actor* thisx, PlayState* play) { } void func_80BCF354(EnHg* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80BCF398; } @@ -166,7 +166,7 @@ void func_80BCF398(EnHg* this, PlayState* play) { } void func_80BCF468(EnHg* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80BCF4AC; } @@ -190,7 +190,7 @@ void func_80BCF4AC(EnHg* this, PlayState* play) { } void func_80BCF5F0(EnHg* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80BCF634; } @@ -203,7 +203,7 @@ void func_80BCF634(EnHg* this, PlayState* play) { } void func_80BCF68C(EnHg* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80BCF6D0; } @@ -277,30 +277,30 @@ void func_80BCF95C(EnHg* this, PlayState* play) { this->cutscenes[3] = play->csCtx.actorActions[actionIndex]->action; switch (play->csCtx.actorActions[actionIndex]->action) { case 1: - this->currentAnimation = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + this->animIndex = 0; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); break; case 2: this->cutscenes[2] = 0; - this->currentAnimation = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + this->animIndex = 3; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); break; case 3: this->cutscenes[2] = 0; - this->currentAnimation = 5; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + this->animIndex = 5; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); break; case 4: this->cutscenes[2] = 0; - this->currentAnimation = 7; + this->animIndex = 7; if ((this->unk218 == 1) || (this->unk218 == 3)) { func_8019F128(NA_SE_EN_HALF_REDEAD_TRANS); } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7); break; case 5: - this->currentAnimation = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + this->animIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; case 6: gSaveContext.save.weekEventReg[75] |= 0x20; @@ -309,19 +309,19 @@ void func_80BCF95C(EnHg* this, PlayState* play) { } } else { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - switch (this->currentAnimation) { + switch (this->animIndex) { case 3: - this->currentAnimation = 4; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + this->animIndex = 4; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); break; case 5: - this->currentAnimation = 6; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); + this->animIndex = 6; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); break; } } } - switch (this->currentAnimation) { + switch (this->animIndex) { case 3: case 4: func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_LOOP - SFX_FLAG); diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.h b/src/overlays/actors/ovl_En_Hg/z_en_hg.h index 2883143791..c81d61d49e 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.h +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.h @@ -16,7 +16,7 @@ typedef struct EnHg { /* 0x1D4 */ EnHgActionFunc actionFunc; /* 0x1D8 */ MtxF unk1D8; /* 0x218 */ s32 unk218; - /* 0x21C */ s32 currentAnimation; + /* 0x21C */ s32 animIndex; /* 0x220 */ Vec3s jointTable[HARFGIBUD_GIBDO_LIMB_MAX]; /* 0x292 */ Vec3s morphTable[HARFGIBUD_GIBDO_LIMB_MAX]; /* 0x304 */ UNK_TYPE1 pad304[0xC]; diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c index c8de1f2105..83fbe5988c 100644 --- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c +++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c @@ -39,7 +39,7 @@ const ActorInit En_Hgo_InitVars = { (ActorFunc)EnHgo_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_harfgibud_Anim_00B644, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_harfgibud_Anim_013684, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, { &object_harfgibud_Anim_0152EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, @@ -127,7 +127,7 @@ void func_80BD0434(EnHgo* this, PlayState* play) { } void func_80BD049C(EnHgo* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80BD04E0; } @@ -258,28 +258,28 @@ s32 func_80BD0898(EnHgo* this, PlayState* play) { switch (play->csCtx.actorActions[actionIndex]->action) { case 1: this->unk_218 = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); break; case 2: this->actor.draw = EnHgo_Draw; this->unk_218 = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; case 3: this->unk_218 = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); break; case 4: this->unk_218 = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); break; case 5: this->unk_218 = 4; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); break; case 6: this->unk_218 = 5; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); break; } } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -295,11 +295,11 @@ s32 func_80BD0898(EnHgo* this, PlayState* play) { break; case 2: this->unk_218 = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); break; case 5: this->unk_218 = 6; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); } } diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c index ee337e9a95..3664fcede9 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c @@ -126,7 +126,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f }, @@ -181,7 +181,7 @@ void func_80C1FE20(EnHintSkb* this, PlayState* play) { } void func_80C1FE30(EnHintSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actor.speedXZ = 1.6f; this->actionFunc = func_80C1FE80; } @@ -200,7 +200,7 @@ void func_80C1FE80(EnHintSkb* this, PlayState* play) { void func_80C1FF30(EnHintSkb* this) { this->collider.base.atFlags &= ~AT_BOUNCED; this->actor.speedXZ = 0.0f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80C1FF88; } @@ -274,12 +274,12 @@ void func_80C2016C(EnHintSkb* this, PlayState* play) { void func_80C20274(EnHintSkb* this) { if (this->skelAnime.animation == &object_skb_Anim_00697C) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); this->actor.gravity = -1.0f; this->actor.speedXZ = 1.0f; } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -4.0f; } @@ -316,7 +316,7 @@ void func_80C20334(EnHintSkb* this, PlayState* play) { } void func_80C20484(EnHintSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->unk_3E8 |= 4; if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -6.0f; @@ -348,7 +348,7 @@ void func_80C20590(EnHintSkb* this, PlayState* play) { this->drawDmgEffAlpha = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3E8 |= 1; func_80C20274(this); @@ -375,7 +375,7 @@ void func_80C2069C(EnHintSkb* this, PlayState* play) { this->drawDmgEffAlpha = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3E8 |= 1; func_80C20274(this); @@ -404,10 +404,10 @@ void func_80C2077C(EnHintSkb* this, PlayState* play) { this->actor.speedXZ = 2.4f; this->actor.gravity = -1.0f; this->actor.velocity.y = 3.0f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); } } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); Message_StartTextbox(play, 0x1148, &this->actor); this->unk_3E6 = 0x1148; } @@ -466,7 +466,7 @@ void func_80C208D0(EnHintSkb* this, PlayState* play) { Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Message_StartTextbox(play, 0x1147, &this->actor); this->unk_3E6 = 0x1147; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); } } @@ -541,7 +541,7 @@ void func_80C20C24(EnHintSkb* this, PlayState* play) { case 0x1147: Message_StartTextbox(play, 0x1148, &this->actor); this->unk_3E6 = 0x1148; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); break; case 0x1148: @@ -590,7 +590,7 @@ void func_80C20D64(EnHintSkb* this, PlayState* play) { this->actor.hintId = 255; this->actor.textId = 0; if (this->actionFunc == func_80C1FE80) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12); } func_80C2075C(this); } @@ -700,7 +700,7 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) { this->drawDmgEffScale = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80C2066C(this); break; @@ -719,7 +719,7 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) { case 13: Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80C20274(this); break; diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index f90ddbf66c..200e3bfcb3 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -25,7 +25,7 @@ void EnHorse_StartMountedIdleResetAnim(EnHorse* this); void EnHorse_StartMountedIdle(EnHorse* this); void EnHorse_MountedIdle(EnHorse* this, PlayState* play); void EnHorse_MountedIdleAnim(EnHorse* this); -void EnHorse_MountedIdleWhinney(EnHorse* this); +void EnHorse_MountedIdleWhinny(EnHorse* this); void EnHorse_StartTurning(EnHorse* this); void EnHorse_StartWalkingFromIdle(EnHorse* this); void EnHorse_StartWalkingInterruptable(EnHorse* this); @@ -108,20 +108,32 @@ typedef struct { RaceWaypoint* waypoints; } RaceInfo; -static AnimationHeader* sEponaAnimHeaders[] = { +typedef enum { + /* 0 */ ENHORSE_ANIM_IDLE, + /* 1 */ ENHORSE_ANIM_WHINNY, + /* 2 */ ENHORSE_ANIM_STOPPING, + /* 3 */ ENHORSE_ANIM_REARING, + /* 4 */ ENHORSE_ANIM_WALK, + /* 5 */ ENHORSE_ANIM_TROT, + /* 6 */ ENHORSE_ANIM_GALLOP, + /* 7 */ ENHORSE_ANIM_LOW_JUMP, + /* 8 */ ENHORSE_ANIM_HIGH_JUMP +} EnHorseAnimation; + +static AnimationHeader* sEponaAnimations[] = { &object_horse_link_child_Anim_006D44, &object_horse_link_child_Anim_007468, &object_horse_link_child_Anim_005F64, &object_horse_link_child_Anim_004DE8, &object_horse_link_child_Anim_007D50, &object_horse_link_child_Anim_0043AC, &object_horse_link_child_Anim_002F98, &object_horse_link_child_Anim_0035B0, &object_horse_link_child_Anim_003D38, }; -static AnimationHeader* sHniAnimHeaders[] = { +static AnimationHeader* sHniAnimations[] = { &object_ha_Anim_00C850, &object_ha_Anim_00CE70, &object_ha_Anim_00B9C8, &object_ha_Anim_00B00C, &object_ha_Anim_00D648, &object_ha_Anim_00A650, &object_ha_Anim_009208, &object_ha_Anim_009858, &object_ha_Anim_00A05C, }; static AnimationHeader** sAnimationHeaders[] = { - NULL, NULL, sEponaAnimHeaders, sHniAnimHeaders, sHniAnimHeaders, + NULL, NULL, sEponaAnimations, sHniAnimations, sHniAnimations, }; static f32 sPlaybackSpeeds[] = { @@ -228,11 +240,15 @@ static u8 sResetNoInput[] = { true, true, true, false, false, false, false, false, false, false, false, false, }; -static s32 sIdleAnimIds[] = { - 1, 3, 0, 3, 1, 0, +static s32 sIdleAnimIndices[] = { + ENHORSE_ANIM_WHINNY, ENHORSE_ANIM_REARING, ENHORSE_ANIM_IDLE, + ENHORSE_ANIM_REARING, ENHORSE_ANIM_WHINNY, ENHORSE_ANIM_IDLE, }; -static s16 sIngoAnimations[] = { 7, 6, 2, 2, 1, 1, 0, 0, 0, 0 }; +static s16 sIngoAnimIndices[] = { + ENIN_ANIM_7, ENIN_ANIM_6, ENIN_ANIM_2, ENIN_ANIM_2, ENIN_ANIM_1, + ENIN_ANIM_1, ENIN_ANIM_0, ENIN_ANIM_0, ENIN_ANIM_0, ENIN_ANIM_0, +}; static EnHorseCsFunc sCutsceneInitFuncs[] = { NULL, @@ -549,7 +565,7 @@ s32 func_8087C38C(PlayState* play, EnHorse* this, Vec3f* arg2) { } void EnHorse_IdleAnimSounds(EnHorse* this, PlayState* play) { - if ((this->animationIdx == ENHORSE_ANIM_IDLE) && + if ((this->animIndex == ENHORSE_ANIM_IDLE) && (((this->curFrame > 35.0f) && (this->type == HORSE_TYPE_EPONA)) || ((this->curFrame > 28.0f) && (this->type == HORSE_TYPE_HNI)) || ((this->curFrame > 25.0f) && (this->type == HORSE_TYPE_2))) && @@ -560,7 +576,7 @@ void EnHorse_IdleAnimSounds(EnHorse* this, PlayState* play) { } else { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_SANDDUST); } - } else if ((this->animationIdx == 3) && (this->curFrame > 25.0f) && !(this->stateFlags & ENHORSE_LAND2_SOUND)) { + } else if ((this->animIndex == 3) && (this->curFrame > 25.0f) && !(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_LAND2); @@ -716,7 +732,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { thisx->objBankIndex = Object_Spawn(&play->objectCtx, OBJECT_HORSE_LINK_CHILD); Actor_SetObjectDependency(play, &this->actor); Skin_Init(&play->state, &this->skin, sSkeletonHeaders[this->type], sAnimationHeaders[this->type][0]); - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); this->unk_1EC |= 0x200; } else { thisx->update = func_8087D540; @@ -823,7 +839,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { Skin_Init(&play->state, &this->skin, sSkeletonHeaders[this->type], sAnimationHeaders[this->type][0]); } - this->animationIdx = 0; + this->animIndex = 0; this->numBoosts = 6; this->boostRegenTime = 0; this->postDrawFunc = NULL; @@ -926,7 +942,7 @@ void func_8087D540(Actor* thisx, PlayState* play) { } else { Skin_Init(&play->state, &this->skin, sSkeletonHeaders[this->type], sAnimationHeaders[this->type][0]); } - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); } } @@ -966,7 +982,7 @@ void EnHorse_Freeze(EnHorse* this, PlayState* play) { this->colliderCylinder1.base.ocFlags1 &= ~OC1_ON; this->colliderCylinder2.base.ocFlags1 &= ~OC1_ON; this->colliderJntSph.base.ocFlags1 &= ~OC1_ON; - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; } } @@ -1100,7 +1116,7 @@ void EnHorse_StartMountedIdle(EnHorse* this) { f32 curFrame; this->action = ENHORSE_ACT_MOUNTED_TURN; - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; if (((this->curFrame > 35.0f) && (this->type == HORSE_TYPE_EPONA)) || ((this->curFrame > 28.0f) && (this->type == HORSE_TYPE_HNI))) { @@ -1114,8 +1130,8 @@ void EnHorse_StartMountedIdle(EnHorse* this) { } } curFrame = this->skin.skelAnime.curFrame; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, curFrame, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, curFrame, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } void EnHorse_MountedIdle(EnHorse* this, PlayState* play) { @@ -1145,16 +1161,16 @@ void EnHorse_MountedIdle(EnHorse* this, PlayState* play) { void EnHorse_MountedIdleAnim(EnHorse* this) { this->skin.skelAnime.curFrame = 0.0f; - EnHorse_MountedIdleWhinney(this); + EnHorse_MountedIdleWhinny(this); } -void EnHorse_MountedIdleWhinney(EnHorse* this) { +void EnHorse_MountedIdleWhinny(EnHorse* this) { f32 curFrame; this->action = ENHORSE_ACT_MOUNTED_WALK; - this->animationIdx = ENHORSE_ANIM_WHINNEY; + this->animIndex = ENHORSE_ANIM_WHINNY; curFrame = this->skin.skelAnime.curFrame; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, curFrame, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, curFrame, Animation_GetLastFrame(sAnimationHeaders[this->type][1]), ANIMMODE_ONCE, -3.0f); if (this->stateFlags & ENHORSE_DRAW) { if (this->type == HORSE_TYPE_2) { @@ -1165,7 +1181,7 @@ void EnHorse_MountedIdleWhinney(EnHorse* this) { } } -void EnHorse_MountedIdleWhinneying(EnHorse* this, PlayState* play) { +void EnHorse_MountedIdleWhinnying(EnHorse* this, PlayState* play) { f32 stickMag; s16 stickAngle = 0; @@ -1193,8 +1209,8 @@ void EnHorse_MountedIdleWhinneying(EnHorse* this, PlayState* play) { void EnHorse_StartTurning(EnHorse* this) { this->action = ENHORSE_ACT_MOUNTED_TROT; this->soundTimer = 0; - this->animationIdx = ENHORSE_ANIM_WALK; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, + this->animIndex = ENHORSE_ANIM_WALK; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][4]), ANIMMODE_ONCE, -3.0f); } @@ -1256,18 +1272,18 @@ void EnHorse_StartWalkingInterruptable(EnHorse* this) { void EnHorse_StartWalking(EnHorse* this) { this->action = ENHORSE_ACT_MOUNTED_GALLOP; this->soundTimer = 0; - this->animationIdx = ENHORSE_ANIM_WALK; + this->animIndex = ENHORSE_ANIM_WALK; this->waitTimer = 0; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][4]), ANIMMODE_ONCE, -3.0f); } void EnHorse_MountedWalkingReset(EnHorse* this) { this->action = ENHORSE_ACT_MOUNTED_GALLOP; this->soundTimer = 0; - this->animationIdx = ENHORSE_ANIM_WALK; + this->animIndex = ENHORSE_ANIM_WALK; this->waitTimer = 0; - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); } void EnHorse_MountedWalk(EnHorse* this, PlayState* play) { @@ -1327,15 +1343,15 @@ void EnHorse_MountedWalk(EnHorse* this, PlayState* play) { void EnHorse_StartTrotting(EnHorse* this) { this->action = ENHORSE_ACT_MOUNTED_REARING; - this->animationIdx = ENHORSE_ANIM_TROT; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + this->animIndex = ENHORSE_ANIM_TROT; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } void EnHorse_MountedTrotReset(EnHorse* this) { this->action = ENHORSE_ACT_MOUNTED_REARING; - this->animationIdx = ENHORSE_ANIM_TROT; - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + this->animIndex = ENHORSE_ANIM_TROT; + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); } void EnHorse_MountedTrot(EnHorse* this, PlayState* play) { @@ -1371,19 +1387,19 @@ void EnHorse_StartGallopingInterruptable(EnHorse* this) { void EnHorse_StartGalloping(EnHorse* this) { this->action = ENHORSE_ACT_STOPPING; - this->animationIdx = ENHORSE_ANIM_GALLOP; + this->animIndex = ENHORSE_ANIM_GALLOP; this->unk_230 = 0; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } void EnHorse_MountedGallopReset(EnHorse* this) { this->noInputTimer = 0; this->noInputTimerMax = 0; this->action = ENHORSE_ACT_STOPPING; - this->animationIdx = ENHORSE_ANIM_GALLOP; + this->animIndex = ENHORSE_ANIM_GALLOP; this->unk_230 = 0; - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); } void EnHorse_JumpLanding(EnHorse* this, PlayState* play) { @@ -1391,8 +1407,8 @@ void EnHorse_JumpLanding(EnHorse* this, PlayState* play) { f32 y; this->action = ENHORSE_ACT_STOPPING; - this->animationIdx = ENHORSE_ANIM_GALLOP; - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + this->animIndex = ENHORSE_ANIM_GALLOP; + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); jointTable = this->skin.skelAnime.jointTable; y = jointTable->y; this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f; @@ -1437,9 +1453,9 @@ void EnHorse_MountedGallop(EnHorse* this, PlayState* play) { void EnHorse_StartRearing(EnHorse* this) { this->action = ENHORSE_ACT_REVERSE; - this->animationIdx = ENHORSE_ANIM_REARING; + this->animIndex = ENHORSE_ANIM_REARING; - if (sAnimationHeaders[this->type][this->animationIdx] == NULL) { + if (sAnimationHeaders[this->type][this->animIndex] == NULL) { if (Rand_ZeroOne() > 0.5f) { if (this->stateFlags & ENHORSE_DRAW) { if (this->type == HORSE_TYPE_2) { @@ -1464,8 +1480,8 @@ void EnHorse_StartRearing(EnHorse* this) { } Rumble_Request(0.0f, 180, 20, 100); - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } void EnHorse_MountedRearing(EnHorse* this, PlayState* play) { @@ -1512,8 +1528,8 @@ void EnHorse_MountedRearing(EnHorse* this, PlayState* play) { void EnHorse_StartBraking(EnHorse* this, PlayState* play) { this->action = ENHORSE_ACT_LOW_JUMP; - this->animationIdx = ENHORSE_ANIM_STOPPING; - if (sAnimationHeaders[this->type][this->animationIdx] == NULL) { + this->animIndex = ENHORSE_ANIM_STOPPING; + if (sAnimationHeaders[this->type][this->animIndex] == NULL) { if (Rand_ZeroOne() > 0.5f) { if (this->stateFlags & ENHORSE_DRAW) { if (this->type == HORSE_TYPE_2) { @@ -1534,8 +1550,8 @@ void EnHorse_StartBraking(EnHorse* this, PlayState* play) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_HORSE_SLIP); } - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.5f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.5f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); this->stateFlags |= ENHORSE_STOPPING_NEIGH_SOUND; this->stateFlags &= ~ENHORSE_BOOST; } @@ -1592,10 +1608,10 @@ void EnHorse_StartReversingInterruptable(EnHorse* this) { void EnHorse_StartReversing(EnHorse* this) { this->action = ENHORSE_ACT_HIGH_JUMP; - this->animationIdx = ENHORSE_ANIM_WALK; + this->animIndex = ENHORSE_ANIM_WALK; this->soundTimer = 0; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_LOOP, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_LOOP, -3.0f); } void EnHorse_Reverse(EnHorse* this, PlayState* play) { @@ -1673,10 +1689,10 @@ void EnHorse_StartLowJump(EnHorse* this, PlayState* play) { f32 y; this->action = ENHORSE_ACT_BRIDGE_JUMP; - this->animationIdx = ENHORSE_ANIM_LOW_JUMP; + this->animIndex = ENHORSE_ANIM_LOW_JUMP; curFrame = this->skin.skelAnime.curFrame; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.5f, curFrame, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.5f, curFrame, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); this->postDrawFunc = NULL; this->jumpStartY = this->actor.world.pos.y; this->actor.gravity = 0.0f; @@ -1769,10 +1785,10 @@ void EnHorse_StartHighJump(EnHorse* this, PlayState* play) { f32 y; this->action = ENHORSE_ACT_CS_UPDATE; - this->animationIdx = ENHORSE_ANIM_HIGH_JUMP; + this->animIndex = ENHORSE_ANIM_HIGH_JUMP; curFrame = this->skin.skelAnime.curFrame; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.5f, curFrame, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.5f, curFrame, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); this->postDrawFunc = NULL; this->jumpStartY = this->actor.world.pos.y; @@ -1861,7 +1877,7 @@ void EnHorse_InitInactive(EnHorse* this) { this->colliderCylinder2.base.ocFlags1 &= ~OC1_ON; this->colliderJntSph.base.ocFlags1 &= ~OC1_ON; this->action = ENHORSE_ACT_INACTIVE; - this->animationIdx = ENHORSE_ANIM_WALK; + this->animIndex = ENHORSE_ANIM_WALK; this->stateFlags |= ENHORSE_INACTIVE; this->followTimer = 0; } @@ -1891,7 +1907,7 @@ void EnHorse_PlayIdleAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 sta this->action = ENHORSE_ACT_IDLE; this->actor.speedXZ = 0.0f; - if ((anim != ENHORSE_ANIM_IDLE) && (anim != ENHORSE_ANIM_WHINNEY) && (anim != ENHORSE_ANIM_REARING)) { + if ((anim != ENHORSE_ANIM_IDLE) && (anim != ENHORSE_ANIM_WHINNY) && (anim != ENHORSE_ANIM_REARING)) { anim = ENHORSE_ANIM_IDLE; } @@ -1899,12 +1915,12 @@ void EnHorse_PlayIdleAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 sta anim = ENHORSE_ANIM_IDLE; } - if (anim != this->animationIdx) { - this->animationIdx = anim; + if (anim != this->animIndex) { + this->animIndex = anim; if (anim == ENHORSE_ANIM_IDLE) { this->stateFlags &= ~ENHORSE_SANDDUST_SOUND; } else { - if (this->animationIdx == ENHORSE_ANIM_WHINNEY) { + if (this->animIndex == ENHORSE_ANIM_WHINNY) { if (this->stateFlags & ENHORSE_DRAW) { if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_KID_HORSE_GROAN); @@ -1912,7 +1928,7 @@ void EnHorse_PlayIdleAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 sta Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_HORSE_GROAN); } } - } else if (this->animationIdx == ENHORSE_ANIM_REARING) { + } else if (this->animIndex == ENHORSE_ANIM_REARING) { if (this->stateFlags & ENHORSE_DRAW) { if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_KID_HORSE_NEIGH); @@ -1923,8 +1939,8 @@ void EnHorse_PlayIdleAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 sta this->stateFlags &= ~ENHORSE_LAND2_SOUND; } } - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, startFrames, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, startFrames, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, morphFrames); } } @@ -1934,8 +1950,8 @@ void EnHorse_ChangeIdleAnimation(EnHorse* this, s32 anim, f32 morphFrames) { } void EnHorse_ResetIdleAnimation(EnHorse* this) { - this->animationIdx = ENHORSE_ANIM_WALK; - EnHorse_PlayIdleAnimation(this, this->animationIdx, 0.0f, 0.0f); + this->animIndex = ENHORSE_ANIM_WALK; + EnHorse_PlayIdleAnimation(this, this->animIndex, 0.0f, 0.0f); } void EnHorse_StartIdleRidable(EnHorse* this) { @@ -1971,17 +1987,18 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) { } if (SkelAnime_Update(&this->skin.skelAnime)) { - s32 idleAnimIdx = 0; + s32 idleAnimIndex = 0; - if (this->animationIdx != 0) { - if (this->animationIdx == 1) { - idleAnimIdx = 1; - } else if (this->animationIdx == 3) { - idleAnimIdx = 2; + if (this->animIndex != ENHORSE_ANIM_IDLE) { + if (this->animIndex == ENHORSE_ANIM_WHINNY) { + idleAnimIndex = 1; + } else if (this->animIndex == ENHORSE_ANIM_REARING) { + idleAnimIndex = 2; } } // Play one of the two other idle animations - EnHorse_PlayIdleAnimation(this, sIdleAnimIds[((Rand_ZeroOne() > 0.5f) ? 0 : 1) + idleAnimIdx * 2], 0.0f, 0.0f); + EnHorse_PlayIdleAnimation(this, sIdleAnimIndices[((Rand_ZeroOne() > 0.5f) ? 0 : 1) + idleAnimIndex * 2], 0.0f, + 0.0f); } } @@ -1993,15 +2010,14 @@ void EnHorse_StartMovingAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 anim = ENHORSE_ANIM_WALK; } - if (anim != this->animationIdx) { - this->animationIdx = anim; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, startFrames, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, + if (anim != this->animIndex) { + this->animIndex = anim; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, startFrames, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, morphFrames); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, startFrames, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, startFrames, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } } @@ -2015,13 +2031,13 @@ void EnHorse_SetFollowAnimation(EnHorse* this, PlayState* play) { anim = ENHORSE_ANIM_TROT; } - if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + if (this->animIndex == ENHORSE_ANIM_GALLOP) { if (distToPlayer > 400.0f) { anim = ENHORSE_ANIM_GALLOP; } else { anim = ENHORSE_ANIM_TROT; } - } else if (this->animationIdx == ENHORSE_ANIM_TROT) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { if (distToPlayer > 400.0f) { anim = ENHORSE_ANIM_GALLOP; } else if (distToPlayer < 300.0f) { @@ -2029,7 +2045,7 @@ void EnHorse_SetFollowAnimation(EnHorse* this, PlayState* play) { } else { anim = ENHORSE_ANIM_TROT; } - } else if (this->animationIdx == ENHORSE_ANIM_WALK) { + } else if (this->animIndex == ENHORSE_ANIM_WALK) { if (distToPlayer > 300.0f) { anim = ENHORSE_ANIM_TROT; } else { @@ -2050,7 +2066,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { !(this->stateFlags & ENHORSE_TURNING_TO_PLAYER)) { f32 angleDiff; - this->animationIdx = ENHORSE_ANIM_REARING; + this->animIndex = ENHORSE_ANIM_REARING; this->stateFlags |= ENHORSE_TURNING_TO_PLAYER; this->angleToPlayer = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor); @@ -2062,9 +2078,9 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { } this->followPlayerTurnSpeed = - angleDiff / Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]); + angleDiff / Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]); - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); this->skin.skelAnime.playSpeed = 1.0f; this->stateFlags &= ~ENHORSE_LAND2_SOUND; } else if (this->stateFlags & ENHORSE_TURNING_TO_PLAYER) { @@ -2082,14 +2098,14 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { EnHorse_RotateToPlayer(this, play); } - if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + if (this->animIndex == ENHORSE_ANIM_GALLOP) { this->actor.speedXZ = 8.0f; this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f; } else { - if (this->animationIdx == ENHORSE_ANIM_TROT) { + if (this->animIndex == ENHORSE_ANIM_TROT) { this->actor.speedXZ = 6.0f; this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.375f; - } else if (this->animationIdx == ENHORSE_ANIM_WALK) { + } else if (this->animIndex == ENHORSE_ANIM_WALK) { this->actor.speedXZ = 3.0f; EnHorse_PlayWalkingSound(this); this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.75f; @@ -2114,9 +2130,9 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { } if (SkelAnime_Update(&this->skin.skelAnime)) { - if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + if (this->animIndex == ENHORSE_ANIM_GALLOP) { func_8087C1C0(this); - } else if (this->animationIdx == ENHORSE_ANIM_TROT) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { func_8087C178(this); } @@ -2140,13 +2156,13 @@ void EnHorse_InitIngoHorse(EnHorse* this) { } } -void EnHorse_SetIngoAnimation(s32 anim, f32 curFrame, s32 arg2, s16* animIdxOut) { - *animIdxOut = sIngoAnimations[anim]; - if (arg2 == 1) { - if (anim == 5) { - *animIdxOut = 4; - } else if (anim == 6) { - *animIdxOut = 3; +void EnHorse_SetIngoAnimation(s32 animIndex, f32 curFrame, s32 arg2, s16* animIndexOut) { + *animIndexOut = sIngoAnimIndices[animIndex]; + if (arg2 == ENIN_ANIM_1) { + if (animIndex == ENHORSE_ANIM_TROT) { + *animIndexOut = ENIN_ANIM_4; + } else if (animIndex == ENHORSE_ANIM_GALLOP) { + *animIndexOut = ENIN_ANIM_3; } } } @@ -2159,37 +2175,37 @@ void EnHorse_UpdateIngoHorseAnim(EnHorse* this) { this->stateFlags &= ~ENHORSE_SANDDUST_SOUND; if (this->actor.speedXZ == 0.0f) { - if (this->animationIdx != ENHORSE_ANIM_IDLE) { + if (this->animIndex != ENHORSE_ANIM_IDLE) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; } else if (this->actor.speedXZ <= 3.0f) { - if (this->animationIdx != ENHORSE_ANIM_WALK) { + if (this->animIndex != ENHORSE_ANIM_WALK) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_WALK; + this->animIndex = ENHORSE_ANIM_WALK; } else if (this->actor.speedXZ <= 6.0f) { - if (this->animationIdx != ENHORSE_ANIM_TROT) { + if (this->animIndex != ENHORSE_ANIM_TROT) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_TROT; + this->animIndex = ENHORSE_ANIM_TROT; } else { - if (this->animationIdx != ENHORSE_ANIM_GALLOP) { + if (this->animIndex != ENHORSE_ANIM_GALLOP) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_GALLOP; + this->animIndex = ENHORSE_ANIM_GALLOP; } - if (this->animationIdx == ENHORSE_ANIM_WALK) { + if (this->animIndex == ENHORSE_ANIM_WALK) { animSpeed = this->actor.speedXZ * 0.5f; - } else if (this->animationIdx == ENHORSE_ANIM_TROT) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { animSpeed = this->actor.speedXZ * 0.25f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } - } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { animSpeed = this->actor.speedXZ * 0.2f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); @@ -2201,40 +2217,38 @@ void EnHorse_UpdateIngoHorseAnim(EnHorse* this) { } if (animChanged == true) { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], - sPlaybackSpeeds[this->animationIdx] * animSpeed * 1.5f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], + sPlaybackSpeeds[this->animIndex] * animSpeed * 1.5f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], - sPlaybackSpeeds[this->animationIdx] * animSpeed * 1.5f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], + sPlaybackSpeeds[this->animIndex] * animSpeed * 1.5f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } } void EnHorse_UpdateIngoRace(EnHorse* this, PlayState* play) { f32 playSpeed; - if ((this->animationIdx == ENHORSE_ANIM_IDLE) || (this->animationIdx == ENHORSE_ANIM_WHINNEY)) { + if ((this->animIndex == ENHORSE_ANIM_IDLE) || (this->animIndex == ENHORSE_ANIM_WHINNY)) { EnHorse_IdleAnimSounds(this, play); - } else if (this->animationIdx == ENHORSE_ANIM_WALK) { + } else if (this->animIndex == ENHORSE_ANIM_WALK) { EnHorse_PlayWalkingSound(this); } if (!this->inRace) { this->actor.speedXZ = 0.0f; this->rider->actor.speedXZ = 0.0f; - if (this->animationIdx != ENHORSE_ANIM_IDLE) { + if (this->animIndex != ENHORSE_ANIM_IDLE) { EnHorse_UpdateIngoHorseAnim(this); } } - if (this->animationIdx == ENHORSE_ANIM_WALK) { + if (this->animIndex == ENHORSE_ANIM_WALK) { playSpeed = this->actor.speedXZ * 0.5f; - } else if (this->animationIdx == 5) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { playSpeed = this->actor.speedXZ * 0.25f; - } else if (this->animationIdx == 6) { + } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { playSpeed = this->actor.speedXZ * 0.2f; } else { playSpeed = 1.0f; @@ -2242,7 +2256,7 @@ void EnHorse_UpdateIngoRace(EnHorse* this, PlayState* play) { this->skin.skelAnime.playSpeed = playSpeed; if (SkelAnime_Update(&this->skin.skelAnime) || - ((this->animationIdx == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { + ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { EnHorse_UpdateIngoHorseAnim(this); } } @@ -2255,11 +2269,11 @@ void func_8088126C(EnHorse* this, PlayState* play) { void func_80881290(EnHorse* this, PlayState* play) { f32 curFrame; - this->action = ENHORSE_ACT_MOUNTED_IDLE_WHINNEYING; - this->animationIdx = ENHORSE_ANIM_HIGH_JUMP; + this->action = ENHORSE_ACT_MOUNTED_IDLE_WHINNYING; + this->animIndex = ENHORSE_ANIM_HIGH_JUMP; curFrame = this->skin.skelAnime.curFrame; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.5f, curFrame, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.5f, curFrame, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); this->postDrawFunc = NULL; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; @@ -2324,8 +2338,8 @@ void func_8088159C(EnHorse* this, PlayState* play) { f32 y; this->action = ENHORSE_ACT_MOUNTED_IDLE; - this->animationIdx = ENHORSE_ANIM_GALLOP; - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + this->animIndex = ENHORSE_ANIM_GALLOP; + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); jointTable = this->skin.skelAnime.jointTable; y = jointTable->y; this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f; @@ -2351,37 +2365,37 @@ void func_8088168C(EnHorse* this) { this->stateFlags &= ~ENHORSE_SANDDUST_SOUND; if (this->actor.speedXZ == 0.0f) { - if (this->animationIdx != ENHORSE_ANIM_IDLE) { + if (this->animIndex != ENHORSE_ANIM_IDLE) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; } else if (this->actor.speedXZ <= 3.0f) { - if (this->animationIdx != ENHORSE_ANIM_WALK) { + if (this->animIndex != ENHORSE_ANIM_WALK) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_WALK; + this->animIndex = ENHORSE_ANIM_WALK; } else if (this->actor.speedXZ <= 6.0f) { - if (this->animationIdx != ENHORSE_ANIM_TROT) { + if (this->animIndex != ENHORSE_ANIM_TROT) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_TROT; + this->animIndex = ENHORSE_ANIM_TROT; } else { - if (this->animationIdx != ENHORSE_ANIM_GALLOP) { + if (this->animIndex != ENHORSE_ANIM_GALLOP) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_GALLOP; + this->animIndex = ENHORSE_ANIM_GALLOP; } - if (this->animationIdx == ENHORSE_ANIM_WALK) { + if (this->animIndex == ENHORSE_ANIM_WALK) { animSpeed = this->actor.speedXZ * 0.5f; - } else if (this->animationIdx == ENHORSE_ANIM_TROT) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { animSpeed = this->actor.speedXZ * 0.25f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } - } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { animSpeed = this->actor.speedXZ * 0.2f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); @@ -2392,19 +2406,17 @@ void func_8088168C(EnHorse* this) { animSpeed = 1.0f; } - finalAnimSpeed = sPlaybackSpeeds[this->animationIdx] * animSpeed * 1.5f; + finalAnimSpeed = sPlaybackSpeeds[this->animIndex] * animSpeed * 1.5f; if (finalAnimSpeed < 1.0f) { finalAnimSpeed = 1.0f; } if (animChanged == true) { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], finalAnimSpeed, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], finalAnimSpeed, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], finalAnimSpeed, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], finalAnimSpeed, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } } @@ -2412,16 +2424,16 @@ void func_808819D8(EnHorse* this, PlayState* play) { Path* path; f32 animSpeed; - if ((this->animationIdx == ENHORSE_ANIM_IDLE) || (this->animationIdx == ENHORSE_ANIM_WHINNEY)) { + if ((this->animIndex == ENHORSE_ANIM_IDLE) || (this->animIndex == ENHORSE_ANIM_WHINNY)) { EnHorse_IdleAnimSounds(this, play); - } else if (this->animationIdx == ENHORSE_ANIM_WALK) { + } else if (this->animIndex == ENHORSE_ANIM_WALK) { EnHorse_PlayWalkingSound(this); } if (!this->inRace) { this->actor.speedXZ = 0.0f; this->rider->actor.speedXZ = 0.0f; - if (this->animationIdx != ENHORSE_ANIM_IDLE) { + if (this->animIndex != ENHORSE_ANIM_IDLE) { EnHorse_UpdateIngoHorseAnim(this); } } @@ -2436,16 +2448,16 @@ void func_808819D8(EnHorse* this, PlayState* play) { if (!this->inRace) { this->actor.speedXZ = 0.0f; - if (this->animationIdx != ENHORSE_ANIM_IDLE) { + if (this->animIndex != ENHORSE_ANIM_IDLE) { func_8088168C(this); } } - if (this->animationIdx == ENHORSE_ANIM_WALK) { + if (this->animIndex == ENHORSE_ANIM_WALK) { animSpeed = this->actor.speedXZ * 0.5f; - } else if (this->animationIdx == ENHORSE_ANIM_TROT) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { animSpeed = this->actor.speedXZ * 0.25f; - } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { animSpeed = this->actor.speedXZ * 0.2f; } else { animSpeed = 1.0f; @@ -2453,22 +2465,22 @@ void func_808819D8(EnHorse* this, PlayState* play) { this->skin.skelAnime.playSpeed = animSpeed; if (SkelAnime_Update(&this->skin.skelAnime) || - ((this->animationIdx == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { + ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { func_8088168C(this); } if (GET_RACE_FLAGS == 3) { this->rider->unk488 = 7; } else { - EnHorse_SetIngoAnimation(this->animationIdx, this->skin.skelAnime.curFrame, this->unk_394 & 1, + EnHorse_SetIngoAnimation(this->animIndex, this->skin.skelAnime.curFrame, this->unk_394 & 1, &this->rider->unk488); } } void EnHorse_CsMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - this->animationIdx = ENHORSE_ANIM_GALLOP; + this->animIndex = ENHORSE_ANIM_GALLOP; this->cutsceneAction = 1; - Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], + Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], this->actor.speedXZ * 0.2f * 1.5f); } @@ -2492,7 +2504,7 @@ void EnHorse_CsMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* act if (SkelAnime_Update(&this->skin.skelAnime)) { func_8087C1C0(this); Rumble_Request(0.0f, 120, 8, 255); - Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], + Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], this->actor.speedXZ * 0.3f); } } @@ -2507,10 +2519,10 @@ void EnHorse_CsPlayHighJumpAnim(EnHorse* this, PlayState* play) { f32 y; Vec3s* jointTable; - this->animationIdx = ENHORSE_ANIM_HIGH_JUMP; + this->animIndex = ENHORSE_ANIM_HIGH_JUMP; curFrame = this->skin.skelAnime.curFrame; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.5f, curFrame, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.5f, curFrame, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); this->postDrawFunc = NULL; this->jumpStartY = this->actor.world.pos.y; this->actor.gravity = 0.0f; @@ -2582,8 +2594,8 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorAction* action) { this->actor.velocity.y = 0.0f; this->actor.world.pos.y = this->actor.floorHeight; func_800B1598(play, 25.0f, &this->actor.world.pos); - this->animationIdx = ENHORSE_ANIM_GALLOP; - Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], + this->animIndex = ENHORSE_ANIM_GALLOP; + Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], sPlaybackSpeeds[6]); jointTable = this->skin.skelAnime.jointTable; @@ -2595,7 +2607,7 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - this->animationIdx = ENHORSE_ANIM_REARING; + this->animIndex = ENHORSE_ANIM_REARING; this->cutsceneAction = 3; this->cutsceneFlags &= ~4; this->stateFlags &= ~ENHORSE_LAND2_SOUND; @@ -2606,8 +2618,8 @@ void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* act Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_HORSE_NEIGH); } } - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action) { @@ -2624,15 +2636,15 @@ void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action) } if (SkelAnime_Update(&this->skin.skelAnime)) { - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; if (!(this->cutsceneFlags & 4)) { this->cutsceneFlags |= 4; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_LOOP, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_LOOP, 0.0f); } } @@ -2647,9 +2659,9 @@ void EnHorse_WarpMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* acti this->actor.world.rot.y = action->urot.y; this->actor.shape.rot = this->actor.world.rot; - this->animationIdx = ENHORSE_ANIM_GALLOP; + this->animIndex = ENHORSE_ANIM_GALLOP; this->cutsceneAction = 4; - Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], + Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], this->actor.speedXZ * 0.3f); } @@ -2673,7 +2685,7 @@ void EnHorse_CsWarpMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* if (SkelAnime_Update(&this->skin.skelAnime)) { func_8087C1C0(this); Rumble_Request(0.0f, 120, 8, 255); - Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], + Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], this->actor.speedXZ * 0.3f); } } @@ -2687,7 +2699,7 @@ void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* this->actor.world.rot.y = action->urot.y; this->actor.shape.rot = this->actor.world.rot; - this->animationIdx = ENHORSE_ANIM_REARING; + this->animIndex = ENHORSE_ANIM_REARING; this->cutsceneAction = 5; this->cutsceneFlags &= ~4; this->stateFlags &= ~ENHORSE_LAND2_SOUND; @@ -2699,8 +2711,8 @@ void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_HORSE_NEIGH); } } - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action) { @@ -2717,15 +2729,15 @@ void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorAction* act } if (SkelAnime_Update(&this->skin.skelAnime)) { - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; if (!(this->cutsceneFlags & 4)) { this->cutsceneFlags |= 4; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_LOOP, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_LOOP, 0.0f); } } @@ -2840,30 +2852,30 @@ void EnHorse_UpdateHbaAnim(EnHorse* this) { this->action = ENHORSE_ACT_FLEE_PLAYER; if (this->actor.speedXZ == 0.0f) { - if (this->animationIdx != ENHORSE_ANIM_IDLE) { + if (this->animIndex != ENHORSE_ANIM_IDLE) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; } else if (this->actor.speedXZ <= 3.0f) { - if (this->animationIdx != ENHORSE_ANIM_WALK) { + if (this->animIndex != ENHORSE_ANIM_WALK) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_WALK; + this->animIndex = ENHORSE_ANIM_WALK; } else if (this->actor.speedXZ <= 6.0f) { - if (this->animationIdx != ENHORSE_ANIM_TROT) { + if (this->animIndex != ENHORSE_ANIM_TROT) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_TROT; + this->animIndex = ENHORSE_ANIM_TROT; } else { - if (this->animationIdx != ENHORSE_ANIM_GALLOP) { + if (this->animIndex != ENHORSE_ANIM_GALLOP) { animChanged = true; } - this->animationIdx = ENHORSE_ANIM_GALLOP; + this->animIndex = ENHORSE_ANIM_GALLOP; } - if (this->animationIdx == ENHORSE_ANIM_WALK) { + if (this->animIndex == ENHORSE_ANIM_WALK) { animSpeed = this->actor.speedXZ * 0.5f; - } else if (this->animationIdx == ENHORSE_ANIM_TROT) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { animSpeed = this->actor.speedXZ * 0.25f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); @@ -2871,7 +2883,7 @@ void EnHorse_UpdateHbaAnim(EnHorse* this) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } Rumble_Request(0.0f, 60, 8, 255); - } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { animSpeed = this->actor.speedXZ * 0.2f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); @@ -2884,15 +2896,13 @@ void EnHorse_UpdateHbaAnim(EnHorse* this) { } if (animChanged == true) { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], - sPlaybackSpeeds[this->animationIdx] * animSpeed * 1.5f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], + sPlaybackSpeeds[this->animIndex] * animSpeed * 1.5f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], - sPlaybackSpeeds[this->animationIdx] * animSpeed * 1.5f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], + sPlaybackSpeeds[this->animIndex] * animSpeed * 1.5f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } } @@ -2900,7 +2910,7 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) { f32 playSpeed; s32 sp28; - if (this->animationIdx == ENHORSE_ANIM_WALK) { + if (this->animIndex == ENHORSE_ANIM_WALK) { EnHorse_PlayWalkingSound(this); } @@ -2926,16 +2936,16 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) { if (this->hbaStarted == 0) { this->actor.speedXZ = 0.0f; - if (this->animationIdx != ENHORSE_ANIM_IDLE) { + if (this->animIndex != ENHORSE_ANIM_IDLE) { EnHorse_UpdateHbaAnim(this); } } - if (this->animationIdx == ENHORSE_ANIM_WALK) { + if (this->animIndex == ENHORSE_ANIM_WALK) { playSpeed = this->actor.speedXZ * 0.5f; - } else if (this->animationIdx == ENHORSE_ANIM_TROT) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { playSpeed = this->actor.speedXZ * 0.25f; - } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { playSpeed = this->actor.speedXZ * 0.2f; } else { playSpeed = 1.0f; @@ -2943,7 +2953,7 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) { this->skin.skelAnime.playSpeed = playSpeed; if (SkelAnime_Update(&this->skin.skelAnime) || - ((this->animationIdx == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { + ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { EnHorse_UpdateHbaAnim(this); } } @@ -2953,7 +2963,7 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { f32 distToHome; f32 playerDistToHome; f32 distToPlayer; - s32 nextAnim = this->animationIdx; + s32 nextAnimIndex = this->animIndex; s32 animFinished; s16 yaw; @@ -2996,25 +3006,26 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { if (this->actor.speedXZ >= 6.0f) { this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f; - nextAnim = ENHORSE_ANIM_GALLOP; + nextAnimIndex = ENHORSE_ANIM_GALLOP; } else if (this->actor.speedXZ >= 3.0f) { this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.375f; - nextAnim = ENHORSE_ANIM_TROT; + nextAnimIndex = ENHORSE_ANIM_TROT; } else if (this->actor.speedXZ > 0.1f) { this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.75f; - nextAnim = ENHORSE_ANIM_WALK; + nextAnimIndex = ENHORSE_ANIM_WALK; EnHorse_PlayWalkingSound(this); } else { if (Rand_ZeroOne() > 0.5f) { - nextAnim = ENHORSE_ANIM_WHINNEY; + nextAnimIndex = ENHORSE_ANIM_WHINNY; } else { - nextAnim = ENHORSE_ANIM_IDLE; + nextAnimIndex = ENHORSE_ANIM_IDLE; } EnHorse_IdleAnimSounds(this, play); this->skin.skelAnime.playSpeed = 1.0f; } - if ((nextAnim == ENHORSE_ANIM_GALLOP) || (nextAnim == ENHORSE_ANIM_TROT) || (nextAnim == ENHORSE_ANIM_WALK)) { + if ((nextAnimIndex == ENHORSE_ANIM_GALLOP) || (nextAnimIndex == ENHORSE_ANIM_TROT) || + (nextAnimIndex == ENHORSE_ANIM_WALK)) { if (playerDistToHome < 300.0f) { yaw = player->actor.shape.rot.y; yaw += ((Actor_YawBetweenActors(&this->actor, &player->actor) > 0) ? 1 : -1) * 0x3FFF; @@ -3034,35 +3045,36 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { animFinished = SkelAnime_Update(&this->skin.skelAnime); - if (((this->animationIdx == ENHORSE_ANIM_IDLE) || (this->animationIdx == ENHORSE_ANIM_WHINNEY)) && - ((nextAnim == ENHORSE_ANIM_GALLOP) || (nextAnim == ENHORSE_ANIM_TROT) || (nextAnim == ENHORSE_ANIM_WALK))) { - this->animationIdx = nextAnim; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][nextAnim]), ANIMMODE_ONCE, -3.0f); - if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + if (((this->animIndex == ENHORSE_ANIM_IDLE) || (this->animIndex == ENHORSE_ANIM_WHINNY)) && + ((nextAnimIndex == ENHORSE_ANIM_GALLOP) || (nextAnimIndex == ENHORSE_ANIM_TROT) || + (nextAnimIndex == ENHORSE_ANIM_WALK))) { + this->animIndex = nextAnimIndex; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][nextAnimIndex]), ANIMMODE_ONCE, -3.0f); + if (this->animIndex == ENHORSE_ANIM_GALLOP) { func_8087C1C0(this); - } else if (this->animationIdx == ENHORSE_ANIM_TROT) { + } else if (this->animIndex == ENHORSE_ANIM_TROT) { func_8087C178(this); } } else if (animFinished) { - if (nextAnim == ENHORSE_ANIM_GALLOP) { + if (nextAnimIndex == ENHORSE_ANIM_GALLOP) { func_8087C1C0(this); - } else if (nextAnim == ENHORSE_ANIM_TROT) { + } else if (nextAnimIndex == ENHORSE_ANIM_TROT) { func_8087C178(this); } - if ((this->animationIdx == ENHORSE_ANIM_IDLE) || (this->animationIdx == ENHORSE_ANIM_WHINNEY)) { - if (nextAnim != this->animationIdx) { - this->animationIdx = nextAnim; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), - ANIMMODE_ONCE, -3.0f); + if ((this->animIndex == ENHORSE_ANIM_IDLE) || (this->animIndex == ENHORSE_ANIM_WHINNY)) { + if (nextAnimIndex != this->animIndex) { + this->animIndex = nextAnimIndex; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, + -3.0f); } else { if (Rand_ZeroOne() > 0.5f) { - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; this->stateFlags &= ~ENHORSE_SANDDUST_SOUND; } else { - this->animationIdx = ENHORSE_ANIM_WHINNEY; + this->animIndex = ENHORSE_ANIM_WHINNY; if (this->stateFlags & ENHORSE_DRAW) { if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_KID_HORSE_GROAN); @@ -3071,26 +3083,25 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { } } } - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), - ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, + -3.0f); } - } else if (nextAnim != this->animationIdx) { - this->animationIdx = nextAnim; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, + } else if (nextAnimIndex != this->animIndex) { + this->animIndex = nextAnimIndex; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } - } else if ((this->animationIdx == ENHORSE_ANIM_WALK) && - ((nextAnim == ENHORSE_ANIM_IDLE) || (nextAnim == ENHORSE_ANIM_WHINNEY))) { - this->animationIdx = nextAnim; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - -3.0f); + } else if ((this->animIndex == ENHORSE_ANIM_WALK) && + ((nextAnimIndex == ENHORSE_ANIM_IDLE) || (nextAnimIndex == ENHORSE_ANIM_WHINNY))) { + this->animIndex = nextAnimIndex; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } } @@ -3107,21 +3118,20 @@ void func_80883B70(EnHorse* this, CsCmdActorAction* action) { void func_80883BEC(EnHorse* this, PlayState* play, CsCmdActorAction* action) { func_80883B70(this, action); - this->animationIdx = ENHORSE_ANIM_IDLE; + this->animIndex = ENHORSE_ANIM_IDLE; this->unk_3E0 = 1; this->stateFlags &= ~ENHORSE_SANDDUST_SOUND; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); this->stateFlags |= ENHORSE_SANDDUST_SOUND; } void func_80883CB0(EnHorse* this, PlayState* play, CsCmdActorAction* action) { EnHorse_IdleAnimSounds(this, play); if (SkelAnime_Update(&this->skin.skelAnime)) { - this->animationIdx = ENHORSE_ANIM_IDLE; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - 0.0f); + this->animIndex = ENHORSE_ANIM_IDLE; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } } @@ -3168,36 +3178,34 @@ void func_80883F98(EnHorse* this, PlayState* play, CsCmdActorAction* action) { void func_80884010(EnHorse* this, PlayState* play, CsCmdActorAction* action) { func_80883B70(this, action); this->unk_3E0 = 5; - this->animationIdx = ENHORSE_ANIM_WALK; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + this->animIndex = ENHORSE_ANIM_WALK; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } void func_808840C4(EnHorse* this, PlayState* play, CsCmdActorAction* action) { EnHorse_PlayWalkingSound(this); Cutscene_ActorTranslateAndYaw(&this->actor, play, this->unk_530); if (SkelAnime_Update(&this->skin.skelAnime)) { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } } void func_80884194(EnHorse* this, PlayState* play, CsCmdActorAction* action) { func_80883B70(this, action); this->unk_3E0 = 6; - this->animationIdx = ENHORSE_ANIM_GALLOP; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + this->animIndex = ENHORSE_ANIM_GALLOP; + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); func_8087C1C0(this); } void func_8088424C(EnHorse* this, PlayState* play, CsCmdActorAction* action) { Cutscene_ActorTranslateAndYaw(&this->actor, play, this->unk_530); if (SkelAnime_Update(&this->skin.skelAnime)) { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); func_8087C1C0(this); } } @@ -3308,8 +3316,8 @@ void func_80884718(EnHorse* this, PlayState* play) { void func_80884868(EnHorse* this) { this->action = ENHORSE_ACT_23; - this->animationIdx = ENHORSE_ANIM_WALK; - Animation_PlayLoop(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + this->animIndex = ENHORSE_ANIM_WALK; + Animation_PlayLoop(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); this->stateFlags |= ENHORSE_UNRIDEABLE; } @@ -3329,10 +3337,10 @@ void func_808848C8(EnHorse* this, PlayState* play) { void func_80884994(EnHorse* this) { this->unk_534 = -1; - this->animationIdx = ENHORSE_ANIM_TROT; + this->animIndex = ENHORSE_ANIM_TROT; this->action = ENHORSE_ACT_24; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 2.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 2.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } void func_80884A40(EnHorse* this, PlayState* play) { @@ -3340,43 +3348,42 @@ void func_80884A40(EnHorse* this, PlayState* play) { s32 sp40; s32 temp_v0; - if (this->animationIdx == ENHORSE_ANIM_WHINNEY) { + if (this->animIndex == ENHORSE_ANIM_WHINNY) { temp_v0 = ENHORSE_ANIM_IDLE; } else { - temp_v0 = this->animationIdx; + temp_v0 = this->animIndex; } sp40 = sp44[this->unk_538] != temp_v0; if (SkelAnime_Update(&this->skin.skelAnime) || sp40) { - this->animationIdx = sp44[this->unk_538]; - if ((this->animationIdx == ENHORSE_ANIM_IDLE) && (Rand_ZeroOne() < 0.5f)) { - this->animationIdx = ENHORSE_ANIM_WHINNEY; + this->animIndex = sp44[this->unk_538]; + if ((this->animIndex == ENHORSE_ANIM_IDLE) && (Rand_ZeroOne() < 0.5f)) { + this->animIndex = ENHORSE_ANIM_WHINNY; } if (sp40) { - if (this->animationIdx == ENHORSE_ANIM_IDLE) { - Animation_MorphToPlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], - -3.0f); + if (this->animIndex == ENHORSE_ANIM_IDLE) { + Animation_MorphToPlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], -3.0f); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 2.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), - ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 2.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, + -3.0f); } - } else if (this->animationIdx == ENHORSE_ANIM_IDLE) { - Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx]); + } else if (this->animIndex == ENHORSE_ANIM_IDLE) { + Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); } else { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 2.0f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 2.0f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } if ((this->unk_538 == OBJ_UM_ANIM_TROT) || (this->unk_538 == OBJ_UM_ANIM_GALLOP)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HORSE_RUN); } else if (this->unk_538 == OBJ_UM_ANIM_IDLE) { - if (this->animationIdx == ENHORSE_ANIM_IDLE) { + if (this->animIndex == ENHORSE_ANIM_IDLE) { EnHorse_IdleAnimSounds(this, play); - } else if (this->animationIdx == ENHORSE_ANIM_WHINNEY) { + } else if (this->animIndex == ENHORSE_ANIM_WHINNY) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HORSE_GROAN); } } @@ -3390,11 +3397,11 @@ void func_80884D04(EnHorse* this, PlayState* play) { this->action = ENHORSE_ACT_25; this->unk_540 = this->actor.world.pos; Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_INGO_HORSE_NEIGH); - this->animationIdx = ENHORSE_ANIM_GALLOP; + this->animIndex = ENHORSE_ANIM_GALLOP; playSpeed = this->actor.speedXZ * 0.2f; - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], - sPlaybackSpeeds[this->animationIdx] * playSpeed * 2.5f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], + sPlaybackSpeeds[this->animIndex] * playSpeed * 2.5f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } // Action func: EnHorse_UpdateBandit? @@ -3406,10 +3413,9 @@ void func_80884E0C(EnHorse* this, PlayState* play) { this->skin.skelAnime.playSpeed = playSpeed; if (SkelAnime_Update(&this->skin.skelAnime)) { - Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], - sPlaybackSpeeds[this->animationIdx] * playSpeed * 2.5f, 0.0f, - Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, - 0.0f); + Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], + sPlaybackSpeeds[this->animIndex] * playSpeed * 2.5f, 0.0f, + Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } @@ -3421,7 +3427,7 @@ void func_80884E0C(EnHorse* this, PlayState* play) { if (((this->unk_550 == 5) || (this->unk_550 == 7)) && (Player_GetMask(play) != PLAYER_MASK_CIRCUS_LEADER)) { this->rider->unk488 = 7; } else { - EnHorse_SetIngoAnimation(this->animationIdx, this->skin.skelAnime.curFrame, this->unk_394 & 1, + EnHorse_SetIngoAnimation(this->animIndex, this->skin.skelAnime.curFrame, this->unk_394 & 1, &this->rider->unk488); } @@ -3480,7 +3486,7 @@ s32 EnHorse_CalcFloorHeight(EnHorse* this, PlayState* play, Vec3f* pos, Collisio */ void EnHorse_ObstructMovement(EnHorse* this, PlayState* play, s32 obstacleType, s32 galloping) { if (this->action != ENHORSE_ACT_HBA) { - if ((this->action == ENHORSE_ACT_MOUNTED_IDLE) || (this->action == ENHORSE_ACT_MOUNTED_IDLE_WHINNEYING)) { + if ((this->action == ENHORSE_ACT_MOUNTED_IDLE) || (this->action == ENHORSE_ACT_MOUNTED_IDLE_WHINNYING)) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y -= 0x640; this->actor.speedXZ = 0.0f; @@ -3495,7 +3501,7 @@ void EnHorse_ObstructMovement(EnHorse* this, PlayState* play, s32 obstacleType, this->actor.world.pos = this->lastPos; this->stateFlags |= ENHORSE_OBSTACLE; if (this->playerControlled == 0) { - if (this->animationIdx != 3) {} + if (this->animIndex != 3) {} } else if (this->action != ENHORSE_ACT_REVERSE) { if (this->stateFlags & ENHORSE_JUMPING) { this->stateFlags &= ~ENHORSE_JUMPING; @@ -4155,7 +4161,7 @@ static EnHorseActionFunc sActionFuncs[] = { func_808819D8, func_80881398, EnHorse_MountedIdle, - EnHorse_MountedIdleWhinneying, + EnHorse_MountedIdleWhinnying, EnHorse_MountedTurn, EnHorse_MountedWalk, EnHorse_MountedTrot, @@ -4212,7 +4218,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { this->stateFlags &= ~ENHORSE_OBSTACLE; this->unk_3EC = thisx->world.rot.y; - if ((this->animationIdx == ENHORSE_ANIM_STOPPING) || (this->animationIdx == ENHORSE_ANIM_REARING)) { + if ((this->animIndex == ENHORSE_ANIM_STOPPING) || (this->animIndex == ENHORSE_ANIM_REARING)) { this->skin.skelAnime.jointTable[0].y += 0x154; } @@ -4245,7 +4251,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { this->rider->actor.world.pos.z = thisx->world.pos.z; this->rider->actor.shape.rot.x = thisx->shape.rot.x; this->rider->actor.shape.rot.y = thisx->shape.rot.y; - } else if (this->action == ENHORSE_ACT_MOUNTED_IDLE_WHINNEYING) { + } else if (this->action == ENHORSE_ACT_MOUNTED_IDLE_WHINNYING) { EnIn* in = this->rider; s16 jnt = in->jointTable[0].y; @@ -4272,7 +4278,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { } if ((this->action != ENHORSE_ACT_INGO_RACE) && (this->action != ENHORSE_ACT_MOUNTED_IDLE) && - (this->action != ENHORSE_ACT_MOUNTED_IDLE_WHINNEYING)) { + (this->action != ENHORSE_ACT_MOUNTED_IDLE_WHINNYING)) { EnHorse_TiltBody(this, play); } @@ -4435,7 +4441,7 @@ s32 EnHorse_GetMountSide(EnHorse* this, PlayState* play) { return 0; } - if ((this->animationIdx != ENHORSE_ANIM_IDLE) && (this->animationIdx != ENHORSE_ANIM_WHINNEY)) { + if ((this->animIndex != ENHORSE_ANIM_IDLE) && (this->animIndex != ENHORSE_ANIM_WHINNY)) { return 0; } @@ -4485,7 +4491,7 @@ void EnHorse_PostDraw(Actor* thisx, PlayState* play, Skin* skin) { SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &sp38, &this->unk_218, &sp34); - if ((this->animationIdx == ENHORSE_ANIM_IDLE) && (this->action != ENHORSE_ACT_FROZEN) && + if ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->action != ENHORSE_ACT_FROZEN) && (((curFrame > 40.0f) && (curFrame < 45.0f) && (this->type == 0)) || ((curFrame > 28.0f) && (curFrame < 33.0f) && (this->type == 1)))) { if (Rand_ZeroOne() < 0.02f) { @@ -4539,7 +4545,7 @@ void EnHorse_PostDraw(Actor* thisx, PlayState* play, Skin* skin) { } EnHorse_RandomOffset(&sp64, 10.0f, &this->backRightHoof); } - } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { + } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { if ((curFrame > 14.0f) && (curFrame < 16.0f) && (Rand_ZeroOne() < 0.02f)) { this->dustFlags |= 1; if (this->type == HORSE_TYPE_2) { diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/src/overlays/actors/ovl_En_Horse/z_en_horse.h index 9f32331c6d..3daff98da1 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -53,7 +53,7 @@ typedef enum { /* 3 */ ENHORSE_ACT_FOLLOW_PLAYER, /* 4 */ ENHORSE_ACT_INGO_RACE, /* 5 */ ENHORSE_ACT_MOUNTED_IDLE, - /* 6 */ ENHORSE_ACT_MOUNTED_IDLE_WHINNEYING, + /* 6 */ ENHORSE_ACT_MOUNTED_IDLE_WHINNYING, /* 7 */ ENHORSE_ACT_MOUNTED_TURN, /* 8 */ ENHORSE_ACT_MOUNTED_WALK, /* 9 */ ENHORSE_ACT_MOUNTED_TROT, @@ -84,18 +84,6 @@ typedef enum { /* 5 */ PLAYER_DIR_SIDE_L } EnHorsePlayerDir; -typedef enum { - /* 0 */ ENHORSE_ANIM_IDLE, - /* 1 */ ENHORSE_ANIM_WHINNEY, - /* 2 */ ENHORSE_ANIM_STOPPING, - /* 3 */ ENHORSE_ANIM_REARING, - /* 4 */ ENHORSE_ANIM_WALK, - /* 5 */ ENHORSE_ANIM_TROT, - /* 6 */ ENHORSE_ANIM_GALLOP, - /* 7 */ ENHORSE_ANIM_LOW_JUMP, - /* 8 */ ENHORSE_ANIM_HIGH_JUMP -} EnHorseAnimationIndex; - typedef enum { /* 0 */ HORSE_TYPE_EPONA, /* 1 */ HORSE_TYPE_HNI, @@ -157,7 +145,7 @@ typedef struct EnHorse { /* 0x200 */ s32 curRaceWaypoint; /* 0x204 */ s32 boostSpeed; /* 0x208 */ s32 playerControlled; - /* 0x20C */ s32 animationIdx; + /* 0x20C */ s32 animIndex; /* 0x210 */ f32 curFrame; /* 0x214 */ s32 soundTimer; /* 0x218 */ Vec3f unk_218; diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c index cf24adfd0b..a39d050c77 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -143,7 +143,7 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_dai_Anim_0048B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dai_Anim_0048B4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_dai_Anim_005100, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, @@ -237,7 +237,7 @@ s32 func_80BF1284(EnIg* this, s32 arg1) { if (phi_v1) { this->unk_3FC = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); this->unk_3D4 = this->skelAnime.playSpeed; } 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 19d4a26a8d..5dda24d0b9 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -118,7 +118,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_in_Anim_001D10, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_in_Anim_001D10, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_in_Anim_014F8C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, @@ -146,19 +146,19 @@ static TrackOptionsSet sTrackOptions = { { 0x1770, 4, 1, 6 }, }; -s32 func_808F30B0(SkelAnime* skelAnime, s16 animIndex) { +s32 EnIn_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) { s16 frameCount; s32 ret = false; if (animIndex >= 0 && animIndex < 18) { ret = true; - frameCount = sAnimations[animIndex].frameCount; + frameCount = sAnimationInfo[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation); + frameCount = Animation_GetLastFrame(sAnimationInfo[animIndex].animation); } - Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, - sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode, - sAnimations[animIndex].morphFrames); + Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed, + sAnimationInfo[animIndex].startFrame, frameCount, sAnimationInfo[animIndex].mode, + sAnimationInfo[animIndex].morphFrames); } return ret; } @@ -274,7 +274,7 @@ void EnIn_DoNothing(EnIn* this, PlayState* play) { void func_808F3618(EnIn* this, PlayState* play) { if (ENIN_GET_PATH(&this->actor) != 0x3F) { - func_808F30B0(&this->skelAnime, 9); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_9); } if (ENIN_GET_PATH(&this->actor) != 0x3F) { this->actionFunc = func_808F3690; @@ -871,8 +871,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { break; case 0x3476: Actor_ContinueText(play, &this->actor, 0x3477); - func_808F30B0(&this->skelAnime, 1); - func_808F30B0(&this->unk4A4->skelAnime, 7); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_1); + EnIn_ChangeAnim(&this->unk4A4->skelAnime, ENIN_ANIM_7); ret = false; break; case 0x3477: @@ -881,8 +881,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { ret = false; break; case 0x347A: - func_808F30B0(&this->skelAnime, 1); - func_808F30B0(&this->unk4A4->skelAnime, 7); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_1); + EnIn_ChangeAnim(&this->unk4A4->skelAnime, ENIN_ANIM_7); if (INV_CONTENT(ITEM_MASK_GARO) == ITEM_MASK_GARO) { Actor_ContinueText(play, &this->actor, 0x347E); ret = false; @@ -1072,8 +1072,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { gSaveContext.save.weekEventReg[57] |= 1; break; case 0x349D: - func_808F30B0(&this->skelAnime, 1); - func_808F30B0(&this->unk4A4->skelAnime, 7); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_1); + EnIn_ChangeAnim(&this->unk4A4->skelAnime, ENIN_ANIM_7); if (INV_CONTENT(ITEM_MASK_GARO) == ITEM_MASK_GARO) { Actor_ContinueText(play, &this->actor, 0x34A1); ret = false; @@ -1118,8 +1118,8 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) { break; case 0x3499: Actor_ContinueText(play, &this->actor, 0x349A); - func_808F30B0(&this->skelAnime, 1); - func_808F30B0(&this->unk4A4->skelAnime, 7); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_1); + EnIn_ChangeAnim(&this->unk4A4->skelAnime, ENIN_ANIM_7); ret = false; break; case 0x349A: @@ -1358,7 +1358,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_in_Skel_014EA8, NULL, this->jointTable, this->morphTable, 20); - func_808F30B0(&this->skelAnime, 0); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0); Collider_InitCylinder(play, &this->colliderCylinder); Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); @@ -1395,9 +1395,9 @@ void EnIn_Init(Actor* thisx, PlayState* play) { this->unk23C = 0; D_801BDAA0 = 0; if (GET_RACE_FLAGS == RACE_FLAG_2) { - func_808F30B0(&this->skelAnime, 6); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_6); } else { - func_808F30B0(&this->skelAnime, 4); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_4); } if (GET_RACE_FLAGS == RACE_FLAG_2) { this->skelAnime.curFrame = ((Rand_ZeroOne() * 0.6f) + 0.2f) * this->skelAnime.endFrame; @@ -1414,7 +1414,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { this->unk4AC |= 2; if (type == ENIN_BLUE_SHIRT) { if (func_808F33B8()) { - func_808F30B0(&this->skelAnime, 0); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0); this->actionFunc = func_808F5A94; } else { if (gSaveContext.save.weekEventReg[52] & 1) { @@ -1423,7 +1423,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.y, this->actor.shape.rot.z, 0xF); Actor_MarkForDeath(&this->actor); } else { - func_808F30B0(&this->skelAnime, 0); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0); this->actionFunc = func_808F5A94; } } @@ -1431,7 +1431,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { if (gSaveContext.save.weekEventReg[52] & 1) { Actor_MarkForDeath(&this->actor); } else { - func_808F30B0(&this->skelAnime, 7); + EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_7); this->actionFunc = func_808F5B58; } } diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h index 6c6a2f3dd3..1fb9694f6c 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -15,6 +15,27 @@ typedef enum { /* 4 */ ENIN_BLUE_SHIRT } EnInType; +typedef enum { + /* 0 */ ENIN_ANIM_0, + /* 1 */ ENIN_ANIM_1, + /* 2 */ ENIN_ANIM_2, + /* 3 */ ENIN_ANIM_3, + /* 4 */ ENIN_ANIM_4, + /* 5 */ ENIN_ANIM_5, + /* 6 */ ENIN_ANIM_6, + /* 7 */ ENIN_ANIM_7, + /* 8 */ ENIN_ANIM_8, + /* 9 */ ENIN_ANIM_9, + /* 10 */ ENIN_ANIM_10, + /* 11 */ ENIN_ANIM_11, + /* 12 */ ENIN_ANIM_12, + /* 13 */ ENIN_ANIM_13, + /* 14 */ ENIN_ANIM_14, + /* 15 */ ENIN_ANIM_15, + /* 16 */ ENIN_ANIM_16, + /* 17 */ ENIN_ANIM_17, +} EnInAnimation; + #define ENIN_GET_TYPE(thisx) ((thisx)->params & 0x1FF) #define ENIN_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9) // Only used with ENIN_UNK_TYPE diff --git a/src/overlays/actors/ovl_En_Ja/z_en_ja.c b/src/overlays/actors/ovl_En_Ja/z_en_ja.c index aa2dce882e..8a53c8bd29 100644 --- a/src/overlays/actors/ovl_En_Ja/z_en_ja.c +++ b/src/overlays/actors/ovl_En_Ja/z_en_ja.c @@ -89,7 +89,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_boj_Anim_002734, 1.0f, 0, -1, 0, 0 }, { &object_boj_Anim_0033B0, 1.0f, 0, -1, 0, 0 }, { &object_boj_Anim_002734, 1.0f, 0, -1, 0, -4 }, { &object_boj_Anim_0033B0, 1.0f, 0, -1, 0, -4 }, { &object_boj_Anim_004078, 1.0f, 0, -1, 0, 0 }, { &object_boj_Anim_005CE4, 1.0f, 0, -1, 0, 0 }, @@ -105,7 +105,7 @@ s32 func_80BC192C(EnJa* this, s32 arg1) { if (arg1 != this->unk_36C) { this->unk_36C = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); this->unk_344 = this->skelAnime.playSpeed; } diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c index 8dd44f5f3f..bb5ec72ee1 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -35,27 +35,27 @@ s32 EnJg_GetStartingConversationTextId(EnJg* this, PlayState* play); void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, PlayState* play); typedef enum { - /* 0 */ EN_JG_ANIMATION_IDLE, - /* 1 */ EN_JG_ANIMATION_WALK, - /* 2 */ EN_JG_ANIMATION_WAVING, - /* 3 */ EN_JG_ANIMATION_SHAKING_HEAD, - /* 4 */ EN_JG_ANIMATION_SURPRISE_START, - /* 5 */ EN_JG_ANIMATION_SURPRISE_LOOP, - /* 6 */ EN_JG_ANIMATION_ANGRY, - /* 7 */ EN_JG_ANIMATION_FROZEN_START, - /* 8 */ EN_JG_ANIMATION_FROZEN_LOOP, - /* 9 */ EN_JG_ANIMATION_WALK_2, - /* 10 */ EN_JG_ANIMATION_TAKING_OUT_DRUM, - /* 11 */ EN_JG_ANIMATION_DRUM_IDLE, - /* 12 */ EN_JG_ANIMATION_PLAYING_DRUM, - /* 13 */ EN_JG_ANIMATION_THINKING, - /* 14 */ EN_JG_ANIMATION_REMEMBERING, - /* 15 */ EN_JG_ANIMATION_STRONG_REMEMBERING, - /* 16 */ EN_JG_ANIMATION_DEPRESSED, - /* 17 */ EN_JG_ANIMATION_CUTSCENE_IDLE, - /* 18 */ EN_JG_ANIMATION_CRADLE, - /* 19 */ EN_JG_ANIMATION_MAX, -} EnJgAnimationIndex; + /* 0 */ EN_JG_ANIM_IDLE, + /* 1 */ EN_JG_ANIM_WALK, + /* 2 */ EN_JG_ANIM_WAVING, + /* 3 */ EN_JG_ANIM_SHAKING_HEAD, + /* 4 */ EN_JG_ANIM_SURPRISE_START, + /* 5 */ EN_JG_ANIM_SURPRISE_LOOP, + /* 6 */ EN_JG_ANIM_ANGRY, + /* 7 */ EN_JG_ANIM_FROZEN_START, + /* 8 */ EN_JG_ANIM_FROZEN_LOOP, + /* 9 */ EN_JG_ANIM_WALK_2, + /* 10 */ EN_JG_ANIM_TAKING_OUT_DRUM, + /* 11 */ EN_JG_ANIM_DRUM_IDLE, + /* 12 */ EN_JG_ANIM_PLAYING_DRUM, + /* 13 */ EN_JG_ANIM_THINKING, + /* 14 */ EN_JG_ANIM_REMEMBERING, + /* 15 */ EN_JG_ANIM_STRONG_REMEMBERING, + /* 16 */ EN_JG_ANIM_DEPRESSED, + /* 17 */ EN_JG_ANIM_CUTSCENE_IDLE, + /* 18 */ EN_JG_ANIM_CRADLE, + /* 19 */ EN_JG_ANIM_MAX, +} EnJgAnimation; typedef enum { /* 0x0 */ EN_JG_ACTION_FIRST_THAW, @@ -133,7 +133,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gGoronElderIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, { &gGoronElderWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, { &gGoronElderWavingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, @@ -296,20 +296,20 @@ void EnJg_SetupGoronShrineCheer(EnJg* this) { void EnJg_SetupTalk(EnJg* this, PlayState* play) { switch (this->textId) { case 0xDAC: // What was I doing? - this->animationIndex = EN_JG_ANIMATION_SHAKING_HEAD; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_SHAKING_HEAD; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Talk; break; case 0xDAD: // I must hurry! - this->animationIndex = EN_JG_ANIMATION_SURPRISE_START; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_SURPRISE_START; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_AlternateTalkOrWalkInPlace; break; case 0xDB7: // You're Darmani! - this->animationIndex = EN_JG_ANIMATION_SURPRISE_START; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_SURPRISE_START; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Talk; break; @@ -319,8 +319,8 @@ void EnJg_SetupTalk(EnJg* this, PlayState* play) { case 0xDBA: // I've been made a fool of! case 0xDBD: // "...What?" case 0xDC4: // It's so cold I can't play - this->animationIndex = EN_JG_ANIMATION_IDLE; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_IDLE; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Talk; break; @@ -328,15 +328,15 @@ void EnJg_SetupTalk(EnJg* this, PlayState* play) { case 0xDBB: // If I can see past the illusion, you'll vanish case 0xDBC: // Following me won't do you any good case 0xDC6: // I am counting on you - this->animationIndex = EN_JG_ANIMATION_ANGRY; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_ANGRY; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Talk; break; case 0xDB4: // This is our problem (first) case 0xDB5: // This is our problem (repeat) - this->animationIndex = EN_JG_ANIMATION_WAVING; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_WAVING; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Talk; break; } @@ -417,23 +417,23 @@ void EnJg_GoronShrineCheer(EnJg* this, PlayState* play) { void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); s16 currentFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_START) { + if (this->animIndex == EN_JG_ANIM_SURPRISE_START) { if (currentFrame == lastFrame) { - this->animationIndex = EN_JG_ANIMATION_SURPRISE_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_SURPRISE_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } - } else if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_LOOP) { + } else if (this->animIndex == EN_JG_ANIM_SURPRISE_LOOP) { if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->flags &= ~FLAG_LOOKING_AT_PLAYER; - this->animationIndex = EN_JG_ANIMATION_WALK; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_WALK; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Walk; } - } else if (this->animationIndex == EN_JG_ANIMATION_WALK) { + } else if (this->animIndex == EN_JG_ANIM_WALK) { Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f); EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(this, play); } @@ -455,7 +455,7 @@ void EnJg_Walk(EnJg* this, PlayState* play) { if (EnJg_ReachedPoint(this, this->path, this->currentPoint)) { if (this->currentPoint >= (this->path->count - 1)) { // Force the elder to walk in place - this->animationIndex = EN_JG_ANIMATION_WALK; + this->animIndex = EN_JG_ANIM_WALK; this->actionFunc = EnJg_AlternateTalkOrWalkInPlace; } else { this->currentPoint++; @@ -472,12 +472,12 @@ void EnJg_Walk(EnJg* this, PlayState* play) { void EnJg_Talk(EnJg* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); s16 currentFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); u16 temp; - if ((this->animationIndex == EN_JG_ANIMATION_SURPRISE_START) && (currentFrame == lastFrame)) { - this->animationIndex = EN_JG_ANIMATION_SURPRISE_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + if ((this->animIndex == EN_JG_ANIM_SURPRISE_START) && (currentFrame == lastFrame)) { + this->animIndex = EN_JG_ANIM_SURPRISE_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { @@ -529,10 +529,10 @@ void EnJg_Talk(EnJg* this, PlayState* play) { } void EnJg_SetupWalk(EnJg* this, PlayState* play) { - if (this->animationIndex != EN_JG_ANIMATION_WALK) { - this->animationIndex = EN_JG_ANIMATION_WALK; + if (this->animIndex != EN_JG_ANIM_WALK) { + this->animIndex = EN_JG_ANIM_WALK; this->freezeTimer = 1000; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Walk; } else { this->freezeTimer = 1000; @@ -542,7 +542,7 @@ void EnJg_SetupWalk(EnJg* this, PlayState* play) { void EnJg_Freeze(EnJg* this, PlayState* play) { s16 currentFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (this->action == EN_JG_ACTION_SPAWNING) { this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW; @@ -551,18 +551,18 @@ void EnJg_Freeze(EnJg* this, PlayState* play) { this->icePoly = Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 0xFF50); - this->animationIndex = EN_JG_ANIMATION_FROZEN_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_FROZEN_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_FrozenIdle; - } else if (this->animationIndex == EN_JG_ANIMATION_FROZEN_START) { + } else if (this->animIndex == EN_JG_ANIM_FROZEN_START) { this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW; if (currentFrame == lastFrame) { this->freezeTimer = 1000; this->icePoly = Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 0xFF50); - this->animationIndex = EN_JG_ANIMATION_FROZEN_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_FROZEN_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_FrozenIdle; } } @@ -571,20 +571,20 @@ void EnJg_Freeze(EnJg* this, PlayState* play) { void EnJg_FrozenIdle(EnJg* this, PlayState* play) { if (this->icePoly->update == NULL) { this->icePoly = NULL; - if (this->animationIndex == EN_JG_ANIMATION_FROZEN_LOOP) { + if (this->animIndex == EN_JG_ANIM_FROZEN_LOOP) { if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - this->animationIndex = EN_JG_ANIMATION_IDLE; + this->animIndex = EN_JG_ANIM_IDLE; // If you've never talked to the elder before, he stands // around idle until you've talked to him at least once. // Otherwise, he immediately begins walking after being // thawed out. if (this->textId == 0xDAC) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Idle; } else { this->freezeTimer = 1000; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Walk; } } @@ -630,7 +630,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) { switch (play->csCtx.actorActions[actionIndex]->action) { case 1: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_CUTSCENE_IDLE; + this->cutsceneAnimIndex = EN_JG_ANIM_CUTSCENE_IDLE; if (this->drum != NULL) { Actor_MarkForDeath(this->drum); this->drum = NULL; @@ -638,50 +638,50 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) { break; case 2: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_TAKING_OUT_DRUM; + this->cutsceneAnimIndex = EN_JG_ANIM_TAKING_OUT_DRUM; break; case 3: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_DRUM_IDLE; + this->cutsceneAnimIndex = EN_JG_ANIM_DRUM_IDLE; break; case 4: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_PLAYING_DRUM; + this->cutsceneAnimIndex = EN_JG_ANIM_PLAYING_DRUM; break; case 5: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_THINKING; + this->cutsceneAnimIndex = EN_JG_ANIM_THINKING; break; case 6: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_REMEMBERING; + this->cutsceneAnimIndex = EN_JG_ANIM_REMEMBERING; break; case 7: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_STRONG_REMEMBERING; + this->cutsceneAnimIndex = EN_JG_ANIM_STRONG_REMEMBERING; break; case 8: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_DEPRESSED; + this->cutsceneAnimIndex = EN_JG_ANIM_DEPRESSED; break; case 9: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_CRADLE; + this->cutsceneAnimIndex = EN_JG_ANIM_CRADLE; break; default: - this->cutsceneAnimationIndex = EN_JG_ANIMATION_IDLE; + this->cutsceneAnimIndex = EN_JG_ANIM_IDLE; break; } - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->cutsceneAnimationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->cutsceneAnimIndex); } if ((!(this->flags & FLAG_DRUM_SPAWNED)) && - (((this->cutsceneAnimationIndex == EN_JG_ANIMATION_TAKING_OUT_DRUM) && - (Animation_OnFrame(&this->skelAnime, 14.0f)) && (this->action != EN_JG_ACTION_LULLABY_INTRO_CS)) || - (((this->cutsceneAnimationIndex == EN_JG_ANIMATION_DRUM_IDLE) || - (this->cutsceneAnimationIndex == EN_JG_ANIMATION_PLAYING_DRUM)) && + (((this->cutsceneAnimIndex == EN_JG_ANIM_TAKING_OUT_DRUM) && (Animation_OnFrame(&this->skelAnime, 14.0f)) && + (this->action != EN_JG_ACTION_LULLABY_INTRO_CS)) || + (((this->cutsceneAnimIndex == EN_JG_ANIM_DRUM_IDLE) || + (this->cutsceneAnimIndex == EN_JG_ANIM_PLAYING_DRUM)) && (this->action == EN_JG_ACTION_LULLABY_INTRO_CS)))) { this->flags |= FLAG_DRUM_SPAWNED; this->drum = Actor_SpawnAsChildAndCutscene( @@ -690,7 +690,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) { this->actor.params, this->actor.cutscene, this->actor.unk20, NULL); } - if (this->cutsceneAnimationIndex == EN_JG_ANIMATION_TAKING_OUT_DRUM) { + if (this->cutsceneAnimIndex == EN_JG_ANIM_TAKING_OUT_DRUM) { if (Animation_OnFrame(&this->skelAnime, 23.0f)) { Audio_PlaySfxAtPos(&sSfxPos, NA_SE_EV_WOOD_BOUND_S); } else if (Animation_OnFrame(&this->skelAnime, 38.0f)) { @@ -899,7 +899,7 @@ void EnJg_SpawnBreath(EnJg* this, PlayState* play) { */ void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, PlayState* play) { s16 currentFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->flags |= FLAG_LOOKING_AT_PLAYER; @@ -925,8 +925,8 @@ void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, PlayState* play this->freezeTimer--; if ((this->freezeTimer <= 0) && (currentFrame == lastFrame)) { - this->animationIndex = EN_JG_ANIMATION_FROZEN_START; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = EN_JG_ANIM_FROZEN_START; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); Audio_PlaySfxAtPos(&sSfxPos, NA_SE_EV_FREEZE_S); this->actionFunc = EnJg_Freeze; } @@ -951,25 +951,25 @@ void EnJg_Init(Actor* thisx, PlayState* play) { if ((play->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7) && (play->csCtx.currentCsIndex == 0)) { // This is the elder that appears in the cutscene for learning the full Goron Lullaby. - this->animationIndex = EN_JG_ANIMATION_IDLE; + this->animIndex = EN_JG_ANIM_IDLE; this->action = EN_JG_ACTION_LULLABY_INTRO_CS; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_LullabyIntroCutsceneAction; } else { // This is the elder that appears in Mountain Village or the Path to Goron Village in winter. this->path = SubS_GetPathByIndex(play, EN_JG_GET_PATH(thisx), 0x3F); - this->animationIndex = EN_JG_ANIMATION_SURPRISE_START; + this->animIndex = EN_JG_ANIM_SURPRISE_START; this->action = EN_JG_ACTION_SPAWNING; this->freezeTimer = 1000; this->textId = 0xDAC; // What was I doing? - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_Freeze; } } else { // This is the elder that appears in Goron Shrine in spring. - this->animationIndex = EN_JG_ANIMATION_IDLE; + this->animIndex = EN_JG_ANIM_IDLE; this->cutscene = this->actor.cutscene; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_GoronShrineIdle; } } diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.h b/src/overlays/actors/ovl_En_Jg/z_en_jg.h index f225b51f7c..8564f8ad1d 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.h +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.h @@ -26,14 +26,14 @@ typedef struct EnJg { /* 0x1F8 */ Vec3s jointTable[GORON_ELDER_LIMB_MAX]; /* 0x2CA */ Vec3s morphTable[GORON_ELDER_LIMB_MAX]; /* 0x39C */ s16 rootRotationWhenTalking; - /* 0x39E */ s16 animationIndex; + /* 0x39E */ s16 animIndex; /* 0x3A0 */ s16 action; /* 0x3A2 */ s16 freezeTimer; /* 0x3A4 */ Vec3f breathPos; /* 0x3B0 */ Vec3f breathVelocity; /* 0x3BC */ Vec3f breathAccel; /* 0x3C8 */ s16 cutscene; - /* 0x3CA */ u8 cutsceneAnimationIndex; + /* 0x3CA */ u8 cutsceneAnimIndex; /* 0x3CB */ u8 csAction; /* 0x3CC */ u16 flags; /* 0x3CE */ u16 textId; diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c index 3ef0f7e259..8957cfc211 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c @@ -48,7 +48,7 @@ const ActorInit En_Jgame_Tsn_InitVars = { (ActorFunc)EnJgameTsn_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_tsn_Anim_0092FC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f }, { &object_tsn_Anim_000964, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f }, { &object_tsn_Anim_001198, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f }, @@ -145,7 +145,7 @@ void EnJgameTsn_Destroy(Actor* thisx, PlayState* play) { } void func_80C13B74(EnJgameTsn* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80C13BB8; } @@ -156,15 +156,15 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) { if (this->actor.flags & ACTOR_FLAG_10000) { this->actor.flags &= ~ACTOR_FLAG_10000; if (gSaveContext.unk_3DE0[4] > 0) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Message_StartTextbox(play, 0x10A2, &this->actor); this->unk_300 = 0x10A2; } else if (gSaveContext.minigameScore < 20) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Message_StartTextbox(play, 0x10A2, &this->actor); this->unk_300 = 0x10A2; } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x10A3, &this->actor); this->unk_300 = 0x10A3; } @@ -174,11 +174,11 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) { this->unk_300 = 0x1094; } else if (this->unk_2F8 == 0) { this->unk_2F8 = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Message_StartTextbox(play, 0x1095, &this->actor); this->unk_300 = 0x1095; } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Message_StartTextbox(play, 0x1096, &this->actor); this->unk_300 = 0x1096; } @@ -211,11 +211,11 @@ void func_80C13E90(EnJgameTsn* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_10000; if (((gSaveContext.save.time > CLOCK_TIME(4, 0)) && (gSaveContext.save.time < CLOCK_TIME(7, 0))) || ((gSaveContext.save.time > CLOCK_TIME(16, 0)) && (gSaveContext.save.time < CLOCK_TIME(19, 0)))) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x1094, &this->actor); this->unk_300 = 0x1094; } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Message_StartTextbox(play, 0x1098, &this->actor); this->unk_300 = 0x1098; } @@ -335,7 +335,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { this->unk_2FC++; if ((player->actor.bgCheckFlags & 2) && func_80C149B0(play, &this->unk_200)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x109F, &this->actor); this->unk_300 = 0x109F; player->stateFlags1 |= 0x20; @@ -343,7 +343,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { func_801A2C20(); func_80C14030(this); } else if ((player->actor.bgCheckFlags & 0x40) || (player->actor.bgCheckFlags & 0x20)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x10A0, &this->actor); this->unk_300 = 0x10A0; player->stateFlags1 |= 0x20; @@ -412,12 +412,12 @@ void func_80C14684(EnJgameTsn* this, PlayState* play) { this->unk_300 = 0x109E; Rupees_ChangeBy(-20); } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x109D, &this->actor); this->unk_300 = 0x109D; } } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x109C, &this->actor); this->unk_300 = 0x109C; } @@ -460,7 +460,7 @@ void func_80C147B4(EnJgameTsn* this, PlayState* play) { break; case 0x109A: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); Message_StartTextbox(play, 0x109B, &this->actor); this->unk_300 = 0x109B; break; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index bed6b7ed40..72eafa2836 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -122,15 +122,15 @@ typedef enum { /* 0x6 */ ENKAKASI_ANIM_WAVE, // "wave" short sideways shake, stops early, partial? unused? /* 0x7 */ ENKAKASI_ANIM_SLOWROLL, // partial bounch, ends looking left, OFFER anim takes over /* 0x8 */ ENKAKASI_ANIM_IDLE, // slow stretching wiggle, ends in regular position -} EnKakasi_Animations; +} EnKakasiAnimation; -static AnimationHeader* kakasiAnimations[] = { +static AnimationHeader* sAnimations[] = { &object_ka_Anim_007444, &object_ka_Anim_00686C, &object_ka_Anim_0081A4, &object_ka_Anim_007B90, &object_ka_Anim_0071EC, &object_ka_Anim_007444, &object_ka_Anim_00686C, &object_ka_Anim_0081A4, &object_ka_Anim_000214, }; -static u8 sAnimModes[] = { +static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, }; @@ -195,12 +195,12 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) { } } -void EnKakasi_SetAnimation(EnKakasi* this, s32 index) { - this->animIndex = index; - this->animeFrameCount = Animation_GetLastFrame(&kakasiAnimations[this->animIndex]->common); +void EnKakasi_ChangeAnim(EnKakasi* this, s32 animIndex) { + this->animIndex = animIndex; + this->animeFrameCount = Animation_GetLastFrame(&sAnimations[this->animIndex]->common); // 1: regular playback speed, 0: starting frame - Animation_Change(&this->skelanime, kakasiAnimations[this->animIndex], 1.0f, 0.0f, this->animeFrameCount, - sAnimModes[this->animIndex], -4.0f); + Animation_Change(&this->skelanime, sAnimations[this->animIndex], 1.0f, 0.0f, this->animeFrameCount, + sAnimationModes[this->animIndex], -4.0f); } s32 EnKakasi_ValidatePictograph(PlayState* play, Actor* thisx) { @@ -280,7 +280,7 @@ void func_8096FBB8(EnKakasi* this, PlayState* play) { this->unk190++; } if (this->unk190 != 0 && this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } if (this->unk190 > 8) { this->unk190 = 8; @@ -292,7 +292,7 @@ void func_8096FBB8(EnKakasi* this, PlayState* play) { } void EnKakasi_InitTimeSkipDialogue(EnKakasi* this) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SLOWROLL); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SLOWROLL); this->actionFunc = EnKakasi_TimeSkipDialogue; } @@ -351,21 +351,21 @@ void EnKakasi_IdleStanding(EnKakasi* this, PlayState* play) { if (this->picto.actor.projectedPos.z > -20.0f && x > 0 && x < SCREEN_WIDTH && y > 0 && y < SCREEN_HEIGHT && this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { // faster shaking - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); this->skelanime.playSpeed = 2.0f; } } else if (Player_GetMask(play) == PLAYER_MASK_KAMARO) { if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); this->skelanime.playSpeed = 2.0f; } } else if (saveContextDay == 3 && gSaveContext.save.isNight) { this->skelanime.playSpeed = 1.0f; if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, 1); + EnKakasi_ChangeAnim(this, 1); } } else if (this->animIndex != ENKAKASI_ANIM_IDLE) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_IDLE); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_IDLE); } if (this->picto.actor.xzDistToPlayer < 120.0f) { func_800B8614(&this->picto.actor, play, 100.0f); @@ -376,12 +376,12 @@ void EnKakasi_IdleStanding(EnKakasi* this, PlayState* play) { void EnKakasi_SetupDialogue(EnKakasi* this) { // bug? starts one animation then changes it a few lines down? if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } this->talkState = TEXT_STATE_5; this->unkState196 = 1; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SPIN_REACH_OFFER); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SPIN_REACH_OFFER); this->actionFunc = EnKakasi_RegularDialogue; } @@ -394,7 +394,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { if (this->picto.actor.textId != 0x1644 && this->animeFrameCount <= currentAnimeFrame && this->animIndex == ENKAKASI_ANIM_SLOWROLL) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SPIN_REACH_OFFER); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SPIN_REACH_OFFER); this->unkCounter1A4 = 0; } @@ -403,7 +403,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { if (this->animeFrameCount <= currentAnimeFrame && this->animIndex != ENKAKASI_ANIM_SPIN_REACH_OFFER) { if (++this->unkCounter1A4 >= 2) { this->unkCounter1A4 = 0; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SPIN_REACH_OFFER); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SPIN_REACH_OFFER); } } } @@ -426,7 +426,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { u32 saveContextDay2 = gSaveContext.save.day; if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } if (saveContextDay2 == 3 && gSaveContext.save.isNight) { @@ -465,13 +465,13 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { } else if (this->picto.actor.textId == 0x1645 || this->picto.actor.textId == 0x164E) { this->picto.actor.textId = 0x1650; // "Shall we dance? No Yes" if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } this->talkState = TEXT_STATE_CHOICE; } else if (this->picto.actor.textId == 0x1644) { if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } if (gSaveContext.save.isNight) { this->picto.actor.textId = 0x164E; @@ -481,12 +481,12 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { } else if (this->picto.actor.textId == 0x164F) { if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } this->picto.actor.textId = 0x165A; } else if (this->picto.actor.textId == 0x1651) { if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } this->picto.actor.textId = 0x1654; } else if (this->picto.actor.textId == 0x1654) { @@ -522,7 +522,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { } else { this->picto.actor.textId = 0x1652; } - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_HOPPING_REGULAR); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_HOPPING_REGULAR); } else { func_8019F230(); if (this->picto.actor.textId == 0x1656) { // would you like to learn a song? yes/no @@ -534,7 +534,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { } this->unkCounter1A4 = 0; if (this->animIndex != ENKAKASI_ANIM_ARMS_CROSSED_ROCKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); } } } @@ -548,7 +548,7 @@ void EnKakasi_SetupSongTeach(EnKakasi* this, PlayState* play) { this->subCamId = SUB_CAM_ID_DONE; this->subCamFov = 0.0f; this->subCamFovNext = 60.0f; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL); this->unkState196 = 2; this->actionFunc = EnKakasi_OcarinaRemark; } @@ -627,13 +627,13 @@ void EnKakasi_TeachingSong(EnKakasi* this, PlayState* play) { this->picto.actor.textId = 0x1647; this->unkState1A8 = 2; this->talkState = TEXT_STATE_5; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); this->actionFunc = EnKakasi_RegularDialogue; } else if (play->msgCtx.ocarinaMode == 3) { // song success this->postTeachTimer = 30; this->skelanime.playSpeed = 2.0f; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_HOPPING_REGULAR); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_HOPPING_REGULAR); this->actionFunc = EnKakasi_PostSongLearnTwirl; } } @@ -643,7 +643,7 @@ void EnKakasi_PostSongLearnTwirl(EnKakasi* this, PlayState* play) { f32 animeFrame = this->skelanime.curFrame; if (this->postTeachTimer == 0 && this->animIndex != ENKAKASI_ANIM_TWIRL) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL); this->skelanime.playSpeed = 2.0f; } if (this->postTeachTimer == 0 && this->animIndex == ENKAKASI_ANIM_TWIRL && this->animeFrameCount <= animeFrame) { @@ -656,7 +656,7 @@ void EnKakasi_SetupPostSongLearnDialogue(EnKakasi* this, PlayState* play) { play->msgCtx.ocarinaMode = 4; this->unk190 = 0; this->unkCounter1A4 = 0; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_HOPPING_REGULAR); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_HOPPING_REGULAR); this->subCamId = SUB_CAM_ID_DONE; this->talkState = TEXT_STATE_5; this->unkState1A8 = 1; @@ -686,7 +686,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) { this->animeFrameCount <= tempAnimFrame) { this->unkCounter1A4++; if (this->unkCounter1A4 >= 2) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); } } @@ -694,7 +694,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) { this->animeFrameCount <= tempAnimFrame) { this->unkCounter1A4++; if (this->unkCounter1A4 >= 2) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SPIN_REACH_OFFER); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SPIN_REACH_OFFER); } } @@ -747,7 +747,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) { func_800B7298(play, &this->picto.actor, 7); this->picto.actor.textId = 0x1649; if (this->animIndex != ENKAKASI_ANIM_ARMS_CROSSED_ROCKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); } } else if (this->picto.actor.textId == 0x1649) { @@ -759,7 +759,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) { } else if (this->picto.actor.textId == 0x164B) { this->picto.actor.textId = 0x164C; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL); } else { if (this->picto.actor.textId == 0x164C || this->picto.actor.textId == 0x1661) { @@ -811,7 +811,7 @@ void EnKakasi_SetupDanceNightAway(EnKakasi* this) { this->unkCounter1A4 = 0; this->subCamFov = 0.0f; this->subCamFovNext = 60.0f; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL); Math_Vec3f_Copy(&this->unk22C, &this->picto.actor.home.pos); func_8016566C(0xB4); this->actionFunc = EnKakasi_DancingNightAway; @@ -859,7 +859,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) { if (this->unk204 == 0 && this->animeFrameCount <= currentFrame) { this->unk204 = 0x14; this->unk190++; - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } return; case 2: @@ -954,7 +954,7 @@ void EnKakasi_DoNothing(EnKakasi* this, PlayState* play) { void EnKakasi_SetupDigAway(EnKakasi* this) { if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } this->unk190 = 0; this->unkCounter1A4 = 0; @@ -1065,7 +1065,7 @@ void EnKakasi_RisingOutOfGround(EnKakasi* this, PlayState* play) { this->picto.actor.shape.rot.y += 0x3000; if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { - EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); + EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); } if (this->picto.actor.shape.yOffset < -10.0f) { if ((play->gameplayFrames % 8) == 0) { diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 1c03c38e08..d90bdf93dc 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -71,10 +71,12 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfo sAnimations[] = { - { &object_js_Anim_000C7C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_js_Anim_000F4C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_js_Anim_00016C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_js_Anim_0003DC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, - { &object_js_Anim_000AD4, 1.0f, 0.0f, 0.0f, 0, -8.0f }, +static AnimationInfo sAnimationInfo[] = { + { &object_js_Anim_000C7C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_js_Anim_000F4C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_js_Anim_00016C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_js_Anim_0003DC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_js_Anim_000AD4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; s16 D_80B27CE0[][3] = { @@ -117,7 +119,7 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { this->actor.home.rot.z, 0x10); Actor_MarkForDeath(&this->actor); } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); } } else if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) { Actor_MarkForDeath(&this->actor); @@ -220,7 +222,7 @@ void func_80B26758(EnKendoJs* this, PlayState* play) { play_sound(NA_SE_SY_ERROR); Message_StartTextbox(play, 0x272C, &this->actor); this->unk_288 = 0x272C; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); } else if (gSaveContext.save.playerData.rupees < play->msgCtx.unk1206C) { play_sound(NA_SE_SY_ERROR); Message_StartTextbox(play, 0x2718, &this->actor); @@ -238,7 +240,7 @@ void func_80B26758(EnKendoJs* this, PlayState* play) { play_sound(NA_SE_SY_ERROR); Message_StartTextbox(play, 0x272C, &this->actor); this->unk_288 = 0x272C; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); } else if (gSaveContext.save.playerData.rupees < play->msgCtx.unk12070) { play_sound(NA_SE_SY_ERROR); Message_StartTextbox(play, 0x2718, &this->actor); @@ -328,7 +330,7 @@ void func_80B26AFC(EnKendoJs* this, PlayState* play) { case TEXT_STATE_DONE: if (Message_ShouldAdvance(play)) { if (this->unk_288 == 0x272C) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); } if ((this->unk_288 == 0x272E) || (this->unk_288 == 0x272F) || (this->unk_288 == 0x2730)) { @@ -514,7 +516,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) { func_80B26F14(this, play); } else if (!func_80B26F6C(this, play)) { if (this->skelAnime.animation == &object_js_Anim_00016C) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); } this->unk_286 = 2; func_801477B4(play); @@ -539,7 +541,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) { player->stateFlags1 |= 0x20; Message_StartTextbox(play, 0x2729, &this->actor); this->unk_288 = 0x2729; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); break; default: @@ -555,7 +557,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) { if ((this->skelAnime.animation == &object_js_Anim_0003DC) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); } if (this->unk_284 == 7) { diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index 7ef8f54387..6a9caa18ea 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -17,7 +17,7 @@ void EnKgy_Destroy(Actor* thisx, PlayState* play); void EnKgy_Update(Actor* thisx, PlayState* play); void EnKgy_Draw(Actor* thisx, PlayState* play); -void EnKgy_ChangeAnim(EnKgy* this, s16 arg1, u8 arg2, f32 arg3); +void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 morphFrames); EnKbt* EnKgy_FindZubora(PlayState* play); ObjIcePoly* EnKgy_FindIceBlock(PlayState* play); void func_80B40D30(PlayState* play); @@ -108,7 +108,7 @@ void EnKgy_Destroy(Actor* thisx, PlayState* play) { LightContext_RemoveLight(play, &play->lightCtx, this->lightNode); } -void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 transitionRate) { +void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 morphFrames) { static AnimationHeader* sAnimations[] = { &object_kgy_Anim_004B98, &object_kgy_Anim_0008FC, &object_kgy_Anim_00292C, &object_kgy_Anim_0042E4, &object_kgy_Anim_0101F0, &object_kgy_Anim_001764, &object_kgy_Anim_003334, &object_kgy_Anim_010B84, @@ -116,7 +116,7 @@ void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 transitionRate) { }; Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f, - Animation_GetLastFrame(sAnimations[animIndex]), mode, transitionRate); + Animation_GetLastFrame(sAnimations[animIndex]), mode, morphFrames); this->unk_2D2 = animIndex; } diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 00a86d8bd3..45b93ba9c3 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -134,10 +134,10 @@ static AnimationSpeedInfo sAnimationInfo[] = { { &gRomaniSittingLookDownAnim, 1.0f, ANIMMODE_LOOP, -6.0f }, }; -void EnMa4_ChangeAnim(EnMa4* this, s32 index) { - Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, - sAnimationInfo[index].morphFrames); +void EnMa4_ChangeAnim(EnMa4* this, s32 animIndex) { + Animation_Change(&this->skelAnime, sAnimationInfo[animIndex].animation, 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationInfo[animIndex].animation), sAnimationInfo[animIndex].mode, + sAnimationInfo[animIndex].morphFrames); } void func_80ABDD9C(EnMa4* this, PlayState* play) { @@ -243,30 +243,30 @@ void EnMa4_Destroy(Actor* thisx, PlayState* play) { // Running in circles in the ranch void EnMa4_RunInCircles(EnMa4* this, PlayState* play) { - static s32 sCurrentAnim = 9; + static s32 sAnimIndex = 9; static s32 D_80AC0250 = 0; static s16 D_80AC0254 = 10; Vec3f sp34; s32 pad; s16 sp2E; - if (sCurrentAnim != 9 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if (sCurrentAnim == 3) { + if (sAnimIndex != 9 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + if (sAnimIndex == 3) { if (D_80AC0250 < 3) { D_80AC0250++; } else { D_80AC0250 = 0; EnMa4_ChangeAnim(this, 13); - sCurrentAnim = 13; + sAnimIndex = 13; } } else { this->actor.speedXZ = 2.7f; EnMa4_ChangeAnim(this, 9); - sCurrentAnim = 9; + sAnimIndex = 9; } } - if (sCurrentAnim == 13 && Animation_OnFrame(&this->skelAnime, 37.0f)) { + if (sAnimIndex == 13 && Animation_OnFrame(&this->skelAnime, 37.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROMANI_BOW_FLICK); } @@ -282,7 +282,7 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) { this->actor.speedXZ = 0.0f; D_80AC0254 = 2; EnMa4_ChangeAnim(this, 3); - sCurrentAnim = 3; + sAnimIndex = 3; } else { if (D_80AC0254 > 0) { D_80AC0254--; diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index 05fb0fca08..074b2c8d1d 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -59,7 +59,7 @@ void EnMaYto_PostMilkRunEnd(EnMaYto* this, PlayState* play); void EnMaYto_DefaultStartDialogue(EnMaYto* this, PlayState* play); void EnMaYto_DinnerStartDialogue(EnMaYto* this, PlayState* play); void EnMaYto_BarnStartDialogue(EnMaYto* this, PlayState* play); -void EnMaYto_ChangeAnim(EnMaYto* this, s32 index); +void EnMaYto_ChangeAnim(EnMaYto* this, s32 animIndex); void EnMaYto_UpdateEyes(EnMaYto* this); void func_80B90E50(EnMaYto* this, s16); void EnMaYto_SetRomaniFaceExpression(EnMaYto* this, s16 overrideEyeTexIndex, s16 mouthTexIndex); @@ -380,10 +380,10 @@ void EnMaYto_KeepLookingForRomani(EnMaYto* this, PlayState* play) { void EnMaYto_SetupDefaultWait(EnMaYto* this) { if (this->actor.shape.rot.y == this->actor.home.rot.y) { - this->currentAnim = 11; + this->animIndex = 11; EnMaYto_ChangeAnim(this, 11); } else { - this->currentAnim = 1; + this->animIndex = 1; EnMaYto_ChangeAnim(this, 1); } @@ -398,8 +398,8 @@ void EnMaYto_DefaultWait(EnMaYto* this, PlayState* play) { direction = rotY - this->actor.yawTowardsPlayer; if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 5, 0x3000, 0x100) == 0 && - this->currentAnim == 1) { - this->currentAnim = 11; + this->animIndex == 1) { + this->animIndex = 11; EnMaYto_ChangeAnim(this, 11); } @@ -1268,10 +1268,10 @@ void EnMaYto_BarnStartDialogue(EnMaYto* this, PlayState* play) { } } -void EnMaYto_ChangeAnim(EnMaYto* this, s32 index) { - Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, - sAnimationInfo[index].morphFrames); +void EnMaYto_ChangeAnim(EnMaYto* this, s32 animIndex) { + Animation_Change(&this->skelAnime, sAnimationInfo[animIndex].animation, 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationInfo[animIndex].animation), sAnimationInfo[animIndex].mode, + sAnimationInfo[animIndex].morphFrames); } void func_80B90C78(EnMaYto* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h index 7f2c50fb3e..cc69a029d6 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h @@ -20,7 +20,7 @@ typedef struct EnMaYto { /* 0x28C */ Vec3s morphTable[CREMIA_LIMB_MAX]; /* 0x310 */ s16 unk310; // state? /* 0x312 */ UNK_TYPE1 unk_312[0x2]; - /* 0x314 */ s16 currentAnim; // Used only in DefaultWait + /* 0x314 */ s16 animIndex; // Used only in DefaultWait /* 0x316 */ s16 overrideEyeTexIndex; // If non-zero, then this index will be used instead of eyeTexIndex /* 0x318 */ s16 mouthTexIndex; /* 0x31A */ s16 eyeTexIndex; diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c index 72357758a3..f5456f7a21 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c @@ -113,10 +113,10 @@ static TexturePtr sEyeTextures[] = { gRomaniEyeOpenTex, gRomaniEyeHalfTex, gRomaniEyeClosedTex, gRomaniEyeHappyTex, gRomaniEyeSadTex, }; -void EnMaYts_ChangeAnim(EnMaYts* this, s32 index) { - Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, - sAnimationInfo[index].morphFrames); +void EnMaYts_ChangeAnim(EnMaYts* this, s32 animIndex) { + Animation_Change(&this->skelAnime, sAnimationInfo[animIndex].animation, 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationInfo[animIndex].animation), sAnimationInfo[animIndex].mode, + sAnimationInfo[animIndex].morphFrames); } void func_80B8D12C(EnMaYts* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c index 83a94d271d..0f73088263 100644 --- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c +++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c @@ -63,11 +63,15 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfo sAnimations[] = { - { &object_mm_Anim_002238, 1.0f, 0.0f, 0.0f, 0, -7.0f }, { &object_mm_Anim_00A4E0, -1.0f, 0.0f, 0.0f, 2, -7.0f }, - { &object_mm_Anim_00C640, 1.0f, 0.0f, 0.0f, 0, -7.0f }, { &object_mm_Anim_00A4E0, 1.0f, 0.0f, 0.0f, 2, -7.0f }, - { &object_mm_Anim_000468, 1.0f, 0.0f, 0.0f, 0, -7.0f }, { &object_mm_Anim_00CD90, 1.0f, 0.0f, 0.0f, 0, -12.0f }, - { &object_mm_Anim_00DA50, 1.0f, 0.0f, 0.0f, 0, -12.0f }, { &object_mm_Anim_00DA50, 1.0f, 0.0f, 10.0f, 2, -10.0f }, +static AnimationInfo sAnimationInfo[] = { + { &object_mm_Anim_002238, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -7.0f }, + { &object_mm_Anim_00A4E0, -1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -7.0f }, + { &object_mm_Anim_00C640, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -7.0f }, + { &object_mm_Anim_00A4E0, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -7.0f }, + { &object_mm_Anim_000468, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -7.0f }, + { &object_mm_Anim_00CD90, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -12.0f }, + { &object_mm_Anim_00DA50, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -12.0f }, + { &object_mm_Anim_00DA50, 1.0f, 0.0f, 10.0f, ANIMMODE_ONCE, -10.0f }, }; #include "overlays/ovl_En_Mm3/ovl_En_Mm3.c" @@ -119,7 +123,7 @@ s32 func_80A6F22C(EnMm3* this) { void func_80A6F270(EnMm3* this) { this->unk_1DC = 1; this->unk_2B0 &= ~1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); this->actionFunc = func_80A6F2C8; } @@ -211,7 +215,7 @@ void func_80A6F5E4(EnMm3* this, PlayState* play) { } this->unk_1DC = 0; this->unk_2B0 |= 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7); break; case 0x278B: @@ -355,7 +359,7 @@ void func_80A6F9DC(EnMm3* this, PlayState* play) { } if ((this->skelAnime.mode == 2) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); } if (((this->unk_2B4 == 0x279D) || (this->unk_2B4 == 0x27A0) || (this->unk_2B4 == 0x278B)) && diff --git a/src/overlays/actors/ovl_En_Muto/z_en_muto.c b/src/overlays/actors/ovl_En_Muto/z_en_muto.c index c568e8f6e8..69861434b2 100644 --- a/src/overlays/actors/ovl_En_Muto/z_en_muto.c +++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.c @@ -16,7 +16,7 @@ void EnMuto_Destroy(Actor* thisx, PlayState* play); void EnMuto_Update(Actor* thisx, PlayState* play); void EnMuto_Draw(Actor* thisx, PlayState* play); -void EnMuto_ChangeAnim(EnMuto* this, s32 arg1); +void EnMuto_ChangeAnim(EnMuto* this, s32 animIndex); void EnMuto_SetHeadRotation(EnMuto* this); void EnMuto_SetupIdle(EnMuto* this); void EnMuto_Idle(EnMuto* this, PlayState* play); 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 0f392dcfd6..112871c905 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -187,7 +187,7 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) { if (this->unkTimer24C == 0) { // targetLimbRots[0] is bodyRotY - if (animationState == NIW_ANIMATION_STILL) { + if (animationState == NIW_ANIM_STILL) { this->targetLimbRots[0] = 0.0f; } else { this->targetLimbRots[0] = -10000.0f * tempOne; @@ -197,7 +197,7 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) { this->unkTimer24C = 3; if ((this->unk292 % 2) == 0) { this->targetLimbRots[0] = 0.0f; - if (animationState == NIW_ANIMATION_STILL) { + if (animationState == NIW_ANIM_STILL) { this->unkTimer24C = Rand_ZeroFloat(30.0f); } } @@ -208,11 +208,11 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) { this->unkToggle296 &= 1; switch (animationState) { - case NIW_ANIMATION_STILL: + case NIW_ANIM_STILL: this->targetLimbRots[2] = 0.0f; // both wingRotZ this->targetLimbRots[1] = 0.0f; break; - case NIW_ANIMATION_HEAD_PECKING: + case NIW_ANIM_HEAD_PECKING: this->unkTimer24E = 3; this->targetLimbRots[2] = 7000.0f * tempOne; // both wingRotZ this->targetLimbRots[1] = 7000.0f * tempOne; @@ -222,7 +222,7 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) { } break; - case NIW_ANIMATION_PECKING_AND_WAVING: + case NIW_ANIM_PECKING_AND_WAVING: this->unkTimer24E = 2; this->targetLimbRots[2] = -10000.0f; // both wingRotZ this->targetLimbRots[1] = -10000.0f; @@ -236,7 +236,7 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) { } break; - case NIW_ANIMATION_PECKING_AND_FORFLAPPING: + case NIW_ANIM_PECKING_AND_FORFLAPPING: this->unkTimer24E = 2; this->targetLimbRots[5] = 10000.0f; // both wingRotY this->targetLimbRots[7] = 10000.0f; @@ -246,11 +246,11 @@ void EnNiw_AnimateWingHead(EnNiw* this, PlayState* play, s16 animationState) { } break; - case NIW_ANIMATION_FREEZE: + case NIW_ANIM_FREEZE: this->unkTimer24C = 5; break; - case NIW_ANIMATION_PECKING_SLOW_FORFLAPPING: + case NIW_ANIM_PECKING_SLOW_FORFLAPPING: this->unkTimer24E = 5; this->targetLimbRots[5] = 14000.0f; // both wingRotY this->targetLimbRots[7] = 14000.0f; @@ -348,7 +348,7 @@ void EnNiw_UpdateRunning(EnNiw* this, PlayState* play, s32 isStormCucco) { targetRotY = this->yawTowardsPlayer + runningDirection; Math_SmoothStepToS(&this->actor.world.rot.y, targetRotY, 3, this->unk300, 0); Math_ApproachF(&this->unk300, 3000.0f, 1.0f, 500.0f); - EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_SLOW_FORFLAPPING); + EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_SLOW_FORFLAPPING); } void EnNiw_SetupIdle(EnNiw* this) { @@ -363,7 +363,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) { f32 posZ2; f32 posX1 = randPlusMinusPoint5Scaled(100.0f); f32 posZ1 = randPlusMinusPoint5Scaled(100.0f); - s16 nextAnimation; + s16 nextAnimIndex; if (this->niwType == NIW_TYPE_REGULAR) { if (Actor_HasParent(&this->actor, play)) { // picked up @@ -382,7 +382,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) { this->unkIdleTimer2 = 10; } - nextAnimation = NIW_ANIMATION_STILL; // probably a scoped variable here, where their scope was different + nextAnimIndex = NIW_ANIM_STILL; // probably a scoped variable here, where their scope was different if (this->unkIdleTimer2 != 0) { if (Rand_ZeroFloat(3.99f) < 1.0f) { this->headRotationToggle++; @@ -423,7 +423,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) { if (this->unkIdleTimer != 0) { Math_ApproachZeroF(&this->targetLimbRots[9], 0.5f, 4000.0f); // head rot - nextAnimation = NIW_ANIMATION_HEAD_PECKING; + nextAnimIndex = NIW_ANIM_HEAD_PECKING; Math_ApproachF(&this->actor.world.pos.x, this->unk2B0.x, 1.0f, this->unk300); Math_ApproachF(&this->actor.world.pos.z, this->unk2B0.z, 1.0f, this->unk300); Math_ApproachF(&this->unk300, 3.0f, 1.0f, 0.3f); @@ -447,7 +447,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) { Math_ApproachF(&this->unk304, 10000.0f, 1.0f, 1000.0f); } - EnNiw_AnimateWingHead(this, play, nextAnimation); + EnNiw_AnimateWingHead(this, play, nextAnimIndex); } void EnNiw_Held(EnNiw* this, PlayState* play) { @@ -489,7 +489,7 @@ void EnNiw_Held(EnNiw* this, PlayState* play) { this->actionFunc = EnNiw_Thrown; } - EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING); + EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING); } void EnNiw_Thrown(EnNiw* this, PlayState* play) { @@ -531,7 +531,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) { if (this->hoppingTimer > 5) { Actor_LiftActor(&this->actor, play); } - EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING); + EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING); } } @@ -585,7 +585,7 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) { } } - EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING); + EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING); } void EnNiw_Trigger(EnNiw* this, PlayState* play) { @@ -597,7 +597,7 @@ void EnNiw_Trigger(EnNiw* this, PlayState* play) { } this->cuccoStormTimer = 10; - this->niwState = this->nextAnimation = state; // NIW_ANIMATION_HEAD_PECKING + this->niwState = this->nextAnimIndex = state; // NIW_ANIM_HEAD_PECKING this->actionFunc = EnNiw_Upset; } @@ -607,12 +607,12 @@ void EnNiw_Upset(EnNiw* this, PlayState* play) { if (this->cuccoStormTimer == 0) { this->cuccoStormTimer = 60; this->unkTimer24C = 10; - this->nextAnimation = NIW_ANIMATION_FREEZE; + this->nextAnimIndex = NIW_ANIM_FREEZE; this->niwState = NIW_STATE_ANGRY2; this->actionFunc = EnNiw_SetupCuccoStorm; } - EnNiw_AnimateWingHead(this, play, this->nextAnimation); + EnNiw_AnimateWingHead(this, play, this->nextAnimIndex); } // the long crow with head back before they descend @@ -640,7 +640,7 @@ void EnNiw_SetupCuccoStorm(EnNiw* this, PlayState* play) { this->actionFunc = EnNiw_CuccoStorm; } - EnNiw_AnimateWingHead(this, play, this->nextAnimation); + EnNiw_AnimateWingHead(this, play, this->nextAnimIndex); } void EnNiw_CuccoStorm(EnNiw* this, PlayState* play) { @@ -697,7 +697,7 @@ void EnNiw_RunAway(EnNiw* this, PlayState* play) { } this->yawTowardsPlayer = Math_Atan2S(dX, dZ); EnNiw_UpdateRunning(this, play, false); - EnNiw_AnimateWingHead(this, play, NIW_ANIMATION_PECKING_AND_WAVING); + EnNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING); } } @@ -877,7 +877,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { this->headRotY = 0.0f; // clang-format off - this->isStormActive = this->unusedCounter28C = this->unk292 = this->unk29E = this->unk298 = this->isRunningRight = this->nextAnimation = 0; + this->isStormActive = this->unusedCounter28C = this->unk292 = this->unk29E = this->unk298 = this->isRunningRight = this->nextAnimIndex = 0; // clang-format on for (i = 0; i < 10; i++) { diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.h b/src/overlays/actors/ovl_En_Niw/z_en_niw.h index 2be60884e7..c1cec3b88b 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.h +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.h @@ -61,7 +61,7 @@ typedef struct EnNiw { /* 0x296 */ s16 unkToggle296; /* 0x298 */ s16 unk298; /* 0x29C */ s16 isRunningRight; // toggle (direction cucco is turning while running) - /* 0x29C */ u16 nextAnimation; + /* 0x29C */ u16 nextAnimIndex; /* 0x29E */ s16 unk29E; // three states 0/1/2 /* 0x2A0 */ s16 isStormActive; // we have a data value shared between all cucco, this shouldn't need to exist /* 0x2A2 */ s16 niwType; @@ -100,13 +100,12 @@ typedef struct EnNiw { // the attacking cuccos are not here, they are a different actor: [ ovl_En_Attack_Niw ] typedef enum { - /* 0 */ NIW_ANIMATION_STILL, - /* 1 */ NIW_ANIMATION_HEAD_PECKING, // forward and backward, feeding - /* 2 */ NIW_ANIMATION_PECKING_AND_WAVING, // wings move along their axis, like human hand waving - /* 3 */ NIW_ANIMATION_PECKING_AND_FORFLAPPING, // (unused) low (yaw based) flapping, forward and back - /* 4 */ NIW_ANIMATION_FREEZE, // used during Cucco Storm - /* 5 */ NIW_ANIMATION_PECKING_SLOW_FORFLAPPING, // wing speed half that of 3 - + /* 0 */ NIW_ANIM_STILL, + /* 1 */ NIW_ANIM_HEAD_PECKING, // forward and backward, feeding + /* 2 */ NIW_ANIM_PECKING_AND_WAVING, // wings move along their axis, like human hand waving + /* 3 */ NIW_ANIM_PECKING_AND_FORFLAPPING, // (unused) low (yaw based) flapping, forward and back + /* 4 */ NIW_ANIM_FREEZE, // used during Cucco Storm + /* 5 */ NIW_ANIM_PECKING_SLOW_FORFLAPPING, // wing speed half that of 3 } EnNiwHeadAndWingAnimationState; diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.c b/src/overlays/actors/ovl_En_Osn/z_en_osn.c index 89486da6f3..b2fee9d8d4 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.c +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.c @@ -28,7 +28,7 @@ const ActorInit En_Osn_InitVars = { (ActorFunc)EnOsn_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_osn_Anim_0201BC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, { &object_osn_Anim_002F74, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, { &object_osn_Anim_0037C4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, @@ -179,27 +179,27 @@ s32 func_80AD08B0(PlayState* play) { void func_80AD0998(EnOsn* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation); if (this->unk_1EC == 0x12 && curFrame == lastFrame) { this->unk_1EC = 0x13; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0x13); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0x13); } } void func_80AD0A24(EnOsn* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation); if (this->unk_1EC == 0x15 && curFrame == lastFrame) { this->unk_1EC = 0x16; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0x16); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0x16); } } void func_80AD0AB0(EnOsn* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation); if (curFrame == lastFrame) { this->unk_1FA -= 8; @@ -608,7 +608,7 @@ void func_80AD144C(EnOsn* this, PlayState* play) { u32 sp1C = Flags_GetSwitch(play, 0); this->cutscene = this->actor.cutscene; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); if (sp1C == 0) { this->actionFunc = func_80AD16A8; } else { @@ -728,7 +728,7 @@ void func_80AD16A8(EnOsn* this, PlayState* play) { this->unk_1EC = 0; break; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC); } if ((this->unk_1EC == 5) && (play->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 0xB) && @@ -814,13 +814,13 @@ void EnOsn_Init(Actor* thisx, PlayState* play) { case 1: this->unk_1EC = 0xF; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC); this->actionFunc = EnOsn_Idle; break; case 2: this->unk_1EC = 0x10; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC); this->actionFunc = EnOsn_Idle; break; diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 8e747abe2b..88a25ddb94 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -60,36 +60,36 @@ typedef enum { } EnOssanCutsceneState; typedef enum { - /* 00 */ FSN_ANIMATION_IDLE, - /* 01 */ FSN_ANIMATION_SCRATCH_BACK, - /* 02 */ FSN_ANIMATION_TURN_AROUND_FORWARD, - /* 03 */ FSN_ANIMATION_TURN_AROUND_REVERSE, - /* 04 */ FSN_ANIMATION_HANDS_ON_COUNTER_START, - /* 05 */ FSN_ANIMATION_HANDS_ON_COUNTER_LOOP, - /* 06 */ FSN_ANIMATION_HAND_ON_FACE_START, - /* 07 */ FSN_ANIMATION_HAND_ON_FACE_LOOP, - /* 08 */ FSN_ANIMATION_LEAN_FORWARD_START, - /* 09 */ FSN_ANIMATION_LEAN_FORWARD_LOOP, - /* 10 */ FSN_ANIMATION_SLAM_COUNTER_START, - /* 11 */ FSN_ANIMATION_SLAM_COUNTER_LOOP, - /* 12 */ FSN_ANIMATION_MAKE_OFFER, - /* 13 */ FSN_ANIMATION_MAX + /* 0 */ FSN_ANIM_IDLE, + /* 1 */ FSN_ANIM_SCRATCH_BACK, + /* 2 */ FSN_ANIM_TURN_AROUND_FORWARD, + /* 3 */ FSN_ANIM_TURN_AROUND_REVERSE, + /* 4 */ FSN_ANIM_HANDS_ON_COUNTER_START, + /* 5 */ FSN_ANIM_HANDS_ON_COUNTER_LOOP, + /* 6 */ FSN_ANIM_HAND_ON_FACE_START, + /* 7 */ FSN_ANIM_HAND_ON_FACE_LOOP, + /* 8 */ FSN_ANIM_LEAN_FORWARD_START, + /* 9 */ FSN_ANIM_LEAN_FORWARD_LOOP, + /* 10 */ FSN_ANIM_SLAM_COUNTER_START, + /* 11 */ FSN_ANIM_SLAM_COUNTER_LOOP, + /* 12 */ FSN_ANIM_MAKE_OFFER, + /* 13 */ FSN_ANIM_MAX } FsnAnimation; typedef enum { - /* 00 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_1, - /* 01 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_2, - /* 02 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_1, - /* 03 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_REVERSE, - /* 04 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_2, - /* 05 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_3, - /* 06 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_3, - /* 07 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_4, - /* 08 */ ANI_ANIMATION_APOLOGY_START, - /* 09 */ ANI_ANIMATION_APOLOGY_LOOP, - /* 10 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_4, - /* 11 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_5, - /* 12 */ ANI_ANIMATION_MAX + /* 0 */ ANI_ANIM_STANDING_NORMAL_LOOP_1, + /* 1 */ ANI_ANIM_STANDING_NORMAL_LOOP_2, + /* 2 */ ANI_ANIM_STANDING_NORMAL_ONCE_FORWARD_1, + /* 3 */ ANI_ANIM_STANDING_NORMAL_ONCE_REVERSE, + /* 4 */ ANI_ANIM_STANDING_NORMAL_ONCE_FORWARD_2, + /* 5 */ ANI_ANIM_STANDING_NORMAL_LOOP_3, + /* 6 */ ANI_ANIM_STANDING_NORMAL_ONCE_FORWARD_3, + /* 7 */ ANI_ANIM_STANDING_NORMAL_LOOP_4, + /* 8 */ ANI_ANIM_APOLOGY_START, + /* 9 */ ANI_ANIM_APOLOGY_LOOP, + /* 10 */ ANI_ANIM_STANDING_NORMAL_ONCE_FORWARD_4, + /* 11 */ ANI_ANIM_STANDING_NORMAL_LOOP_5, + /* 12 */ ANI_ANIM_MAX } AniAnimation; const ActorInit En_Ossan_InitVars = { @@ -104,7 +104,7 @@ const ActorInit En_Ossan_InitVars = { (ActorFunc)NULL, }; -static AnimationInfoS sCuriosityShopManAnimations[] = { +static AnimationInfoS sCuriosityShopManAnimationInfo[] = { { &gFsnIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gFsnScratchBackAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gFsnTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -120,7 +120,7 @@ static AnimationInfoS sCuriosityShopManAnimations[] = { { &gFsnMakeOfferAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; -static AnimationInfoS sPartTimerAnimations[] = { +static AnimationInfoS sPartTimerAnimationInfo[] = { { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -137,7 +137,7 @@ static AnimationInfoS sPartTimerAnimations[] = { static s16 sObjectIds[] = { OBJECT_FSN, OBJECT_ANI }; -static AnimationInfoS* sAnimations[] = { sCuriosityShopManAnimations, sPartTimerAnimations }; +static AnimationInfoS* sAnimationInfo[] = { sCuriosityShopManAnimationInfo, sPartTimerAnimationInfo }; static f32 sActorScales[] = { 0.01f, 0.01f }; @@ -389,11 +389,11 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) { } void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) { - AnimationInfoS* animations = sAnimations[this->actor.params]; + AnimationInfoS* animationInfo = sAnimationInfo[this->actor.params]; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(animations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(animationInfo[this->animIndex].animation); - if (this->animationIndex == FSN_ANIMATION_TURN_AROUND_REVERSE) { + if (this->animIndex == FSN_ANIM_TURN_AROUND_REVERSE) { frameCount = 0; } if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_WAITING) { @@ -406,40 +406,40 @@ void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) { } if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) { if (curFrame == frameCount) { - switch (this->animationIndex) { - case FSN_ANIMATION_SCRATCH_BACK: - this->animationIndex = FSN_ANIMATION_TURN_AROUND_FORWARD; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_TURN_AROUND_FORWARD); + switch (this->animIndex) { + case FSN_ANIM_SCRATCH_BACK: + this->animIndex = FSN_ANIM_TURN_AROUND_FORWARD; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_TURN_AROUND_FORWARD); break; - case FSN_ANIMATION_TURN_AROUND_FORWARD: + case FSN_ANIM_TURN_AROUND_FORWARD: EnOssan_SetHaveMet(this); this->textId = EnOssan_CuriosityShopMan_GetWelcome(this, play); - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, this->animIndex); break; - case FSN_ANIMATION_HANDS_ON_COUNTER_START: - case FSN_ANIMATION_HAND_ON_FACE_START: - case FSN_ANIMATION_LEAN_FORWARD_START: - case FSN_ANIMATION_SLAM_COUNTER_START: - this->animationIndex++; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIndex); + case FSN_ANIM_HANDS_ON_COUNTER_START: + case FSN_ANIM_HAND_ON_FACE_START: + case FSN_ANIM_LEAN_FORWARD_START: + case FSN_ANIM_SLAM_COUNTER_START: + this->animIndex++; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, this->animIndex); Message_StartTextbox(play, this->textId, &this->actor); EnOssan_SetupStartShopping(play, this, false); break; - case FSN_ANIMATION_HANDS_ON_COUNTER_LOOP: - case FSN_ANIMATION_HAND_ON_FACE_LOOP: - case FSN_ANIMATION_LEAN_FORWARD_LOOP: - case FSN_ANIMATION_SLAM_COUNTER_LOOP: - this->animationIndex = FSN_ANIMATION_TURN_AROUND_REVERSE; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_TURN_AROUND_REVERSE); + case FSN_ANIM_HANDS_ON_COUNTER_LOOP: + case FSN_ANIM_HAND_ON_FACE_LOOP: + case FSN_ANIM_LEAN_FORWARD_LOOP: + case FSN_ANIM_SLAM_COUNTER_LOOP: + this->animIndex = FSN_ANIM_TURN_AROUND_REVERSE; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_TURN_AROUND_REVERSE); break; - case FSN_ANIMATION_TURN_AROUND_REVERSE: - this->animationIndex = FSN_ANIMATION_SCRATCH_BACK; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_SCRATCH_BACK); + case FSN_ANIM_TURN_AROUND_REVERSE: + this->animIndex = FSN_ANIM_SCRATCH_BACK; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_SCRATCH_BACK); EnOssan_SetupAction(this, EnOssan_Idle); break; default: - this->animationIndex = FSN_ANIMATION_SCRATCH_BACK; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_SCRATCH_BACK); + this->animIndex = FSN_ANIM_SCRATCH_BACK; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_SCRATCH_BACK); EnOssan_SetupAction(this, EnOssan_Idle); break; } @@ -557,16 +557,16 @@ u8 EnOssan_CursorLeft(EnOssan* this, u8 cursorIdx, u8 shelfSlotMax) { } void EnOssan_Hello(EnOssan* this, PlayState* play) { - AnimationInfoS* animations = sAnimations[this->actor.params]; + AnimationInfoS* animationInfo = sAnimationInfo[this->actor.params]; u8 talkState = Message_GetState(&play->msgCtx); s32 pad; Player* player = GET_PLAYER(play); EnOssan_RotateHead(this, play); if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { - if ((this->animationIndex == ANI_ANIMATION_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) { - this->animationIndex = ANI_ANIMATION_STANDING_NORMAL_LOOP_2; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); + if ((this->animIndex == ANI_ANIM_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) { + this->animIndex = ANI_ANIM_STANDING_NORMAL_LOOP_2; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, 1); } this->flags &= ~LOOKED_AT_PLAYER; if (player->transformation == PLAYER_FORM_DEKU) { @@ -582,24 +582,24 @@ void EnOssan_Hello(EnOssan* this, PlayState* play) { } if ((talkState == TEXT_STATE_10) && (this->actor.params == ENOSSAN_PART_TIME_WORKER) && (player->transformation == PLAYER_FORM_ZORA) && Message_ShouldAdvance(play)) { - this->animationIndex = ANI_ANIMATION_APOLOGY_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, ANI_ANIMATION_APOLOGY_LOOP); + this->animIndex = ANI_ANIM_APOLOGY_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, ANI_ANIM_APOLOGY_LOOP); } - if ((this->animationIndex == FSN_ANIMATION_SLAM_COUNTER_LOOP) && Animation_OnFrame(&this->skelAnime, 18.0f)) { + if ((this->animIndex == FSN_ANIM_SLAM_COUNTER_LOOP) && Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); } } s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, PlayState* play) { - AnimationInfoS* animations = sAnimations[this->actor.params]; + AnimationInfoS* animationInfo = sAnimationInfo[this->actor.params]; Player* player = GET_PLAYER(play); switch (play->msgCtx.choiceIndex) { case 0: func_8019F208(); if ((this->actor.params == ENOSSAN_PART_TIME_WORKER) && (player->transformation == PLAYER_FORM_ZORA)) { - this->animationIndex = ANI_ANIMATION_APOLOGY_LOOP; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 9); + this->animIndex = ANI_ANIM_APOLOGY_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, 9); } EnOssan_SetupAction(this, EnOssan_TalkToShopkeeper); func_80151938(play, sTalkOptionTextIds[this->actor.params]); @@ -663,12 +663,12 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) { } void EnOssan_TalkToShopkeeper(EnOssan* this, PlayState* play) { - AnimationInfoS* animations = sAnimations[this->actor.params]; + AnimationInfoS* animationInfo = sAnimationInfo[this->actor.params]; if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { - if ((this->animationIndex == ANI_ANIMATION_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) { - this->animationIndex = ANI_ANIMATION_STANDING_NORMAL_LOOP_2; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); + if ((this->animIndex == ANI_ANIM_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) { + this->animIndex = ANI_ANIM_STANDING_NORMAL_LOOP_2; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, 1); } EnOssan_StartShopping(play, this); } @@ -1379,31 +1379,31 @@ u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play) { u16 textId = Text_GetFaceReaction(play, 0x2F); if (textId != 0) { - this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_START; + this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_START; this->flags |= END_INTERACTION; return textId; } switch (player->transformation) { case PLAYER_FORM_DEKU: - this->animationIndex = FSN_ANIMATION_SLAM_COUNTER_START; + this->animIndex = FSN_ANIM_SLAM_COUNTER_START; if (gSaveContext.save.weekEventReg[18] & 0x10) { return sWelcomeDekuTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } return sWelcomeDekuFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; case PLAYER_FORM_ZORA: - this->animationIndex = FSN_ANIMATION_LEAN_FORWARD_START; + this->animIndex = FSN_ANIM_LEAN_FORWARD_START; if (gSaveContext.save.weekEventReg[18] & 8) { return sWelcomeZoraTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } return sWelcomeZoraFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; case PLAYER_FORM_GORON: - this->animationIndex = FSN_ANIMATION_HAND_ON_FACE_START; + this->animIndex = FSN_ANIM_HAND_ON_FACE_START; if (gSaveContext.save.weekEventReg[18] & 4) { return sWelcomeGoronTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } return sWelcomeGoronFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } - this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_START; + this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_START; return sWelcomeHumanTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } @@ -1526,8 +1526,8 @@ void EnOssan_InitShop(EnOssan* this, PlayState* play) { this->shopItemSelectedTween = 0.0f; Actor_SetScale(&this->actor, sActorScales[this->actor.params]); - this->animationIndex = 1; // FSN_ANIMATION_SCRATCH_BACK and ANI_ANIMATION_STANDING_NORMAL_LOOP_2 - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations[this->actor.params], 1); + this->animIndex = 1; // FSN_ANIM_SCRATCH_BACK and ANI_ANIM_STANDING_NORMAL_LOOP_2 + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo[this->actor.params], 1); EnOssan_SpawnShopItems(this, play, shopItems); this->blinkTimer = 20; this->eyeTexIndex = 0; diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 32c6fc2889..539906ea85 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -56,7 +56,7 @@ typedef struct EnOssan { /* 0x2F8 */ s16 limbRotTableZ[19]; /* 0x31E */ Vec3s jointTable[ENOSSAN_LIMB_MAX]; /* 0x390 */ Vec3s morphTable[ENOSSAN_LIMB_MAX]; - /* 0x402 */ s16 animationIndex; + /* 0x402 */ s16 animIndex; /* 0x404 */ Vec3s partTimerHeadRot; /* 0x40A */ u16 flags; } EnOssan; // size = 0x40C diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index ad10226edc..8c2465585c 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -163,7 +163,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.gravity = 0.0f; SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex); this->skelAnime.curFrame = Rand_ZeroOne() * this->skelAnime.endFrame; this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); this->unk_744.r = 255; @@ -300,7 +300,7 @@ void func_80B5BB38(Color_RGB8* arg0, Color_RGB8* arg1, f32 arg2) { } void func_80B5BDA8(EnOt* this, PlayState* play) { - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex); SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); this->actionFunc = func_80B5BE04; } @@ -322,7 +322,7 @@ void func_80B5BE04(EnOt* this, PlayState* play) { } void func_80B5BE88(EnOt* this, PlayState* play) { - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex); this->actionFunc = func_80B5BED4; } @@ -337,7 +337,7 @@ void func_80B5BED4(EnOt* this, PlayState* play) { void func_80B5BF60(EnOt* this, PlayState* play) { this->unk_32C |= 0x40; - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex); this->actionFunc = func_80B5BFB8; } @@ -410,8 +410,8 @@ void func_80B5C25C(EnOt* this, PlayState* play) { if ((this->unk_33C == 2) && (this->unk_32C & 0x80) && (this->unk_360->unk_32C & 0x80)) { this->unk_32C |= 0x100; this->unk_360->unk_32C |= 0x100; - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 2, &this->animIdx); - SubS_ChangeAnimationBySpeedInfo(&this->unk_360->skelAnime, sAnimations, 2, &this->unk_360->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 2, &this->animIndex); + SubS_ChangeAnimationBySpeedInfo(&this->unk_360->skelAnime, sAnimations, 2, &this->unk_360->animIndex); this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); this->unk_360->actor.flags |= ACTOR_FLAG_8000000; @@ -489,7 +489,7 @@ void func_80B5C64C(EnOt* this, PlayState* play) { void func_80B5C684(EnOt* this, PlayState* play) { this->actor.speedXZ = 0.0f; - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex); this->actionFunc = func_80B5C6DC; } @@ -635,7 +635,7 @@ void func_80B5CCA0(EnOt* this, PlayState* play) { } void func_80B5CCF4(EnOt* this, PlayState* play) { - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex); this->actionFunc = func_80B5CD40; } @@ -676,7 +676,7 @@ void func_80B5CD40(EnOt* this, PlayState* play) { void func_80B5CE6C(EnOt* this, PlayState* play) { this->unk_384 = 0; this->unk_32C |= 0x20; - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex); this->actionFunc = func_80B5CEC8; } @@ -731,7 +731,7 @@ void func_80B5CEC8(EnOt* this, PlayState* play) { } void func_80B5D114(EnOt* this, PlayState* play) { - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex); this->actionFunc = func_80B5D160; } @@ -886,7 +886,7 @@ void func_80B5D648(EnOt* this, PlayState* play) { this->actorPath.pointOffset.z = 0.0f; this->actor.gravity = 0.0f; this->actor.speedXZ = 0.0f; - SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex); this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); Flags_SetSwitch(play, ENOT_GET_3F80(&this->actor)); @@ -929,7 +929,7 @@ void EnOt_Update(Actor* thisx, PlayState* play) { s32 pad; EnOt* this = THIS; - if ((this->animIdx == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + if ((this->animIndex == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SEAHORSE_SWIM); } diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.h b/src/overlays/actors/ovl_En_Ot/z_en_ot.h index e123b88716..5399e22786 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.h +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.h @@ -35,7 +35,7 @@ typedef struct EnOt { /* 0x18C */ ColliderCylinder collider; /* 0x1D8 */ Vec3s jointTable[19]; /* 0x24A */ Vec3s morphTable[19]; - /* 0x2BC */ s32 animIdx; + /* 0x2BC */ s32 animIndex; /* 0x2C0 */ ActorPathing actorPath; /* 0x32C */ u16 unk_32C; /* 0x330 */ Vec3f unk_330; diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c index 5223092543..075ced5401 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -105,7 +105,7 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, MASS_IMMOVABLE, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_pamera_Anim_0005BC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_pamera_Anim_008AE0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_pamera_Anim_008E38, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, @@ -234,7 +234,7 @@ void EnPamera_Destroy(Actor* thisx, PlayState* play) { void func_80BD8700(EnPamera* this) { this->hideInisdeTimer = 0; this->actor.flags &= ~ACTOR_FLAG_1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80BD8758; } @@ -245,7 +245,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) { Camera_SetToTrackActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(this->cutscenes[0])), &this->actor); this->actor.speedXZ = 1.5f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; func_80BD9338(this, play); @@ -254,7 +254,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscenes[0]); } else { this->actor.speedXZ = 1.5f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; func_80BD9338(this, play); @@ -276,7 +276,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) { void func_80BD8908(EnPamera* this) { this->actor.draw = EnPamera_Draw; this->actor.flags |= ACTOR_FLAG_1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80BD8964; } @@ -289,14 +289,14 @@ void func_80BD8964(EnPamera* this, PlayState* play) { if (Math_Vec3f_StepTo(&this->actor.world.pos, &vec, 1.0f) < 5.0f) { this->actor.speedXZ = 1.5f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); gSaveContext.save.weekEventReg[59] |= 1; func_80BD8B50(this); } } void func_80BD8A38(EnPamera* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80BD8A7C; } @@ -343,14 +343,14 @@ void func_80BD8B70(EnPamera* this, PlayState* play) { void func_80BD8CCC(EnPamera* this) { this->hideInisdeTimer = 0; this->actor.speedXZ = 0.0f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->actionFunc = func_80BD8D1C; } void func_80BD8D1C(EnPamera* this, PlayState* play) { if (this->hideInisdeTimer++ > 200) { this->actor.speedXZ = 1.5f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); func_80BD8D80(this); } } @@ -386,14 +386,14 @@ void func_80BD8DB0(EnPamera* this, PlayState* play) { void EnPamera_LookDownWell(EnPamera* this) { func_80BD93CC(this, 1, 1); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->actionFunc = func_80BD8F60; } void func_80BD8F60(EnPamera* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x3000, 0x1000); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actor.speedXZ = 3.0f; func_80BD93CC(this, 0, 0); func_80BD8D80(this); @@ -410,7 +410,7 @@ void func_80BD8FF0(EnPamera* this) { pameraYaw = Math_Vec3f_Yaw(&pameraPos, &this->actor.world.pos); this->actor.shape.rot.y = pameraYaw; this->actor.world.rot.y = pameraYaw; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->actionFunc = func_80BD909C; } @@ -749,7 +749,7 @@ void func_80BD9E78(EnPamera* this, PlayState* play) { } void func_80BD9E88(EnPamera* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->unk_31E = 0; this->setupFunc = func_80BD9ED0; } @@ -758,7 +758,7 @@ void func_80BD9ED0(EnPamera* this, PlayState* play) { } void func_80BD9EE0(EnPamera* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); func_80BD93CC(this, 1, 0); this->unk_31E = 1; this->setupFunc = func_80BD9F3C; @@ -775,14 +775,14 @@ void func_80BD9F3C(EnPamera* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); } } } void func_80BDA038(EnPamera* this) { func_80BD93CC(this, 0, 1); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7); this->unk_31E = 0; this->setupFunc = func_80BDA090; } @@ -792,7 +792,7 @@ void func_80BDA090(EnPamera* this, PlayState* play) { void func_80BDA0A0(EnPamera* this) { func_80BD93CC(this, 0, 1); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); this->unk_31E = 1; this->setupFunc = func_80BDA0FC; } @@ -802,7 +802,7 @@ void func_80BDA0FC(EnPamera* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); } } } @@ -810,7 +810,7 @@ void func_80BDA0FC(EnPamera* this, PlayState* play) { void func_80BDA170(EnPamera* this) { this->unk_31E = 1; func_80BD93CC(this, 0, 1); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); this->setupFunc = func_80BDA1C8; } @@ -823,7 +823,7 @@ void func_80BDA1C8(EnPamera* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 10); } } } @@ -831,7 +831,7 @@ void func_80BDA1C8(EnPamera* this, PlayState* play) { void func_80BDA288(EnPamera* this) { this->unk_31E = 1; func_80BD93CC(this, 0, 0); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); this->setupFunc = func_80BDA2E0; } @@ -839,7 +839,7 @@ void func_80BDA2E0(EnPamera* this, PlayState* play) { if (this->unk_31E == 1) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12); } } } diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index e1eadb5cfa..863aec4ac5 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -526,7 +526,7 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_mm_Anim_002238, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_mm_Anim_002238, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_mm_Anim_00A4E0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -718,7 +718,7 @@ s32 func_80AF7E98(EnPm* this, s32 arg1) { if (phi_v1) { this->unk_384 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); this->unk_35C = this->skelAnime.playSpeed; } diff --git a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c index 529ac9f4e3..66b2a0a1ed 100644 --- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c +++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c @@ -204,26 +204,26 @@ static DamageTable sDamageTable = { }; typedef enum { - /* 0 */ RACEDOG_ANIMATION_IDLE, - /* 1 */ RACEDOG_ANIMATION_WALK_1, // unused - /* 2 */ RACEDOG_ANIMATION_RUN, - /* 3 */ RACEDOG_ANIMATION_BARK, // unused - /* 4 */ RACEDOG_ANIMATION_SIT_DOWN_ONCE, // unused - /* 5 */ RACEDOG_ANIMATION_SIT_DOWN, // unused - /* 6 */ RACEDOG_ANIMATION_LYING_DOWN_START_1, // unused - /* 7 */ RACEDOG_ANIMATION_LYING_DOWN_LOOP, // unused - /* 8 */ RACEDOG_ANIMATION_LYING_DOWN_START_2, // unused - /* 9 */ RACEDOG_ANIMATION_LYING_DOWN_START_3, // unused - /* 10 */ RACEDOG_ANIMATION_LYING_DOWN_START_4, // unused - /* 11 */ RACEDOG_ANIMATION_WALK_BACKWARDS, // unused - /* 12 */ RACEDOG_ANIMATION_JUMP, - /* 13 */ RACEDOG_ANIMATION_LONG_JUMP, // unused - /* 14 */ RACEDOG_ANIMATION_JUMP_ATTACK, // unused - /* 15 */ RACEDOG_ANIMATION_SWIM, // unused - /* 16 */ RACEDOG_ANIMATION_MAX -} RacedogAnimationIndex; + /* 0 */ RACEDOG_ANIM_IDLE, + /* 1 */ RACEDOG_ANIM_WALK_1, // unused + /* 2 */ RACEDOG_ANIM_RUN, + /* 3 */ RACEDOG_ANIM_BARK, // unused + /* 4 */ RACEDOG_ANIM_SIT_DOWN_ONCE, // unused + /* 5 */ RACEDOG_ANIM_SIT_DOWN, // unused + /* 6 */ RACEDOG_ANIM_LYING_DOWN_START_1, // unused + /* 7 */ RACEDOG_ANIM_LYING_DOWN_LOOP, // unused + /* 8 */ RACEDOG_ANIM_LYING_DOWN_START_2, // unused + /* 9 */ RACEDOG_ANIM_LYING_DOWN_START_3, // unused + /* 10 */ RACEDOG_ANIM_LYING_DOWN_START_4, // unused + /* 11 */ RACEDOG_ANIM_WALK_BACKWARDS, // unused + /* 12 */ RACEDOG_ANIM_JUMP, + /* 13 */ RACEDOG_ANIM_LONG_JUMP, // unused + /* 14 */ RACEDOG_ANIM_JUMP_ATTACK, // unused + /* 15 */ RACEDOG_ANIM_SWIM, // unused + /* 16 */ RACEDOG_ANIM_MAX +} RacedogAnimation; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gDogWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gDogWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -6 }, { &gDogRunAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gDogBarkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -6 }, { &gDogSitAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -6 }, { &gDogSitAnim, 1.0f, 0, -1, ANIMMODE_LOOP_PARTIAL, -6 }, @@ -238,10 +238,10 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_STOP), }; -void EnRacedog_ChangeAnimation(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 index) { +void EnRacedog_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex) { f32 frameCount; - animationInfo += index; + animationInfo += animIndex; if (animationInfo->frameCount < 0) { frameCount = Animation_GetLastFrame(animationInfo->animation); } else { @@ -354,8 +354,8 @@ void EnRacedog_Init(Actor* thisx, PlayState* play) { sSelectedDogInfo = sDogInfo[(s16)((gSaveContext.eventInf[0] & 0xF8) >> 3)]; this->selectedDogIndex = sSelectedDogInfo.index; - EnRacedog_ChangeAnimation(&this->skelAnime, sAnimations, RACEDOG_ANIMATION_IDLE); - sAnimations[RACEDOG_ANIMATION_IDLE].playSpeed = Rand_ZeroFloat(0.5f) + 1.0f; + EnRacedog_ChangeAnim(&this->skelAnime, sAnimationInfo, RACEDOG_ANIM_IDLE); + sAnimationInfo[RACEDOG_ANIM_IDLE].playSpeed = Rand_ZeroFloat(0.5f) + 1.0f; this->actionFunc = EnRacedog_RaceStart; } @@ -376,7 +376,7 @@ void EnRacedog_RaceStart(EnRacedog* this, PlayState* play) { play_sound(NA_SE_SY_START_SHOT); } - EnRacedog_ChangeAnimation(&this->skelAnime, sAnimations, RACEDOG_ANIMATION_RUN); + EnRacedog_ChangeAnim(&this->skelAnime, sAnimationInfo, RACEDOG_ANIM_RUN); this->actionFunc = EnRacedog_Race; } } @@ -601,9 +601,9 @@ void EnRacedog_CheckForFinish(EnRacedog* this) { */ void EnRacedog_UpdateRunAnimationPlaySpeed(EnRacedog* this) { if (this->actor.speedXZ < 3.0f) { - sAnimations[RACEDOG_ANIMATION_RUN].playSpeed = 0.9f; + sAnimationInfo[RACEDOG_ANIM_RUN].playSpeed = 0.9f; } else { - sAnimations[RACEDOG_ANIMATION_RUN].playSpeed = 1.0f; + sAnimationInfo[RACEDOG_ANIM_RUN].playSpeed = 1.0f; } } diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.c b/src/overlays/actors/ovl_En_Raf/z_en_raf.c index edd4079218..a3d91bba91 100644 --- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c +++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c @@ -35,13 +35,13 @@ void EnRaf_UpdateEffects(EnRaf* this, PlayState* play); void EnRaf_DrawEffects(EnRaf* this, PlayState* play); typedef enum { - /* 0 */ EN_RAF_ANIMATION_IDLE, - /* 1 */ EN_RAF_ANIMATION_CLOSE, - /* 2 */ EN_RAF_ANIMATION_CHEW, - /* 3 */ EN_RAF_ANIMATION_SPIT, - /* 4 */ EN_RAF_ANIMATION_CONVULSE, - /* 5 */ EN_RAF_ANIMATION_DEATH, -} EnRafAnimationIndex; + /* 0 */ EN_RAF_ANIM_IDLE, + /* 1 */ EN_RAF_ANIM_CLOSE, + /* 2 */ EN_RAF_ANIM_CHEW, + /* 3 */ EN_RAF_ANIM_SPIT, + /* 4 */ EN_RAF_ANIM_CONVULSE, + /* 5 */ EN_RAF_ANIM_DEATH, +} EnRafAnimation; typedef enum { /* 0 */ EN_RAF_ACTION_IDLE, @@ -260,7 +260,7 @@ void EnRaf_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void EnRaf_ChangeAnimation(EnRaf* this, s32 index) { +void EnRaf_ChangeAnim(EnRaf* this, s32 animIndex) { static AnimationHeader* sAnimations[] = { &gCarnivorousLilyPadSpitAnim, &gCarnivorousLilyPadCloseAnim, &gCarnivorousLilyPadChewAnim, &gCarnivorousLilyPadSpitAnim, &gCarnivorousLilyPadConvulseAnim, &gCarnivorousLilyPadDeathAnim, @@ -271,22 +271,22 @@ void EnRaf_ChangeAnimation(EnRaf* this, s32 index) { f32 startFrame = 0.0f; f32 playSpeed = 1.0f; - this->endFrame = Animation_GetLastFrame(sAnimations[index]); - if (index == EN_RAF_ANIMATION_IDLE) { + this->endFrame = Animation_GetLastFrame(sAnimations[animIndex]); + if (animIndex == EN_RAF_ANIM_IDLE) { startFrame = this->endFrame; - } else if (index == EN_RAF_ANIMATION_CLOSE) { + } else if (animIndex == EN_RAF_ANIM_CLOSE) { playSpeed = 2.0f; } - Animation_Change(&this->skelAnime, sAnimations[index], playSpeed, startFrame, this->endFrame, - sAnimationModes[index], -4.0f); + Animation_Change(&this->skelAnime, sAnimations[animIndex], playSpeed, startFrame, this->endFrame, + sAnimationModes[animIndex], -4.0f); } void EnRaf_SetupIdle(EnRaf* this) { Vec3f targetLimbScale = { 1.0f, 1.0f, 1.0f }; s32 i; - EnRaf_ChangeAnimation(this, EN_RAF_ANIMATION_IDLE); + EnRaf_ChangeAnim(this, EN_RAF_ANIM_IDLE); for (i = CARNIVOROUS_LILY_PAD_LIMB_TRAP_1_LOWER_SEGMENT; i <= CARNIVOROUS_LILY_PAD_LIMB_TRAP_3_UPPER_SEGMENT; i++) { Math_Vec3f_Copy(&this->targetLimbScale[i], &targetLimbScale); @@ -358,7 +358,7 @@ void EnRaf_Idle(EnRaf* this, PlayState* play) { } void EnRaf_SetupGrab(EnRaf* this) { - EnRaf_ChangeAnimation(this, EN_RAF_ANIMATION_CLOSE); + EnRaf_ChangeAnim(this, EN_RAF_ANIM_CLOSE); this->petalScaleType = EN_RAF_PETAL_SCALE_TYPE_GRAB; Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_SUISEN_DRINK); this->action = EN_RAF_ACTION_GRAB; @@ -387,7 +387,7 @@ void EnRaf_Grab(EnRaf* this, PlayState* play) { void EnRaf_SetupChew(EnRaf* this) { s32 i; - EnRaf_ChangeAnimation(this, EN_RAF_ANIMATION_CHEW); + EnRaf_ChangeAnim(this, EN_RAF_ANIM_CHEW); this->chewCount = 0; for (i = 0; i < ARRAY_COUNT(this->chewLimbRot); i++) { this->chewLimbRot[i].x = Rand_S16Offset(8, 8) << 8; @@ -461,7 +461,7 @@ void EnRaf_Chew(EnRaf* this, PlayState* play) { void EnRaf_SetupThrow(EnRaf* this, PlayState* play) { Player* player = GET_PLAYER(play); - EnRaf_ChangeAnimation(this, EN_RAF_ANIMATION_SPIT); + EnRaf_ChangeAnim(this, EN_RAF_ANIM_SPIT); player->actor.freezeTimer = 10; this->petalScaleType = EN_RAF_PETAL_SCALE_TYPE_IDLE_OR_THROW; this->action = EN_RAF_ACTION_THROW; @@ -557,7 +557,7 @@ void EnRaf_PostDetonation(EnRaf* this, PlayState* play) { } void EnRaf_SetupConvulse(EnRaf* this) { - EnRaf_ChangeAnimation(this, EN_RAF_ANIMATION_CONVULSE); + EnRaf_ChangeAnim(this, EN_RAF_ANIM_CONVULSE); this->chewCount = 0; this->action = EN_RAF_ACTION_CONVULSE; this->actionFunc = EnRaf_Convulse; @@ -584,7 +584,7 @@ void EnRaf_Convulse(EnRaf* this, PlayState* play) { } void EnRaf_SetupDissolve(EnRaf* this) { - EnRaf_ChangeAnimation(this, EN_RAF_ANIMATION_DEATH); + EnRaf_ChangeAnim(this, EN_RAF_ANIM_DEATH); this->action = EN_RAF_ACTION_DISSOLVE; this->dissolveTimer = 0; this->actionFunc = EnRaf_Dissolve; @@ -671,7 +671,7 @@ void EnRaf_Dormant(EnRaf* this, PlayState* play) { DECR(this->reviveTimer); if (this->reviveTimer == 0) { - EnRaf_ChangeAnimation(this, EN_RAF_ANIMATION_SPIT); + EnRaf_ChangeAnim(this, EN_RAF_ANIM_SPIT); for (i = CARNIVOROUS_LILY_PAD_LIMB_TRAP_1_LOWER_SEGMENT; i <= CARNIVOROUS_LILY_PAD_LIMB_TRAP_3_UPPER_SEGMENT; i++) { diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c index 1c87561481..095ee3feca 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c @@ -62,7 +62,7 @@ const ActorInit En_Rail_Skb_InitVars = { (ActorFunc)EnRailSkb_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f }, @@ -312,7 +312,7 @@ void EnRailSkb_Destroy(Actor* thisx, PlayState* play) { void func_80B70FA0(EnRailSkb* this) { this->unk_3F2 = 0; if (this->actionFunc != func_80B716A8) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); } this->actionFunc = func_80B70FF8; } @@ -356,7 +356,7 @@ void func_80B7114C(EnRailSkb* this, PlayState* play) { this->drawDmgEffAlpha = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_402 |= 1; func_80B712FC(this); @@ -380,7 +380,7 @@ void func_80B7123C(EnRailSkb* this, PlayState* play) { this->drawDmgEffAlpha = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_402 |= 1; func_80B712FC(this); @@ -406,7 +406,7 @@ void func_80B71314(EnRailSkb* this, PlayState* play) { void func_80B71354(EnRailSkb* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80B713A4; } @@ -415,7 +415,7 @@ void func_80B713A4(EnRailSkb* this, PlayState* play) { if ((this->actor.xzDistToPlayer > 65.0f) || (Player_GetMask(play) == PLAYER_MASK_CAPTAIN)) { func_80B70FA0(this); } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); } } @@ -456,7 +456,7 @@ void func_80B7151C(EnRailSkb* this) { this->actor.draw = EnRailSkb_Draw; this->actor.shape.shadowAlpha = 0; this->actor.shape.rot.y = this->actor.world.rot.y; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80B715AC; } @@ -479,7 +479,7 @@ void func_80B715AC(EnRailSkb* this, PlayState* play) { void func_80B71650(EnRailSkb* this) { this->unk_3FE = 0; if (this->actionFunc != func_80B70FF8) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); } this->actionFunc = func_80B716A8; } @@ -496,7 +496,7 @@ void func_80B716A8(EnRailSkb* this, PlayState* play) { Message_StartTextbox(play, 0x13F5, &this->actor); this->unk_400 = 0x13F5; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12); func_80B717C8(this); } else if ((this->actor.xzDistToPlayer < 100.0f) && !(this->collider.base.acFlags & AC_HIT)) { func_800B8614(&this->actor, play, 100.0f); @@ -558,7 +558,7 @@ void func_80B718C4(EnRailSkb* this, PlayState* play) { } void func_80B71910(EnRailSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80B71954; } @@ -576,7 +576,7 @@ void func_80B71954(EnRailSkb* this, PlayState* play) { void func_80B71A08(EnRailSkb* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80B71A58; } @@ -585,7 +585,7 @@ void func_80B71A58(EnRailSkb* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); if (this->unk_2E8 < this->unk_22C->dyna.actor.colChkInfo.health) { this->unk_22C->dyna.actor.colChkInfo.health--; } else { @@ -608,7 +608,7 @@ void func_80B71A58(EnRailSkb* this, PlayState* play) { void func_80B71B6C(EnRailSkb* this) { this->unk_3F2 = 10; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80B71BB8; } @@ -641,7 +641,7 @@ void func_80B71BB8(EnRailSkb* this, PlayState* play) { if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & 1)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); this->actor.velocity.y = 10.0f; for (i = 0; i < 4; i++) { @@ -674,7 +674,7 @@ void func_80B71DF0(EnRailSkb* this) { this->drawDmgEffTimer = 0; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); this->actionFunc = func_80B71EA8; } @@ -1000,7 +1000,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { this->drawDmgEffScale = 0.0f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->unk_402 |= 1; func_80B712FC(this); break; @@ -1026,7 +1026,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { this->drawDmgEffScale = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80B71228(this); break; @@ -1045,7 +1045,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { case 13: Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80B712FC(this); break; diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index 4eb7bb3a61..10bbf2f83a 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -50,27 +50,27 @@ void EnRailgibud_SinkIntoGround(EnRailgibud* this, PlayState* play); void EnRailgibud_Cutscene_Update(Actor* thisx, PlayState* play); typedef enum { - /* 0 */ EN_RAILGIBUD_ANIMATION_GRAB_ATTACK, - /* 1 */ EN_RAILGIBUD_ANIMATION_GRAB_END, - /* 2 */ EN_RAILGIBUD_ANIMATION_GRAB_START, - /* 3 */ EN_RAILGIBUD_ANIMATION_LOOK_BACK, - /* 4 */ EN_RAILGIBUD_ANIMATION_CROUCH_WIPING_TEARS, - /* 5 */ EN_RAILGIBUD_ANIMATION_CROUCH_CRYING, - /* 6 */ EN_RAILGIBUD_ANIMATION_DEATH, - /* 7 */ EN_RAILGIBUD_ANIMATION_DAMAGE, - /* 8 */ EN_RAILGIBUD_ANIMATION_CROUCH_END, - /* 9 */ EN_RAILGIBUD_ANIMATION_IDLE, - /* 10 */ EN_RAILGIBUD_ANIMATION_WALK, - /* 11 */ EN_RAILGIBUD_ANIMATION_DANCE_SQUAT, - /* 12 */ EN_RAILGIBUD_ANIMATION_DANCE_PIROUETTE, - /* 13 */ EN_RAILGIBUD_ANIMATION_DANCE_CLAP, - /* 14 */ EN_RAILGIBUD_ANIMATION_CROUCH_END_2, - /* 15 */ EN_RAILGIBUD_ANIMATION_SLUMP_START, - /* 16 */ EN_RAILGIBUD_ANIMATION_SLUMP_LOOP, - /* 17 */ EN_RAILGIBUD_ANIMATION_CONVULSION, - /* 18 */ EN_RAILGIBUD_ANIMATION_ARMS_UP_START, - /* 19 */ EN_RAILGIBUD_ANIMATION_ARMS_UP_LOOP, -} EnRailgibudAnimations; + /* 0 */ EN_RAILGIBUD_ANIM_GRAB_ATTACK, + /* 1 */ EN_RAILGIBUD_ANIM_GRAB_END, + /* 2 */ EN_RAILGIBUD_ANIM_GRAB_START, + /* 3 */ EN_RAILGIBUD_ANIM_LOOK_BACK, + /* 4 */ EN_RAILGIBUD_ANIM_CROUCH_WIPING_TEARS, + /* 5 */ EN_RAILGIBUD_ANIM_CROUCH_CRYING, + /* 6 */ EN_RAILGIBUD_ANIM_DEATH, + /* 7 */ EN_RAILGIBUD_ANIM_DAMAGE, + /* 8 */ EN_RAILGIBUD_ANIM_CROUCH_END, + /* 9 */ EN_RAILGIBUD_ANIM_IDLE, + /* 10 */ EN_RAILGIBUD_ANIM_WALK, + /* 11 */ EN_RAILGIBUD_ANIM_DANCE_SQUAT, + /* 12 */ EN_RAILGIBUD_ANIM_DANCE_PIROUETTE, + /* 13 */ EN_RAILGIBUD_ANIM_DANCE_CLAP, + /* 14 */ EN_RAILGIBUD_ANIM_CROUCH_END_2, + /* 15 */ EN_RAILGIBUD_ANIM_SLUMP_START, + /* 16 */ EN_RAILGIBUD_ANIM_SLUMP_LOOP, + /* 17 */ EN_RAILGIBUD_ANIM_CONVULSION, + /* 18 */ EN_RAILGIBUD_ANIM_ARMS_UP_START, + /* 19 */ EN_RAILGIBUD_ANIM_ARMS_UP_LOOP, +} EnRailgibudAnimation; typedef enum { /* 0 */ EN_RAILGIBUD_TYPE_GIBDO, @@ -95,7 +95,7 @@ const ActorInit En_Railgibud_InitVars = { (ActorFunc)EnRailgibud_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gGibdoRedeadGrabAttackAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 0.0f }, { &gGibdoRedeadGrabStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, @@ -286,7 +286,7 @@ void EnRailgibud_Destroy(Actor* thisx, PlayState* play) { void EnRailgibud_SetupWalkInCircles(EnRailgibud* this) { this->actor.speedXZ = 0.6f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_WALK); this->actionFunc = EnRailgibud_WalkInCircles; } @@ -336,7 +336,7 @@ void EnRailgibud_WalkInCircles(EnRailgibud* this, PlayState* play) { } void EnRailgibud_SetupAttemptPlayerFreeze(EnRailgibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_IDLE); this->actionFunc = EnRailgibud_AttemptPlayerFreeze; } @@ -357,7 +357,7 @@ void EnRailgibud_AttemptPlayerFreeze(EnRailgibud* this, PlayState* play) { } void EnRailgibud_SetupWalkToPlayer(EnRailgibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_WALK); this->actor.speedXZ = 0.4f; if (this->actionFunc == EnRailgibud_AttemptPlayerFreeze) { @@ -418,7 +418,7 @@ void EnRailgibud_WalkToPlayer(EnRailgibud* this, PlayState* play) { } void EnRailgibud_SetupGrab(EnRailgibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_GRAB_START); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_START); this->grabDamageTimer = 0; this->actor.flags &= ~ACTOR_FLAG_1; this->grabState = EN_RAILGIBUD_GRAB_START; @@ -436,9 +436,9 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { inPositionToAttack = EnRailgibud_MoveToIdealGrabPositionAndRotation(this, play); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (inPositionToAttack == true)) { this->grabState = EN_RAILGIBUD_GRAB_ATTACK; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_GRAB_ATTACK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_ATTACK); } else if (!(player->stateFlags2 & 0x80)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_GRAB_END); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_END); this->actor.flags |= ACTOR_FLAG_1; this->grabState = EN_RAILGIBUD_GRAB_RELEASE; this->grabDamageTimer = 0; @@ -468,7 +468,7 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { player->unk_AE8 = 100; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_GRAB_END); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_END); this->actor.flags |= ACTOR_FLAG_1; this->grabState = EN_RAILGIBUD_GRAB_RELEASE; this->grabDamageTimer = 0; @@ -488,7 +488,7 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { } void EnRailgibud_SetupGrabFail(EnRailgibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_DAMAGE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_DAMAGE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->actor.speedXZ = -2.0f; this->actionFunc = EnRailgibud_GrabFail; @@ -510,7 +510,7 @@ void EnRailgibud_GrabFail(EnRailgibud* this, PlayState* play) { void EnRailgibud_SetupTurnAwayAndShakeHead(EnRailgibud* this) { this->headShakeTimer = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_WALK); this->actionFunc = EnRailgibud_TurnAwayAndShakeHead; } @@ -528,7 +528,7 @@ void EnRailgibud_TurnAwayAndShakeHead(EnRailgibud* this, PlayState* play) { } void EnRailgibud_SetupWalkToHome(EnRailgibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_WALK); this->actor.speedXZ = 0.4f; this->actionFunc = EnRailgibud_WalkToHome; } @@ -561,7 +561,7 @@ void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) { } void EnRailgibud_SetupDamage(EnRailgibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_DAMAGE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_DAMAGE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->stunTimer = 0; this->grabWaitTimer = 0; @@ -618,7 +618,7 @@ void EnRailgibud_Stunned(EnRailgibud* this, PlayState* play) { } void EnRailgibud_SetupDead(EnRailgibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_DEATH); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_DEATH); this->actor.flags &= ~ACTOR_FLAG_1; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); this->deathTimer = 0; @@ -1180,38 +1180,38 @@ s32 EnRailgibud_PerformCutsceneActions(EnRailgibud* this, PlayState* play) { this->csAction = play->csCtx.actorActions[actionIndex]->action; switch (play->csCtx.actorActions[actionIndex]->action) { case 1: - this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_IDLE; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_IDLE); + this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_IDLE; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_IDLE); break; case 2: - this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_SLUMP_START; + this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_SLUMP_START; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_WEAKENED2); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_SLUMP_START); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_SLUMP_START); break; case 3: - this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_CONVULSION; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_CONVULSION); + this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_CONVULSION; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_CONVULSION); break; case 4: - this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_ARMS_UP_START; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_ARMS_UP_START); + this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_ARMS_UP_START; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_ARMS_UP_START); break; case 5: - this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_WALK; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK); + this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_WALK; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_WALK); break; } } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if (this->cutsceneAnimationIndex == EN_RAILGIBUD_ANIMATION_SLUMP_START) { - this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_SLUMP_LOOP; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_SLUMP_LOOP); - } else if (this->cutsceneAnimationIndex == EN_RAILGIBUD_ANIMATION_ARMS_UP_START) { - this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_ARMS_UP_LOOP; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_ARMS_UP_LOOP); + if (this->cutsceneAnimIndex == EN_RAILGIBUD_ANIM_SLUMP_START) { + this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_SLUMP_LOOP; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_SLUMP_LOOP); + } else if (this->cutsceneAnimIndex == EN_RAILGIBUD_ANIM_ARMS_UP_START) { + this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_ARMS_UP_LOOP; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_ARMS_UP_LOOP); EnRailgibud_SetupSinkIntoGround(this); } } diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h index 65e8e9736c..78655f870b 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h @@ -33,7 +33,7 @@ typedef struct EnRailgibud { /* 0x3EE */ s16 shouldWalkForwardNextFrame; // Only used by the "main" Gibdo /* 0x3F0 */ union { s16 grabState; - s16 cutsceneAnimationIndex; + s16 cutsceneAnimIndex; }; /* 0x3F2 */ union { s16 playerStunWaitTimer; // Cannot stun the player if this is non-zero diff --git a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c index dd25ce9b9d..d7a4f9170f 100644 --- a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c +++ b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c @@ -30,10 +30,10 @@ const ActorInit En_Rsn_InitVars = { (ActorFunc)EnRsn_Draw, }; -static AnimationInfo sAnimations[] = { { &gBombShopkeeperSwayAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f } }; +static AnimationInfo sAnimationInfo[] = { { &gBombShopkeeperSwayAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f } }; void func_80C25D40(EnRsn* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80C25D84; } diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c index b110161d59..2553962f94 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -64,7 +64,7 @@ static ColliderCylinderInitType1 sCylinderInit = { { 27, 32, 0, { 0, 0, 0 } }, }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -197,7 +197,7 @@ void func_80BCAFA8(EnScopenuts* this, PlayState* play) { if (screenPos.y < (SCREEN_HEIGHT - 90.0f)) { this->actor.draw = EnScopenuts_Draw; this->unk_348 = 10; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 10); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 10); this->actionFunc = func_80BCB078; } } @@ -246,7 +246,7 @@ void func_80BCB1C8(EnScopenuts* this, PlayState* play) { void func_80BCB230(EnScopenuts* this, PlayState* play) { s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animation); + s16 sp24 = Animation_GetLastFrame(sAnimationInfo[this->unk_348].animation); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); @@ -257,30 +257,30 @@ void func_80BCB230(EnScopenuts* this, PlayState* play) { this->unk_348 = 3; this->collider.dim.height = 64; func_80BCAC40(this, play); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); } else if (sp26 == sp24) { if ((this->unk_348 == 4) || (this->unk_348 == 18)) { this->unk_348 = 17; this->collider.dim.height = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 17); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); } else if (this->unk_348 == 2) { this->unk_348 = 16; this->collider.dim.height = 32; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 16); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16); } else if (this->unk_348 == 17) { if (DECR(this->unk_34E) == 0) { this->unk_34E = Rand_ZeroOne() * 10.0f; this->unk_348 = 2; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 2); } } else if ((this->unk_348 == 16) && (DECR(this->unk_34E) == 0)) { this->unk_34E = Rand_S16Offset(40, 40); this->unk_348 = 18; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 18); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 18); } } } @@ -288,7 +288,7 @@ void func_80BCB230(EnScopenuts* this, PlayState* play) { void func_80BCB4DC(EnScopenuts* this, PlayState* play) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { this->actionFunc = func_80BCB52C; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); } } @@ -306,7 +306,7 @@ void func_80BCB52C(EnScopenuts* this, PlayState* play) { } else if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) || !((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { this->unk_348 = 4; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); this->actionFunc = func_80BCB230; } } @@ -323,7 +323,7 @@ void func_80BCB6D0(EnScopenuts* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; this->unk_328 &= ~4; this->unk_348 = 8; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 8); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 8); this->actionFunc = func_80BCBA00; } else { this->unk_33C = func_80BCAF0C(this); @@ -388,7 +388,7 @@ void func_80BCB980(EnScopenuts* this, PlayState* play) { void func_80BCBA00(EnScopenuts* this, PlayState* play) { s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animation); + s16 sp24 = Animation_GetLastFrame(sAnimationInfo[this->unk_348].animation); switch (sp26) { case 10: @@ -463,7 +463,7 @@ void func_80BCBA00(EnScopenuts* this, PlayState* play) { if (sp26 == sp24) { this->unk_35A = 3; this->unk_348 = 19; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 19); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 19); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_328 &= ~2; this->unk_34E = 50; @@ -498,7 +498,7 @@ void func_80BCBC60(EnScopenuts* this, PlayState* play) { void func_80BCBD28(EnScopenuts* this, PlayState* play) { Vec3f sp44; s16 sp42 = this->skelAnime.curFrame; - s16 sp40 = Animation_GetLastFrame(sAnimations[this->unk_348].animation); + s16 sp40 = Animation_GetLastFrame(sAnimationInfo[this->unk_348].animation); Vec3s sp38; func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38); @@ -527,7 +527,7 @@ void func_80BCBD28(EnScopenuts* this, PlayState* play) { if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { this->unk_368 = 0.3f; this->unk_348 = 9; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 9); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 9); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); func_80BCAC40(this, play); this->actionFunc = func_80BCBF0C; @@ -547,7 +547,7 @@ void func_80BCBF0C(EnScopenuts* this, PlayState* play) { if ((this->actor.home.pos.y + 50.0f) < this->actor.world.pos.y) { Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f); this->unk_348 = 10; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 10); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 10); this->unk_328 |= 2; this->unk_36E = 0; this->actionFunc = func_80BCBFFC; @@ -728,7 +728,7 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { this->unk_358 = 150; this->unk_348 = 4; this->unk_35A = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); this->actionFunc = func_80BCB230; } } else { diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index aacfa56852..b07c7574f3 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -80,7 +80,7 @@ static ColliderCylinderInitType1 sCylinderInit = { { 27, 32, 0, { 0, 0, 0 } }, }; -static AnimationInfoS D_80ADD990[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, @@ -235,25 +235,25 @@ f32 func_80ADB08C(PlayState* play) { void func_80ADB0D8(EnSellnuts* this, PlayState* play) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); if (currentFrame == frameCount) { switch (this->unk_340) { case 0x611: case 0x62A: this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80ADBFA0; break; case 0x618: if (this->unk_34C == 1) { this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80ADB544; } else { this->unk_34C = 1; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80ADBFA0; } break; @@ -264,7 +264,7 @@ void func_80ADB0D8(EnSellnuts* this, PlayState* play) { case 0x614: case 0x628: this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); this->actionFunc = func_80ADB924; break; @@ -273,14 +273,14 @@ void func_80ADB0D8(EnSellnuts* this, PlayState* play) { case 0x616: case 0x629: this->unk_34C = 1; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80ADB924; break; case 0x613: case 0x619: this->unk_34C = 7; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 7); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 7); this->actionFunc = func_80ADBD64; break; } @@ -289,7 +289,7 @@ void func_80ADB0D8(EnSellnuts* this, PlayState* play) { void func_80ADB254(EnSellnuts* this, PlayState* play) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); if (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f) ? true : false) && @@ -298,31 +298,31 @@ void func_80ADB254(EnSellnuts* this, PlayState* play) { this->actionFunc = func_80ADB4F4; this->unk_34C = 3; this->collider.dim.height = 64; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); } else if (currentFrame == frameCount) { if ((this->unk_34C == 4) || (this->unk_34C == 18)) { this->unk_34C = 17; this->collider.dim.height = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 17); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); } else if (this->unk_34C == 2) { this->unk_34C = 16; this->collider.dim.height = 32; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 16); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16); } else if (this->unk_34C == 17) { if (DECR(this->unk_34E) == 0) { this->unk_34E = Rand_ZeroOne() * 10.0f; this->unk_34C = 2; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 2); } } else if (this->unk_34C == 16) { if (DECR(this->unk_34E) == 0) { this->unk_34E = Rand_S16Offset(40, 40); this->unk_34C = 18; this->collider.dim.height = 32; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 18); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 18); } } } @@ -331,7 +331,7 @@ void func_80ADB254(EnSellnuts* this, PlayState* play) { void func_80ADB4F4(EnSellnuts* this, PlayState* play) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { this->actionFunc = func_80ADB544; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); } } @@ -409,7 +409,7 @@ void func_80ADB544(EnSellnuts* this, PlayState* play) { if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) || !((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { this->unk_34C = 4; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); this->actionFunc = func_80ADB254; } } @@ -454,18 +454,18 @@ void func_80ADB924(EnSellnuts* this, PlayState* play) { void func_80ADBAB8(EnSellnuts* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); if (this->unk_368 == 0x28) { this->unk_34C = 5; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 5); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 5); } this->unk_368++; if ((currentFrame == frameCount) && (this->unk_34C == 5)) { this->unk_34C = 6; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 6); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 6); } if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { @@ -507,11 +507,11 @@ void func_80ADBCE4(EnSellnuts* this, PlayState* play) { void func_80ADBD64(EnSellnuts* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); if ((currentFrame == frameCount) && (this->unk_34C == 7)) { this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); } if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { @@ -520,14 +520,14 @@ void func_80ADBD64(EnSellnuts* this, PlayState* play) { this->unk_338 &= ~2; this->actor.flags &= ~ACTOR_FLAG_1; this->unk_34C = 8; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 8); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 8); this->actionFunc = func_80ADBE80; } } void func_80ADBE80(EnSellnuts* this, PlayState* play) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); func_80ADAE64(this); if (this->unk_366 == 0) { @@ -546,7 +546,7 @@ void func_80ADBE80(EnSellnuts* this, PlayState* play) { if (currentFrame == frameCount) { this->unk_350 = 4; this->unk_34C = 19; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 19); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 19); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_338 &= ~1; this->unk_338 |= 8; @@ -580,7 +580,7 @@ void func_80ADC034(EnSellnuts* this, PlayState* play) { if ((this->actor.home.pos.y + 200.0f) < this->actor.world.pos.y) { Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f); this->unk_34C = 10; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 10); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 10); this->unk_368 = 0; this->actionFunc = func_80ADC37C; } @@ -589,7 +589,7 @@ void func_80ADC034(EnSellnuts* this, PlayState* play) { void func_80ADC118(EnSellnuts* this, PlayState* play) { Vec3f sp34; s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); if (currentFrame == frameCount) { Math_SmoothStepToS(&this->unk_364, 0x1C71, 3, 0x100, 0); @@ -615,7 +615,7 @@ void func_80ADC118(EnSellnuts* this, PlayState* play) { if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { this->unk_34C = 9; this->unk_360 = 0.3f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 9); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 9); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80ADC034; } @@ -793,7 +793,7 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { this->actor.gravity = -1.0f; this->actor.velocity.y = -1.0f; this->actor.speedXZ = 0.0f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); this->unk_338 &= ~1; this->unk_338 &= ~2; this->actionFunc = func_80ADCA64; @@ -808,7 +808,7 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { void func_80ADCA64(EnSellnuts* this, PlayState* play) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); if (this->unk_34C == 22) { Math_SmoothStepToS(&this->unk_364, 0, 3, 0x100, 0); @@ -821,7 +821,7 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { this->unk_350 = 4; this->unk_34C = 19; this->actor.velocity.y = 0.0f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); } return; @@ -832,7 +832,7 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { if (this->unk_34C == 19) { this->unk_34C = 17; this->collider.dim.height = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 17); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); } else if (this->unk_34C == 17) { ActorCutscene_Stop(this->cutscene); gSaveContext.save.weekEventReg[73] |= 4; @@ -843,7 +843,7 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { void func_80ADCC04(EnSellnuts* this, PlayState* play) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->unk_34C].animation); if (this->unk_34C == 3) { if (currentFrame == frameCount) { @@ -852,7 +852,7 @@ void func_80ADCC04(EnSellnuts* this, PlayState* play) { this->unk_354 = 1.0f; this->unk_358 = 1.0f; this->unk_35C = 1.0f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); } } else if (this->unk_34C == 21) { func_80ADAFC0(this); @@ -863,7 +863,7 @@ void func_80ADCC04(EnSellnuts* this, PlayState* play) { } this->unk_340 = 0x626; this->unk_34C = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); this->actionFunc = func_80ADC5A4; } } @@ -884,7 +884,7 @@ void func_80ADCD3C(EnSellnuts* this, PlayState* play) { this->unk_34C = 3; this->unk_350 = 4; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); this->actionFunc = func_80ADCC04; } else if (D_80ADD940 != 0) { this->collider.dim.height = 64; @@ -989,7 +989,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -1.0f; this->unk_34A = 50; this->unk_34C = 4; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); this->actionFunc = func_80ADB254; return; } @@ -1007,7 +1007,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->unk_358 = 1.0f; this->unk_354 = 1.0f; this->unk_360 = 1.0f; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); this->actionFunc = func_80ADC5A4; } else { this->unk_338 |= 2; @@ -1018,7 +1018,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->unk_34C = 4; this->unk_34E = 20; this->collider.dim.height = 64; - SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); this->actionFunc = func_80ADCD3C; } } diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.c b/src/overlays/actors/ovl_En_Shn/z_en_shn.c index c48cb65557..a6734d6b2f 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c @@ -68,8 +68,8 @@ void func_80AE6130(EnShn* this) { SkelAnime_Update(&this->skelAnime); } -s32 func_80AE615C(EnShn* this, s32 arg1) { - static AnimationInfoS sAnimations[] = { +s32 func_80AE615C(EnShn* this, s32 animIndex) { + static AnimationInfoS sAnimationInfo[] = { { &gBurlyGuyHandsOnTableAnim, 1.0f, 0, -1, 0, 0 }, { &gBurlyGuyHandsOnTableAnim, 1.0f, 0, -1, 0, -4 }, { &gSwampGuideChinScratchAnim, 1.0f, 0, -1, 0, 0 }, @@ -78,12 +78,12 @@ s32 func_80AE615C(EnShn* this, s32 arg1) { s32 phi_v0 = 0; s32 phi_v1 = 0; - if (arg1 != this->unk_2E8) { + if (animIndex != this->unk_2E8) { phi_v0 = 1; } if (phi_v0 != 0) { - this->unk_2E8 = arg1; - phi_v1 = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); + this->unk_2E8 = animIndex; + phi_v1 = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); this->playSpeed = this->skelAnime.playSpeed; } return phi_v1; 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 21df2d8f99..e3c5b17306 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -49,7 +49,7 @@ void func_809964A0(EnSkb* this, PlayState* play); s32 func_80996594(EnSkb* this, PlayState* play); void func_80996BEC(EnSkb* this, PlayState* play); -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_skb_Anim_0064E0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f }, @@ -287,7 +287,7 @@ void func_80994DA8(EnSkb* this, PlayState* play) { } void func_80994E2C(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actor.flags &= ~ACTOR_FLAG_1; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR); this->unk_3D0 = 0; @@ -342,7 +342,7 @@ void func_80995068(EnSkb* this, PlayState* play) { if (this->unk_3E0 == 1) { Message_StartTextbox(play, 0x13F8, &this->actor); if (this->unk_3DE == 2) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); } } else { Message_StartTextbox(play, 0x13F6, &this->actor); @@ -374,7 +374,7 @@ void func_80995190(EnSkb* this, PlayState* play) { if (Message_ShouldAdvance(play)) { Message_StartTextbox(play, 0x13F7, &this->actor); if (this->unk_3DE == 2) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); } } break; @@ -412,7 +412,7 @@ void func_80995244(EnSkb* this, PlayState* play) { } void func_809952D8(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 9; this->actionFunc = func_8099533C; @@ -434,7 +434,7 @@ void func_8099533C(EnSkb* this, PlayState* play) { } void func_809953E8(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 10; this->actionFunc = func_8099544C; @@ -456,7 +456,7 @@ void func_8099544C(EnSkb* this, PlayState* play) { } void func_809954F8(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 11; this->actionFunc = func_8099556C; @@ -499,14 +499,14 @@ void func_8099571C(EnSkb* this) { this->unk_3DC = 0; this->actor.shape.shadowScale = 0.0f; if (this->unk_3DE == 9) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); this->actor.speedXZ = 2.4f; this->actor.gravity = -1.0f; this->actor.velocity.y = 3.0f; } else if (this->unk_3DE == 0xA) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); } else if (this->unk_3DE == 0xB) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); this->actor.speedXZ = 3.2f; this->actor.gravity = -1.0f; this->actor.velocity.y = 2.0f; @@ -560,7 +560,7 @@ void func_8099599C(EnSkb* this, PlayState* play) { } void func_80995A30(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actor.speedXZ = 1.6f; this->unk_3DA = 0; this->unk_3DE = 2; @@ -573,7 +573,7 @@ void func_80995A8C(EnSkb* this, PlayState* play) { this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); this->actor.hintId = 0xFF; this->actor.colChkInfo.mass = MASS_HEAVY; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12); func_8099504C(this); return; } @@ -596,7 +596,7 @@ void func_80995A8C(EnSkb* this, PlayState* play) { } void func_80995C24(EnSkb* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->collider.base.atFlags &= ~AT_BOUNCED; this->actor.speedXZ = 0.0f; this->unk_3DE = 3; @@ -682,17 +682,17 @@ void func_80995E64(EnSkb* this, PlayState* play) { void func_80995F98(EnSkb* this) { if ((this->unk_3DE == 9) || (this->unk_3DE == 0xA)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); this->actor.gravity = -1.0f; this->actor.speedXZ = 1.0f; } else if (this->unk_3DE == 0xB) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); this->actor.speedXZ = 3.2f; this->actor.velocity.y = 2.0f; this->actor.gravity = -1.0f; } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -4.0f; } @@ -728,7 +728,7 @@ void func_809960AC(EnSkb* this, PlayState* play) { } void func_809961E4(EnSkb* this, PlayState* play) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->unk_3D8 |= 0x40; if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -6.0f; @@ -760,7 +760,7 @@ void func_8099630C(EnSkb* this, PlayState* play) { this->drawDmgEffAlpha = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->unk_3D8 |= 1; func_80995F98(this); } else { @@ -782,7 +782,7 @@ void func_809963D8(EnSkb* this, PlayState* play) { this->drawDmgEffAlpha = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->unk_3D8 |= 1; func_80995F98(this); } else { @@ -953,7 +953,7 @@ void func_8099672C(EnSkb* this, PlayState* play) { this->drawDmgEffScale = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_809963C4(this); break; @@ -971,7 +971,7 @@ void func_8099672C(EnSkb* this, PlayState* play) { case 13: Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80995F98(this); break; } diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index ce8cb0cf64..df64d124b5 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -58,7 +58,7 @@ typedef enum { /* 2 */ BOMB_SHOPKEEPER_ANIM_SIT_AT_COUNTER_LOOP } BombShopkeeperAnimation; -static AnimationInfoS sAnimationsBombShopkeeper[] = { +static AnimationInfoS sAnimationInfoBombShopkeeper[] = { { &gBombShopkeeperWalkAnim, 2.0f, 0, -1, ANIMMODE_LOOP, 20 }, { &gBombShopkeeperSitAtCounterStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &gBombShopkeeperSitAtCounterLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, @@ -156,10 +156,10 @@ static Vec3f sPosOffset[] = { { 0.0f, -4.0f, 0.0f }, }; -void EnSob1_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index) { +void EnSob1_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animations, s32 animIndex) { f32 frameCount; - animations += index; + animations += animIndex; if (animations->frameCount < 0) { frameCount = Animation_GetLastFrame(animations->animation); } else { @@ -722,7 +722,8 @@ void EnSob1_EndWalk(EnSob1* this, PlayState* play) { if (distSq < 12.0f) { this->actor.speedXZ = 0.0f; if (animLastFrame == curFrame) { - EnSob1_ChangeAnim(&this->skelAnime, sAnimationsBombShopkeeper, BOMB_SHOPKEEPER_ANIM_SIT_AT_COUNTER_START); + EnSob1_ChangeAnim(&this->skelAnime, sAnimationInfoBombShopkeeper, + BOMB_SHOPKEEPER_ANIM_SIT_AT_COUNTER_START); EnSob1_SetupAction(this, EnSob1_SetupIdle); } } @@ -733,7 +734,7 @@ void EnSob1_SetupIdle(EnSob1* this, PlayState* play) { s16 curFrame = this->skelAnime.curFrame; if (Animation_GetLastFrame(&gBombShopkeeperSitAtCounterStartAnim) == curFrame) { - EnSob1_ChangeAnim(&this->skelAnime, sAnimationsBombShopkeeper, BOMB_SHOPKEEPER_ANIM_SIT_AT_COUNTER_LOOP); + EnSob1_ChangeAnim(&this->skelAnime, sAnimationInfoBombShopkeeper, BOMB_SHOPKEEPER_ANIM_SIT_AT_COUNTER_LOOP); EnSob1_SetupAction(this, EnSob1_Idle); } EnSob1_Walking(this, play); 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 d7c41603ed..6e79155393 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -206,39 +206,40 @@ void EnSsh_InitColliders(EnSsh* this, PlayState* play) { Collider_SetJntSph(play, &this->collider2, &this->actor, &sJntSphInit, this->collider2Elements); } -f32 EnSsh_SetAnimation(EnSsh* this, s32 arg0) { - AnimationHeader* animation[] = { &object_ssh_Anim_006D78, &object_ssh_Anim_001494, &object_ssh_Anim_001494, - &object_ssh_Anim_006788, &object_ssh_Anim_001494, &object_ssh_Anim_001494, - &object_ssh_Anim_006D78 }; - f32 playerbackSpeed[] = { 1.0f, 4.0f, 1.0f, 1.0f, 8.0f, 6.0f, 2.0f }; - u8 mode[] = { +f32 EnSsh_ChangeAnim(EnSsh* this, s32 animIndex) { + AnimationHeader* sAnimations[] = { &object_ssh_Anim_006D78, &object_ssh_Anim_001494, &object_ssh_Anim_001494, + &object_ssh_Anim_006788, &object_ssh_Anim_001494, &object_ssh_Anim_001494, + &object_ssh_Anim_006D78 }; + f32 sPlaySpeeds[] = { 1.0f, 4.0f, 1.0f, 1.0f, 8.0f, 6.0f, 2.0f }; + u8 sAnimationModes[] = { ANIMMODE_ONCE_INTERP, ANIMMODE_ONCE_INTERP, ANIMMODE_LOOP_INTERP, ANIMMODE_ONCE_INTERP, ANIMMODE_LOOP_INTERP, ANIMMODE_LOOP_INTERP, ANIMMODE_LOOP_INTERP, }; - f32 frameCount = Animation_GetLastFrame(animation[arg0]); + f32 frameCount = Animation_GetLastFrame(sAnimations[animIndex]); s32 pad; - Animation_Change(&this->skelAnime, animation[arg0], playerbackSpeed[arg0], 0.0f, frameCount, mode[arg0], -6.0f); + Animation_Change(&this->skelAnime, sAnimations[animIndex], sPlaySpeeds[animIndex], 0.0f, frameCount, + sAnimationModes[animIndex], -6.0f); return frameCount; } void EnSsh_SetWaitAnimation(EnSsh* this) { - EnSsh_SetAnimation(this, SSH_ANIM_WAIT); + EnSsh_ChangeAnim(this, SSH_ANIM_WAIT); } void EnSsh_SetReturnAnimation(EnSsh* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_UP); - EnSsh_SetAnimation(this, SSH_ANIM_UP); + EnSsh_ChangeAnim(this, SSH_ANIM_UP); } void EnSsh_SetLandAnimation(EnSsh* this) { this->actor.world.pos.y = this->floorHeightOffset + this->actor.floorHeight; - this->animTimer = EnSsh_SetAnimation(this, SSH_ANIM_LAND); + this->animTimer = EnSsh_ChangeAnim(this, SSH_ANIM_LAND); } void EnSsh_SetDropAnimation(EnSsh* this) { if (this->unkTimer == 0) { - this->animTimer = EnSsh_SetAnimation(this, SSH_ANIM_DROP); + this->animTimer = EnSsh_ChangeAnim(this, SSH_ANIM_DROP); } this->actor.velocity.y = -10.0f; } @@ -724,11 +725,11 @@ void EnSsh_Idle(EnSsh* this, PlayState* play) { } if ((this->unkTimer != 0) && (DECR(this->unkTimer) == 0)) { - EnSsh_SetAnimation(this, SSH_ANIM_WAIT); + EnSsh_ChangeAnim(this, SSH_ANIM_WAIT); } if ((this->animTimer != 0) && (DECR(this->animTimer) == 0)) { - EnSsh_SetAnimation(this, SSH_ANIM_WAIT); + EnSsh_ChangeAnim(this, SSH_ANIM_WAIT); } if (!EnSsh_IsCloseToLink(this, play)) { @@ -752,11 +753,11 @@ void EnSsh_Idle(EnSsh* this, PlayState* play) { void EnSsh_Land(EnSsh* this, PlayState* play) { if ((this->unkTimer != 0) && (DECR(this->unkTimer) == 0)) { - EnSsh_SetAnimation(this, SSH_ANIM_WAIT); + EnSsh_ChangeAnim(this, SSH_ANIM_WAIT); } if ((this->animTimer != 0) && (DECR(this->animTimer) == 0)) { - EnSsh_SetAnimation(this, SSH_ANIM_WAIT); + EnSsh_ChangeAnim(this, SSH_ANIM_WAIT); } if ((this->actor.floorHeight + this->floorHeightOffset) <= this->actor.world.pos.y) { @@ -768,7 +769,7 @@ void EnSsh_Land(EnSsh* this, PlayState* play) { void EnSsh_Drop(EnSsh* this, PlayState* play) { if ((this->unkTimer != 0) && (DECR(this->unkTimer) == 0)) { - EnSsh_SetAnimation(this, SSH_ANIM_DROP); + EnSsh_ChangeAnim(this, SSH_ANIM_DROP); } if (!EnSsh_IsCloseToLink(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 e8c9eaeb95..b3c353f1f3 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -152,7 +152,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_st_Anim_005B98, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, { &object_st_Anim_000304, 4.0f, 0, -1, ANIMMODE_ONCE, -4 }, @@ -447,7 +447,7 @@ s32 func_808A6064(EnSt* this) { } void func_808A60E0(EnSt* this) { - s32 idx = (this->unk_2C8 > 0.0f) ? 2 : 6; + s32 animIndex = (this->unk_2C8 > 0.0f) ? 2 : 6; f32 sp20 = (this->unk_2C8 > 0.0f) ? 4.0f : 9.0f; f32 sp1C; u16 sfxId = (this->unk_2C8 < 0.0f) ? NA_SE_EN_STALTU_DOWN : NA_SE_EN_STALTU_UP; @@ -455,7 +455,7 @@ void func_808A60E0(EnSt* this) { sp1C = this->skelAnime.curFrame / (this->skelAnime.animLength - 1.0f); if (sp1C == 1.0f) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, idx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); Actor_PlaySfxAtPos(&this->actor, sfxId); } @@ -507,7 +507,7 @@ void func_808A6220(EnSt* this, PlayState* play) { } void func_808A63E8(EnSt* this) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); this->unk_2C8 = 1.0f; func_808A5D7C(this); this->unk_30C = 0; @@ -520,7 +520,7 @@ void func_808A63E8(EnSt* this) { void func_808A6468(EnSt* this, PlayState* play) { func_808A5050(this, play); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 4); this->unk_18C |= (0x8 | 0x4); this->unk_18C &= ~(0x10 | 0x2); this->unk_2C8 = -1.0f; @@ -535,9 +535,9 @@ void func_808A6468(EnSt* this, PlayState* play) { } void func_808A650C(EnSt* this) { - s32 idx = (this->unk_2C8 > 0.0f) ? 2 : 6; + s32 animIndex = (this->unk_2C8 > 0.0f) ? 2 : 6; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, idx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; this->unk_2D8 = 0.0f; @@ -604,7 +604,7 @@ s32 func_808A6580(EnSt* this, PlayState* play) { this->unk_314 = 20; this->unk_312 = 0; Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_314); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 1); this->unk_18C |= 8; this->actionFunc = func_808A6D84; this->unk_2C8 = -1.0f; @@ -645,7 +645,7 @@ s32 func_808A6580(EnSt* this, PlayState* play) { } if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 7); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 7); this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; this->actor.gravity = -1.0f; @@ -690,7 +690,7 @@ void func_808A6A78(EnSt* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->unk_2C0)) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 8.0f); SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); Collider_InitAndSetCylinder(play, &this->collider1, &this->actor, &sCylinderInit1); Collider_InitAndSetCylinder(play, &this->collider2, &this->actor, &sCylinderInit2); @@ -721,7 +721,7 @@ void func_808A6C04(EnSt* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); if ((this->unk_18C & 8) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); this->unk_18C &= ~8; } else if ((this->unk_310 == 0) && func_808A5F28(this, play) && !func_808A6064(this)) { func_808A650C(this); @@ -763,7 +763,7 @@ void func_808A6E24(EnSt* this, PlayState* play) { } if (count == ARRAY_COUNT(this->unk_31C)) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 7); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 7); this->drawDmgEffType = ACTOR_DRAW_DMGEFF_BLUE_FIRE; this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 0397074a3c..10cdec0791 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -49,7 +49,7 @@ const ActorInit En_Suttari_InitVars = { (ActorFunc)EnSuttari_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &object_boj_Anim_00071C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, { &object_boj_Anim_0128F4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, { &object_boj_Anim_011F84, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, @@ -250,7 +250,7 @@ s32 func_80BAA904(EnSuttari* this, PlayState* play) { void func_80BAA9B4(EnSuttari* this) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); switch (this->textId) { case 0x1454: @@ -261,15 +261,15 @@ void func_80BAA9B4(EnSuttari* this) { case 0x1459: case 0x145A: case 0x145B: - if ((this->animationIndex != 8) && (curFrame == frameCount)) { - this->animationIndex = 8; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if ((this->animIndex != 8) && (curFrame == frameCount)) { + this->animIndex = 8; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } break; default: - if ((this->animationIndex != 1) && (curFrame == frameCount)) { - this->animationIndex = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if ((this->animIndex != 1) && (curFrame == frameCount)) { + this->animIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } } } @@ -277,8 +277,8 @@ void func_80BAA9B4(EnSuttari* this) { void func_80BAAA94(EnSuttari* this) { switch (this->textId) { case 0x29E5: - this->animationIndex = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); break; case 0x29E9: this->enFsn->flags |= ENFSN_ANGRY; @@ -290,12 +290,12 @@ void func_80BAAA94(EnSuttari* this) { this->enFsn->flags |= ENFSN_OFFER_FINAL_PRICE; break; case 0x29EC: - this->animationIndex = 7; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = 7; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); break; case 0x29ED: - this->animationIndex = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); break; } } @@ -417,14 +417,14 @@ void func_80BAAB78(EnSuttari* this, PlayState* play) { void func_80BAAF1C(EnSuttari* this) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (this->animationIndex == 5) { - this->animationIndex = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); - } else if ((this->animationIndex == 3) && (curFrame == frameCount)) { - this->animationIndex = 6; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if (this->animIndex == 5) { + this->animIndex = 3; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); + } else if ((this->animIndex == 3) && (curFrame == frameCount)) { + this->animIndex = 6; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->flags1 &= ~0x100; } } @@ -842,7 +842,7 @@ s32 func_80BAC220(EnSuttari* this, PlayState* play) { void func_80BAC2FC(EnSuttari* this, PlayState* play) { Player* player = GET_PLAYER(play); s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); switch (this->unk428) { case 12: @@ -851,9 +851,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { func_80BABFD4(this, play); break; case 15: - if ((this->animationIndex == 1) && (curFrame == frameCount)) { - this->animationIndex = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if ((this->animIndex == 1) && (curFrame == frameCount)) { + this->animIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } if (!(gSaveContext.save.weekEventReg[83] & 4) && !(this->flags1 & 0x1000)) { if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { @@ -884,9 +884,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { this->flags1 |= 0x80; this->flags1 |= 0x20; this->enFsn->flags &= ~ENFSN_HAGGLE; - if (this->animationIndex != 2) { - this->animationIndex = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if (this->animIndex != 2) { + this->animIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } func_80BAC220(this, play); break; @@ -915,9 +915,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { break; case 4: if (!(gSaveContext.save.weekEventReg[33] & 8)) { - if (this->animationIndex == 2 || this->animationIndex == 1) { - this->animationIndex = 5; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if (this->animIndex == 2 || this->animIndex == 1) { + this->animIndex = 5; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } this->flags1 |= 0x10; if (this->flags2 & 2) { @@ -945,16 +945,16 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { if (play->sceneNum == SCENE_IKANA) { this->flags1 |= 1; if (gSaveContext.save.day == 1 || gSaveContext.save.day == 2) { - this->animationIndex = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->flags1 |= 0x80; this->actionFunc = func_80BACA14; return; } else if ((gSaveContext.save.day == 3) && (gSaveContext.save.time <= CLOCK_TIME(19, 0)) && !(gSaveContext.save.weekEventReg[61] & 8) && !(gSaveContext.save.weekEventReg[33] & 8) && (gSaveContext.save.weekEventReg[51] & 8)) { - this->animationIndex = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80BACEE0; return; } @@ -970,8 +970,8 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); this->flags1 |= 0x80; this->flags1 |= 8; - this->animationIndex = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = func_80BAD004; return; } else if (play->sceneNum == SCENE_ICHIBA) { @@ -979,8 +979,8 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { Actor_MarkForDeath(&this->actor); return; } - this->animationIndex = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = 0; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->flags1 |= 2; this->actionFunc = func_80BAD5F8; return; @@ -989,8 +989,8 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { Actor_MarkForDeath(&this->actor); return; } - this->animationIndex = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + this->animIndex = 0; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); this->cutscenes[0] = this->actor.cutscene; this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); this->flags1 |= 4; @@ -1008,9 +1008,9 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { void func_80BACA14(EnSuttari* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->animationIndex == 1 || this->animationIndex == 8) { - this->animationIndex = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if (this->animIndex == 1 || this->animIndex == 8) { + this->animIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } func_80BABA90(this, 0, 0); func_80BAB434(this); @@ -1246,11 +1246,11 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { void func_80BAD5F8(EnSuttari* this, PlayState* play) { ScheduleOutput scheduleOutput; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if ((curFrame == frameCount) && (this->animationIndex == 0) && (this->flags1 & 0x20)) { - this->animationIndex = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if ((curFrame == frameCount) && (this->animIndex == 0) && (this->flags1 & 0x20)) { + this->animIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed); if (!Schedule_RunScript(play, D_80BAE820, &scheduleOutput) || @@ -1281,14 +1281,14 @@ void func_80BAD5F8(EnSuttari* this, PlayState* play) { void func_80BAD7F8(EnSuttari* this, PlayState* play) { ScheduleOutput scheduleOutput; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (this->enFsn == NULL) { this->enFsn = (EnFsn*)EnSuttari_GetActorById(play, ACTOR_EN_FSN); } else { - if ((this->flags1 & 0x2000) && (this->animationIndex == 1) && (curFrame == frameCount)) { - this->animationIndex = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + if ((this->flags1 & 0x2000) && (this->animIndex == 1) && (curFrame == frameCount)) { + this->animIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed); if (!Schedule_RunScript(play, D_80BAE820, &scheduleOutput) || @@ -1330,14 +1330,14 @@ void func_80BADA08(EnSuttari* this, PlayState* play) { void func_80BADA9C(EnSuttari* this, PlayState* play) { u8 talkstate = Message_GetState(&play->msgCtx); s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); + s16 frameCount = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (this->flags1 & 1) { this->unk3F2 = this->headRot.y; func_80BAA9B4(this); - } else if ((this->animationIndex == 7) && (curFrame == frameCount)) { - this->animationIndex = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + } else if ((this->animIndex == 7) && (curFrame == frameCount)) { + this->animIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } if (talkstate == TEXT_STATE_5) { if (Message_ShouldAdvance(play)) { @@ -1483,11 +1483,11 @@ void EnSuttari_Update(Actor* thisx, PlayState* play) { EnSuttari_UpdateTime(); } if (this->unk428 != 0) { - if (this->animationIndex == 2 || this->animationIndex == 6) { + if (this->animIndex == 2 || this->animIndex == 6) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 16.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } - } else if (this->animationIndex == 0 || this->animationIndex == 5) { + } else if (this->animIndex == 0 || this->animIndex == 5) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h index 2861e59714..35a9b6e2e4 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h @@ -54,7 +54,7 @@ typedef struct EnSuttari { /* 0x436 */ s16 unk436; /* 0x438 */ Vec3f unk438; /* 0x444 */ Vec3f unk444; - /* 0x450 */ s32 animationIndex; + /* 0x450 */ s32 animIndex; /* 0x454 */ UNK_TYPE1 unk_454[0x2]; /* 0x456 */ s16 cutscenes[2]; /* 0x45A */ s16 cutsceneIdx; 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 35893a1f06..7d6f76b7a0 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -134,7 +134,7 @@ static DamageTable sDamageTable2 = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_ONCE_INTERP, 0 }, { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_ONCE_INTERP, -4 }, { &object_st_Anim_0055A8, 1.0f, 0, -1, ANIMMODE_LOOP_INTERP, -4 }, @@ -678,7 +678,7 @@ s32 func_808DA08C(EnSw* this, PlayState* play) { Enemy_StartFinishingBlow(play, &this->actor); this->actor.flags &= ~ACTOR_FLAG_1; if (!ENSW_GET_3(&this->actor)) { - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 3); } switch (this->actor.colChkInfo.damageEffect) { @@ -1158,7 +1158,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { if (!func_808D9968(this, play)) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); this->skelAnime.playSpeed = 4.0f; Collider_InitAndSetSphere(play, &this->collider, &this->actor, &sSphereInit); diff --git a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c index 887e626570..fcb1e83305 100644 --- a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c +++ b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c @@ -68,7 +68,7 @@ static ColliderCylinderInit sCylinderInit = { static Cylinder16 D_80A2CADC[] = { { 24, 40, 0, { 0, 0, 0 } } }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gDekuScrubUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, { &gDekuScrubBurrowAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, { &gDekuScrubIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f }, @@ -231,7 +231,7 @@ void func_80A2C168(EnSyatekiDekunuts* this, PlayState* play) { void func_80A2C1AC(EnSyatekiDekunuts* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actionFunc = func_80A2C208; @@ -250,7 +250,7 @@ void func_80A2C208(EnSyatekiDekunuts* this, PlayState* play) { } void func_80A2C27C(EnSyatekiDekunuts* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); if (EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) != 1) { this->actionFunc = func_80A2C2E0; } else { @@ -281,7 +281,7 @@ void func_80A2C33C(EnSyatekiDekunuts* this, PlayState* play) { } void func_80A2C3AC(EnSyatekiDekunuts* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80A2C3F0; } @@ -330,7 +330,7 @@ void func_80A2C4D0(EnSyatekiDekunuts* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE); this->unk_1E2 = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->unk_1D8 = 160; this->actionFunc = func_80A2C5DC; } @@ -342,7 +342,7 @@ void func_80A2C5DC(EnSyatekiDekunuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (this->unk_1D8 == 160) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DEAD); this->unk_1D8--; } else if (this->unk_1D8 < 160) { 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 975d1dabf7..8e8290f80e 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 @@ -72,12 +72,12 @@ const ActorInit En_Syateki_Man_InitVars = { }; typedef enum { - /* 0 */ EN_SYATEKI_MAN_ANIMATION_HANDS_ON_TABLE, - /* 1 */ EN_SYATEKI_MAN_ANIMATION_SWAMP_HEAD_SCRATCH_LOOP, - /* 2 */ EN_SYATEKI_MAN_ANIMATION_SWAMP_HEAD_SCRATCH_END, -} EnSyatekiManAnimationIndex; + /* 0 */ EN_SYATEKI_MAN_ANIM_HANDS_ON_TABLE, + /* 1 */ EN_SYATEKI_MAN_ANIM_SWAMP_HEAD_SCRATCH_LOOP, + /* 2 */ EN_SYATEKI_MAN_ANIM_SWAMP_HEAD_SCRATCH_END, +} EnSyatekiManAnimation; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gBurlyGuyHandsOnTableAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &gSwampShootingGalleryManHeadScratchLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &gSwampShootingGalleryManHeadScratchEndAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, @@ -260,7 +260,7 @@ void EnSyatekiMan_Swamp_Idle(EnSyatekiMan* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { u16 faceReactionTextId; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_SYATEKI_MAN_ANIMATION_SWAMP_HEAD_SCRATCH_END); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_MAN_ANIM_SWAMP_HEAD_SCRATCH_END); faceReactionTextId = Text_GetFaceReaction(play, 0x31); if (faceReactionTextId != 0) { Message_StartTextbox(play, faceReactionTextId, &this->actor); @@ -479,7 +479,7 @@ void EnSyatekiMan_Swamp_Talk(EnSyatekiMan* this, PlayState* play) { if (this->skelAnime.animation == &gSwampShootingGalleryManHeadScratchEndAnim) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_SYATEKI_MAN_ANIMATION_HANDS_ON_TABLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_MAN_ANIM_HANDS_ON_TABLE); } } } diff --git a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c index eda6337a0c..9077b38c45 100644 --- a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c +++ b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c @@ -60,7 +60,7 @@ static ColliderCylinderInit sCylinderInit = { { 20, 40, -30, { 0, 0, 0 } }, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gOctorokShootAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, { &gOctorokDieAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, { &gOctorokHideAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, @@ -185,7 +185,7 @@ void func_80A36350(EnSyatekiOkuta* this, PlayState* play) { void func_80A36360(EnSyatekiOkuta* this) { this->actor.draw = EnSyatekiOkuta_Draw; this->unk_2AA = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->actionFunc = func_80A363B4; } @@ -205,7 +205,7 @@ void func_80A363B4(EnSyatekiOkuta* this, PlayState* play) { } void func_80A36444(EnSyatekiOkuta* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->actionFunc = func_80A36488; } @@ -218,7 +218,7 @@ void func_80A36488(EnSyatekiOkuta* this, PlayState* play) { } void func_80A364C0(EnSyatekiOkuta* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80A36504; } @@ -238,7 +238,7 @@ void func_80A3657C(EnSyatekiOkuta* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OCTAROCK_DEAD1); } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actionFunc = func_80A365EC; } diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c index 7c6073bb29..d15859a749 100644 --- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c +++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c @@ -113,7 +113,7 @@ const ActorInit En_Syateki_Wf_InitVars = { (ActorFunc)EnSyatekiWf_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gWolfosWaitingAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f }, { &gWolfosRunningAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &gWolfosRunningAnim, 1.0f, 0.0f, 4.0f, ANIMMODE_ONCE, 1.0f }, @@ -257,7 +257,7 @@ void func_80A20320(EnSyatekiWf* this, PlayState* play) { } void func_80A20378(EnSyatekiWf* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actor.speedXZ = 10.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.draw = EnSyatekiWf_Draw; @@ -328,7 +328,7 @@ void func_80A20670(EnSyatekiWf* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); this->actor.velocity.y = 20.0f; this->actor.speedXZ = 5.0f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80A206DC; } @@ -340,7 +340,7 @@ void func_80A206DC(EnSyatekiWf* this, PlayState* play) { void func_80A20710(EnSyatekiWf* this) { this->actor.speedXZ = 0.0f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->actionFunc = func_80A2075C; } @@ -354,7 +354,7 @@ void func_80A2079C(EnSyatekiWf* this) { this->unk_29A = 40; this->actor.speedXZ = 0.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); this->actionFunc = func_80A20800; } @@ -374,7 +374,7 @@ void func_80A20858(EnSyatekiWf* this, PlayState* play) { this->actor.speedXZ = 0.0f; EffectSsExtra_Spawn(play, &this->actor.world.pos, &D_80A20EDC, &D_80A20EE8, 5, 2); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DEAD); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); syatekiMan->score += 100; this->actionFunc = func_80A208F8; } diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c index fff6d29fab..f1268e1e01 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c @@ -75,21 +75,21 @@ typedef enum { } EnTalkGibudRequestedItemIndex; typedef enum { - /* 0 */ EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK, - /* 1 */ EN_TALK_GIBUD_ANIMATION_GRAB_END, - /* 2 */ EN_TALK_GIBUD_ANIMATION_GRAB_START, - /* 3 */ EN_TALK_GIBUD_ANIMATION_LOOK_BACK, - /* 4 */ EN_TALK_GIBUD_ANIMATION_CROUCH_WIPING_TEARS, - /* 5 */ EN_TALK_GIBUD_ANIMATION_CROUCH_CRYING, - /* 6 */ EN_TALK_GIBUD_ANIMATION_DEATH, - /* 7 */ EN_TALK_GIBUD_ANIMATION_DAMAGE, - /* 8 */ EN_TALK_GIBUD_ANIMATION_CROUCH_END, - /* 9 */ EN_TALK_GIBUD_ANIMATION_IDLE, - /* 10 */ EN_TALK_GIBUD_ANIMATION_WALK, - /* 11 */ EN_TALK_GIBUD_ANIMATION_DANCE_SQUAT, - /* 12 */ EN_TALK_GIBUD_ANIMATION_DANCE_PIROUETTE, - /* 13 */ EN_TALK_GIBUD_ANIMATION_DANCE_CLAP, -} EnTalkGibudAnimations; + /* 0 */ EN_TALK_GIBUD_ANIM_GRAB_ATTACK, + /* 1 */ EN_TALK_GIBUD_ANIM_GRAB_END, + /* 2 */ EN_TALK_GIBUD_ANIM_GRAB_START, + /* 3 */ EN_TALK_GIBUD_ANIM_LOOK_BACK, + /* 4 */ EN_TALK_GIBUD_ANIM_CROUCH_WIPING_TEARS, + /* 5 */ EN_TALK_GIBUD_ANIM_CROUCH_CRYING, + /* 6 */ EN_TALK_GIBUD_ANIM_DEATH, + /* 7 */ EN_TALK_GIBUD_ANIM_DAMAGE, + /* 8 */ EN_TALK_GIBUD_ANIM_CROUCH_END, + /* 9 */ EN_TALK_GIBUD_ANIM_IDLE, + /* 10 */ EN_TALK_GIBUD_ANIM_WALK, + /* 11 */ EN_TALK_GIBUD_ANIM_DANCE_SQUAT, + /* 12 */ EN_TALK_GIBUD_ANIM_DANCE_PIROUETTE, + /* 13 */ EN_TALK_GIBUD_ANIM_DANCE_CLAP, +} EnTalkGibudAnimation; typedef enum { /* 0 */ EN_TALK_GIBUD_TYPE_GIBDO, @@ -114,7 +114,7 @@ const ActorInit En_Talk_Gibud_InitVars = { (ActorFunc)EnTalkGibud_Draw, }; -static AnimationInfo sAnimations[] = { +static AnimationInfo sAnimationInfo[] = { { &gGibdoRedeadGrabAttackAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, { &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 0.0f }, { &gGibdoRedeadGrabStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, @@ -282,7 +282,7 @@ void EnTalkGibud_Destroy(Actor* thisx, PlayState* play) { } void EnTalkGibud_SetupIdle(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_IDLE); this->actionFunc = EnTalkGibud_Idle; } @@ -300,7 +300,7 @@ void EnTalkGibud_Idle(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupAttemptPlayerFreeze(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_IDLE); this->actionFunc = EnTalkGibud_AttemptPlayerFreeze; } @@ -321,7 +321,7 @@ void EnTalkGibud_AttemptPlayerFreeze(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupWalkToPlayer(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_WALK); this->actor.speedXZ = 0.4f; if (this->actionFunc == EnTalkGibud_AttemptPlayerFreeze) { @@ -381,7 +381,7 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupGrab(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_START); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_GRAB_START); this->grabDamageTimer = 0; this->actor.flags &= ~ACTOR_FLAG_1; this->grabState = EN_TALK_GIBUD_GRAB_START; @@ -399,7 +399,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { inPositionToAttack = EnTalkGibud_MoveToIdealGrabPositionAndRotation(this, play); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (inPositionToAttack == true)) { this->grabState = EN_TALK_GIBUD_GRAB_ATTACK; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_GRAB_ATTACK); } break; @@ -426,7 +426,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { player->unk_AE8 = 100; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_END); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_GRAB_END); this->actor.flags |= ACTOR_FLAG_1; this->grabState = EN_TALK_GIBUD_GRAB_RELEASE; this->grabDamageTimer = 0; @@ -446,7 +446,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupGrabFail(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_DAMAGE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->actor.speedXZ = -2.0f; this->actionFunc = EnTalkGibud_GrabFail; @@ -468,7 +468,7 @@ void EnTalkGibud_GrabFail(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupTurnAwayAndShakeHead(EnTalkGibud* this) { this->headShakeTimer = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_WALK); this->actionFunc = EnTalkGibud_TurnAwayAndShakeHead; } @@ -486,7 +486,7 @@ void EnTalkGibud_TurnAwayAndShakeHead(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupWalkToHome(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_WALK); this->actor.speedXZ = 0.4f; this->actionFunc = EnTalkGibud_WalkToHome; } @@ -547,7 +547,7 @@ void EnTalkGibud_Stunned(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupDamage(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_DAMAGE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->stunTimer = 0; this->grabWaitTimer = 0; @@ -583,7 +583,7 @@ void EnTalkGibud_Damage(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupDead(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DEATH); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_DEATH); this->actor.flags &= ~ACTOR_FLAG_1; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); this->deathTimer = 0; @@ -761,7 +761,7 @@ void EnTalkGibud_CheckPresentedItem(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupPassiveIdle(EnTalkGibud* this) { this->isTalking = false; if (this->actionFunc != EnTalkGibud_Talk) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_IDLE); } this->actionFunc = EnTalkGibud_PassiveIdle; } @@ -842,7 +842,7 @@ void EnTalkGibud_Talk(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupDisappear(EnTalkGibud* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_IDLE); this->actor.flags &= ~ACTOR_FLAG_1; this->disappearanceTimer = 40; this->actionFunc = EnTalkGibud_Disappear; diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index ac172b92e8..2dc03f2192 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -64,7 +64,7 @@ void EnTrt_Blink(EnTrt* this); void EnTrt_OpenEyes2(EnTrt* this); void EnTrt_NodOff(EnTrt* this); -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_trt_Anim_00DE68, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &object_trt_Anim_00EE98, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &object_trt_Anim_00FD34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, @@ -97,17 +97,17 @@ static ShopItem sShop[] = { { SI_POTION_BLUE, { -12, 32, -36 } }, }; -void EnTrt_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animations, s32 idx) { +void EnTrt_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex) { f32 frameCount; - animations += idx; - if (animations->frameCount < 0) { - frameCount = Animation_GetLastFrame(animations->animation); + animationInfo += animIndex; + if (animationInfo->frameCount < 0) { + frameCount = Animation_GetLastFrame(animationInfo->animation); } else { - frameCount = animations->frameCount; + frameCount = animationInfo->frameCount; } - Animation_Change(skelAnime, animations->animation, animations->playSpeed, animations->startFrame, frameCount, - animations->mode, animations->morphFrames); + Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, + frameCount, animationInfo->mode, animationInfo->morphFrames); } s32 EnTrt_TestItemSelected(PlayState* play) { @@ -785,8 +785,8 @@ void EnTrt_IdleSleeping(EnTrt* this, PlayState* play) { } if (DECR(this->timer) == 0) { this->timer = 40; - EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 1); - this->animationIndex = 1; + EnTrt_ChangeAnim(&this->skelAnime, sAnimationInfo, 1); + this->animIndex = 1; this->actionFunc = EnTrt_IdleAwake; this->blinkFunc = EnTrt_OpenThenCloseEyes; } @@ -821,7 +821,7 @@ void EnTrt_IdleAwake(EnTrt* this, PlayState* play) { if (player->transformation == PLAYER_FORM_HUMAN) { this->flags |= ENTRT_MET; } - EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 2); + EnTrt_ChangeAnim(&this->skelAnime, sAnimationInfo, 2); this->blinkFunc = EnTrt_EyesClosed; this->timer = 45; this->actionFunc = EnTrt_BeginInteraction; @@ -831,8 +831,8 @@ void EnTrt_IdleAwake(EnTrt* this, PlayState* play) { } if (DECR(this->timer) == 0) { this->timer = Rand_S16Offset(150, 100); - EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 2); - this->animationIndex = 2; + EnTrt_ChangeAnim(&this->skelAnime, sAnimationInfo, 2); + this->animIndex = 2; this->sleepSoundTimer = 10; this->actor.textId = 0; this->actionFunc = EnTrt_IdleSleeping; @@ -852,10 +852,10 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); } } else if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { - if (this->animationIndex != 5) { + if (this->animIndex != 5) { if (curFrame == animLastFrame) { - EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 3); - this->animationIndex = 3; + EnTrt_ChangeAnim(&this->skelAnime, sAnimationInfo, 3); + this->animIndex = 3; this->blinkFunc = EnTrt_OpenEyesThenSetToBlink; this->timer = 10; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; @@ -868,9 +868,9 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) { } } else if (DECR(this->timer) == 0) { this->timer = Rand_S16Offset(40, 20); - EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 5); + EnTrt_ChangeAnim(&this->skelAnime, sAnimationInfo, 5); Message_StartTextbox(play, this->textId, &this->actor); - this->animationIndex = 5; + this->animIndex = 5; switch (this->textId) { case 0x834: if (!(gSaveContext.save.weekEventReg[12] & 8) && !(gSaveContext.save.weekEventReg[84] & 0x40) && @@ -910,8 +910,8 @@ void EnTrt_Surprised(EnTrt* this, PlayState* play) { } } else if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { if (DECR(this->timer) == 0) { - EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 4); - this->animationIndex = 4; + EnTrt_ChangeAnim(&this->skelAnime, sAnimationInfo, 4); + this->animIndex = 4; this->blinkFunc = EnTrt_OpenEyes2; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_SURPRISED); this->timer = 30; @@ -919,9 +919,9 @@ void EnTrt_Surprised(EnTrt* this, PlayState* play) { } } else if (DECR(this->timer) == 0) { this->timer = Rand_S16Offset(40, 20); - EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 5); + EnTrt_ChangeAnim(&this->skelAnime, sAnimationInfo, 5); Message_StartTextbox(play, this->textId, &this->actor); - this->animationIndex = 5; + this->animIndex = 5; this->actionFunc = EnTrt_TryToGiveRedPotionAfterSurprised; } } diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.h b/src/overlays/actors/ovl_En_Trt/z_en_trt.h index 13af94bcc1..46f0707979 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.h +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.h @@ -41,7 +41,7 @@ typedef struct EnTrt { /* 0x3F0 */ Color_RGBAu32 cursorColor; /* 0x400 */ u8 drawCursor; /* 0x402 */ s16 timer; - /* 0x404 */ s16 animationIndex; + /* 0x404 */ s16 animIndex; /* 0x406 */ u16 textId; /* 0x408 */ u16 prevTextId; /* 0x40A */ u16 talkOptionTextId; diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c index 0dd9da893c..9e791dbeab 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -26,7 +26,7 @@ void func_80AD4FE4(EnTrt2* this, PlayState* play); void func_80AD5234(EnTrt2* this, PlayState* play); void func_80AD56E8(Actor* thisx, PlayState* play); -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_trt_Anim_00DE68, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &object_trt_Anim_00EE98, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, { &object_trt_Anim_00FD34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, @@ -170,7 +170,7 @@ void func_80AD3530(EnTrt2* this, PlayState* play) { if (DECR(this->unk_3AE) == 0) { this->unk_3AE = Rand_S16Offset(20, 20); - func_80AD3380(&this->skelAnime, sAnimations, 7); + func_80AD3380(&this->skelAnime, sAnimationInfo, 7); this->unk_3B2 = 5; } } @@ -277,7 +277,7 @@ void func_80AD3A24(EnTrt2* this, PlayState* play) { Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f); } else if (DECR(this->unk_3AE) == 0) { this->unk_3AE = Rand_S16Offset(100, 50); - func_80AD3380(&this->skelAnime, sAnimations, 6); + func_80AD3380(&this->skelAnime, sAnimationInfo, 6); this->unk_3B2 = 4; } Actor_MoveWithGravity(&this->actor); @@ -288,7 +288,7 @@ void func_80AD3AE4(EnTrt2* this, PlayState* play) { Math_ApproachF(&this->actor.velocity.y, 0.5f, 0.2f, 0.1f); } else { this->actor.velocity.y = 0.0f; - func_80AD3380(&this->skelAnime, sAnimations, 6); + func_80AD3380(&this->skelAnime, sAnimationInfo, 6); this->unk_3B2 = 4; } Actor_MoveWithGravity(&this->actor); @@ -298,7 +298,7 @@ void func_80AD3B6C(EnTrt2* this, PlayState* play) { if (DECR(this->unk_3B0) == 0) { this->unk_3B0 = 10; this->actor.velocity.y = -1.0f; - func_80AD3380(&this->skelAnime, sAnimations, 8); + func_80AD3380(&this->skelAnime, sAnimationInfo, 8); this->unk_3B2 = 8; } } @@ -311,7 +311,7 @@ void func_80AD3BE4(EnTrt2* this, PlayState* play) { this->actor.world.rot.y += this->unk_3C0; this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.world.pos.y < 5.0f) { - func_80AD3380(&this->skelAnime, sAnimations, 9); + func_80AD3380(&this->skelAnime, sAnimationInfo, 9); this->unk_3B2 = 9; } } @@ -335,7 +335,7 @@ void func_80AD3CEC(EnTrt2* this, PlayState* play) { } else if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - func_80AD3380(&this->skelAnime, sAnimations, 6); + func_80AD3380(&this->skelAnime, sAnimationInfo, 6); this->unk_3B2 = 4; } } @@ -436,7 +436,7 @@ void func_80AD417C(EnTrt2* this, PlayState* play) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; if (this->unk_3A8 == 0x84C) { - func_80AD3380(&this->skelAnime, sAnimations, 6); + func_80AD3380(&this->skelAnime, sAnimationInfo, 6); this->path = SubS_GetPathByIndex(play, ENTRT2_GET_FC00(&this->actor), 0x3F); this->unk_3B2 = 18; } else if (this->unk_3A8 == 0x88F) { @@ -510,7 +510,7 @@ void func_80AD4550(EnTrt2* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if ((player->transformation != PLAYER_FORM_HUMAN) && (player->transformation != PLAYER_FORM_FIERCE_DEITY)) { - func_80AD3380(&this->skelAnime, sAnimations, 7); + func_80AD3380(&this->skelAnime, sAnimationInfo, 7); this->unk_3B2 = 17; } @@ -665,7 +665,7 @@ s32 func_80AD4B4C(EnTrt2* this, PlayState* play) { } else { this->unk_3A8 = 0x84F; this->unk_3D8 = true; - func_80AD3380(&this->skelAnime, sAnimations, 7); + func_80AD3380(&this->skelAnime, sAnimationInfo, 7); this->unk_3B2 = 7; } } diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index 931348c612..903e00c5d7 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -106,7 +106,7 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 20, 0, 0, MASS_IMMOVABLE }; -static AnimationInfoS D_80A8B2D8[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_tru_Anim_00F9A0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_tru_Anim_00F9A0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_tru_Anim_0108AC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, @@ -424,7 +424,7 @@ s32 func_80A86924(EnTru* this, s32 arg1) { if (arg1 != this->unk_37C) { this->unk_37C = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80A8B2D8, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); this->unk_358 = this->skelAnime.playSpeed; } diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c index a9a3ae6ae0..ac772a9404 100644 --- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c +++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c @@ -87,7 +87,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static AnimationInfoS D_80B7755C[] = { +static AnimationInfoS sAnimationInfo[] = { { &object_tru_Anim_00F9A0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &object_tru_Anim_00F9A0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &object_tru_Anim_0108AC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, @@ -115,19 +115,19 @@ s32 func_80B76030(SkelAnime* skelAnime, s16 arg1) { s16 startFrame; s32 ret = false; - if ((arg1 >= 0) && (arg1 < ARRAY_COUNT(D_80B7755C))) { - endFrame = D_80B7755C[arg1].frameCount; + if ((arg1 >= 0) && (arg1 < ARRAY_COUNT(sAnimationInfo))) { + endFrame = sAnimationInfo[arg1].frameCount; if (endFrame < 0) { - endFrame = Animation_GetLastFrame(D_80B7755C[arg1].animation); + endFrame = Animation_GetLastFrame(sAnimationInfo[arg1].animation); } - startFrame = D_80B7755C[arg1].startFrame; + startFrame = sAnimationInfo[arg1].startFrame; if (startFrame < 0) { - startFrame = Animation_GetLastFrame(D_80B7755C[arg1].animation); + startFrame = Animation_GetLastFrame(sAnimationInfo[arg1].animation); } - Animation_Change(skelAnime, D_80B7755C[arg1].animation, D_80B7755C[arg1].playSpeed, startFrame, endFrame, - D_80B7755C[arg1].mode, D_80B7755C[arg1].morphFrames); + Animation_Change(skelAnime, sAnimationInfo[arg1].animation, sAnimationInfo[arg1].playSpeed, startFrame, + endFrame, sAnimationInfo[arg1].mode, sAnimationInfo[arg1].morphFrames); ret = true; } return ret; diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c index d694d186c8..d0fda7dfd9 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -29,7 +29,7 @@ void EnYb_TeachingDance(EnYb* this, PlayState* play); void EnYb_WaitForMidnight(EnYb* this, PlayState* play); void EnYb_ActorShadowFunc(Actor* thisx, Lights* mapper, PlayState* play); -void EnYb_SetAnimation(PlayState*, EnYb*, s16, u8, f32); +void EnYb_ChangeAnim(PlayState* play, EnYb* this, s16 animIndex, u8 animMode, f32 morphFrames); s32 EnYb_CanTalk(EnYb* this, PlayState* play); const ActorInit En_Yb_InitVars = { @@ -93,11 +93,11 @@ void EnYb_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actionFunc = EnYb_Idle; - this->currentAnimIndex = 3; // gets overwritten to 2 in EnYb_SetAnimation later + this->animIndex = 3; // gets overwritten to 2 in EnYb_ChangeAnim later this->actor.terminalVelocity = -9.0f; this->actor.gravity = -1.0f; - EnYb_SetAnimation(play, this, 2, ANIMMODE_LOOP, 0.0f); + EnYb_ChangeAnim(play, this, 2, ANIMMODE_LOOP, 0.0f); tempCutscene = this->actor.cutscene; for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) { @@ -147,7 +147,7 @@ void EnYb_ActorShadowFunc(Actor* thisx, Lights* mapper, PlayState* play) { EnYb* this = THIS; if (this->alpha > 0) { - if (this->currentAnimIndex == 2) { + if (this->animIndex == 2) { f32 tempScale = (((27.0f - this->shadowPos.y) + this->actor.world.pos.y) * ((1 / 2.25f) * 0.001f)) + 0.01f; this->actor.scale.x = tempScale; } @@ -167,19 +167,19 @@ void EnYb_ActorShadowFunc(Actor* thisx, Lights* mapper, PlayState* play) { } } -void EnYb_SetAnimation(PlayState* play, EnYb* this, s16 animIndex, u8 animMode, f32 transitionRate) { +void EnYb_ChangeAnim(PlayState* play, EnYb* this, s16 animIndex, u8 animMode, f32 morphFrames) { if (animIndex >= 0 && animIndex < 3) { - if (animIndex != this->currentAnimIndex || animMode != ANIMMODE_LOOP) { + if (animIndex != this->animIndex || animMode != ANIMMODE_LOOP) { if (animIndex > 0) { if (animMode == ANIMMODE_LOOP) { LinkAnimation_Change(play, &this->skelAnime, gLinkAnimations[animIndex - 1], 1.0f, 0.0f, Animation_GetLastFrame(gLinkAnimations[animIndex - 1]), ANIMMODE_LOOP, - transitionRate); + morphFrames); } else { // unused case, (only called once with animMode = ANIMMODE_LOOP) LinkAnimation_Change(play, &this->skelAnime, gLinkAnimations[animIndex - 1], 1.0f, 0.0f, Animation_GetLastFrame(gLinkAnimations[animIndex - 1]), ANIMMODE_LOOP, - transitionRate); + morphFrames); } } else { // unused case, (only called once with animIndex = 2) @@ -188,9 +188,9 @@ void EnYb_SetAnimation(PlayState* play, EnYb* this, s16 animIndex, u8 animMode, if (1) {} Animation_Change(&this->skelAnime, gYbUnusedAnimations[animIndex], 1.0f, 0.0f, - Animation_GetLastFrame(animationPtr), animMode, transitionRate); + Animation_GetLastFrame(animationPtr), animMode, morphFrames); } - this->currentAnimIndex = animIndex; + this->animIndex = animIndex; } } } @@ -205,7 +205,7 @@ s32 EnYb_CanTalk(EnYb* this, PlayState* play) { } void EnYb_UpdateAnimation(EnYb* this, PlayState* play) { - if (this->currentAnimIndex <= 0) { + if (this->animIndex <= 0) { SkelAnime_Update(&this->skelAnime); } else { LinkAnimation_Update(play, &this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.h b/src/overlays/actors/ovl_En_Yb/z_en_yb.h index 72d92d817c..c7b977653b 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.h +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.h @@ -18,7 +18,7 @@ typedef struct EnYb { /* 0x3B8 */ ColliderCylinder collider; /* 0x404 */ Vec3f shadowPos; /* 0x410 */ u16 playerOcarinaOut; - /* 0x412 */ s16 currentAnimIndex; + /* 0x412 */ s16 animIndex; /* 0x414 */ s16 alpha; /* 0x416 */ s16 cutscenes[2]; /* 0x41A */ s16 cutsceneIndex; 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 68051705ef..c4bf8f56dc 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -88,7 +88,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0), }; -static AnimationInfoS sAnimations[] = { +static AnimationInfoS sAnimationInfo[] = { { &gZoraIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, { &gZoraIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, { &gZoraSurfacingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, @@ -102,19 +102,19 @@ s8 sBodyParts[] = { -1, 1, 12, 13, 14, 9, 10, 11, 0, 6, 7, 8, 3, 4, 5, 2, -1, -1 s8 sParentBodyParts[] = { 0, 0, 0, 0, 3, 4, 0, 6, 7, 0, 9, 10, 0, 12, 13 }; u8 sShadowSizes[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -s32 EnZo_SetAnimation(SkelAnime* skelAnime, s16 index) { +s32 EnZo_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) { s16 frameCount; s32 didChange = false; - if ((index >= 0) && (index < ARRAY_COUNT(sAnimations))) { + if ((animIndex >= 0) && (animIndex < ARRAY_COUNT(sAnimationInfo))) { didChange = true; - frameCount = sAnimations[index].frameCount; + frameCount = sAnimationInfo[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(sAnimations[index].animation); + frameCount = Animation_GetLastFrame(sAnimationInfo[animIndex].animation); } - Animation_Change(skelAnime, sAnimations[index].animation, sAnimations[index].playSpeed, - sAnimations[index].startFrame, frameCount, sAnimations[index].mode, - sAnimations[index].morphFrames); + Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed, + sAnimationInfo[animIndex].startFrame, frameCount, sAnimationInfo[animIndex].mode, + sAnimationInfo[animIndex].morphFrames); } return didChange; } @@ -206,7 +206,7 @@ void EnZo_LookAtPlayer(EnZo* this, PlayState* play) { void EnZo_Walk(EnZo* this, PlayState* play) { if (ENZO_GET_PATH(&this->actor) != 0x3F) { - EnZo_SetAnimation(&this->skelAnime, 6); + EnZo_ChangeAnim(&this->skelAnime, 6); } if (ENZO_GET_PATH(&this->actor) != 0x3F) { @@ -230,7 +230,7 @@ void EnZo_FollowPath(EnZo* this, PlayState* play) { } if (this->actor.depthInWater > 60.0f) { - EnZo_SetAnimation(&this->skelAnime, 1); + EnZo_ChangeAnim(&this->skelAnime, 1); this->actionFunc = EnZo_TreadWater; this->actor.gravity = 0.0f; this->actor.speedXZ = 0.0f; @@ -257,7 +257,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, ZORA_LIMB_MAX); - EnZo_SetAnimation(&this->skelAnime, 0); + EnZo_ChangeAnim(&this->skelAnime, 0); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index a033d006dc..dc4270bf2c 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -58,7 +58,7 @@ void ObjUm_Update(Actor* thisx, PlayState* play); void ObjUm_Draw(Actor* thisx, PlayState* play); void ObjUm_DefaultAnim(ObjUm* this, PlayState* play); -void ObjUm_UpdateAnim(ObjUm* this, PlayState* play, ObjUmAnimimations index); +void ObjUm_ChangeAnim(ObjUm* this, PlayState* play, ObjUmAnimation index); void ObjUm_SetupAction(ObjUm* this, ObjUmActionFunc actionFunc); const ActorInit Obj_Um_InitVars = { @@ -992,7 +992,7 @@ void ObjUm_RanchWait(ObjUm* this, PlayState* play) { this->dyna.actor.flags |= ACTOR_FLAG_1; SkelAnime_Update(&this->skelAnime); - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_IDLE); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); this->flags |= OBJ_UM_FLAG_WAITING; if ((gSaveContext.save.time > CLOCK_TIME(18, 0)) && (gSaveContext.save.time <= CLOCK_TIME(19, 0))) { if (!(player->stateFlags1 & PLAYER_STATE1_800000)) { @@ -1121,9 +1121,9 @@ ObjUmPathState ObjUm_UpdatePath(ObjUm* this, PlayState* play) { } } - if (this->currentAnimIndex == OBJ_UM_ANIM_TROT) { + if (this->animIndex == OBJ_UM_ANIM_TROT) { this->dyna.actor.speedXZ = 4.0f; - } else if (this->currentAnimIndex == OBJ_UM_ANIM_GALLOP) { + } else if (this->animIndex == OBJ_UM_ANIM_GALLOP) { this->dyna.actor.speedXZ = 8.0f; } @@ -1133,7 +1133,7 @@ ObjUmPathState ObjUm_UpdatePath(ObjUm* this, PlayState* play) { void ObjUm_RanchWaitPathFinished(ObjUm* this, PlayState* play) { this->wheelRot += 0x3E8; this->flags &= ~OBJ_UM_FLAG_WAITING; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_TROT); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_TROT); switch (ObjUm_UpdatePath(this, play)) { case OBJUM_PATH_STATE_1: @@ -1156,7 +1156,7 @@ void ObjUm_RanchWaitPathFinished(ObjUm* this, PlayState* play) { } void ObjUm_RanchStartCs(ObjUm* this, PlayState* play) { - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_IDLE); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); @@ -1185,9 +1185,9 @@ void func_80B7A070(ObjUm* this, PlayState* play) { } void func_80B7A0E0(ObjUm* this, PlayState* play) { - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_IDLE); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); if (gSaveContext.save.time != this->lastTime) { - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_TROT); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_TROT); ObjUm_SetupAction(this, func_80B7A070); } } @@ -1199,7 +1199,7 @@ void func_80B7A144(ObjUm* this, PlayState* play) { this->flags |= OBJ_UM_FLAG_0100; this->flags |= OBJ_UM_FLAG_0004; player->stateFlags1 |= PLAYER_STATE1_20; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_IDLE); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); ObjUm_SetupAction(this, ObjUm_RanchStartCs); } @@ -1227,7 +1227,7 @@ void ObjUm_PreMilkRunDialogueHandler(ObjUm* this, PlayState* play) { } void func_80B7A240(ObjUm* this, PlayState* play) { - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_IDLE); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); if (gSaveContext.save.time != this->lastTime) { ObjUm_SetupAction(this, func_80B7A2AC); } @@ -1238,7 +1238,7 @@ void func_80B7A240(ObjUm* this, PlayState* play) { void func_80B7A2AC(ObjUm* this, PlayState* play) { this->wheelRot += 0x3E8; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_TROT); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_TROT); switch (ObjUm_UpdatePath(this, play)) { case OBJUM_PATH_STATE_1: @@ -1265,7 +1265,7 @@ void func_80B7A394(ObjUm* this, PlayState* play) { ObjUm_SetPlayerPosition(this, play); this->flags |= OBJ_UM_FLAG_0004; if (gSaveContext.save.time != this->lastTime) { - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_TROT); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_TROT); ObjUm_SetupAction(this, func_80B7A2AC); } } @@ -1290,7 +1290,7 @@ void ObjUm_RunMinigame(ObjUm* this, PlayState* play) { ObjUm_RotatePlayer(this, play, 0x7FFF); this->wheelRot += 0x7D0; this->flags |= OBJ_UM_FLAG_0010; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_GALLOP); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_GALLOP); switch (ObjUm_UpdatePath(this, play)) { case OBJUM_PATH_STATE_1: @@ -1333,7 +1333,7 @@ void func_80B7A614(ObjUm* this, PlayState* play) { this->wheelRot += 0x7D0; this->flags |= OBJ_UM_FLAG_0010; this->flags |= OBJ_UM_FLAG_PLAYING_MINIGAME; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_GALLOP); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_GALLOP); if (ObjUm_UpdatePath(this, play) == OBJUM_PATH_STATE_3 && this->unk_4DC == 0) { this->unk_4DC = 1; @@ -1387,7 +1387,7 @@ void func_80B7A7AC(ObjUm* this, PlayState* play) { this->flags |= OBJ_UM_FLAG_0010; func_80B78DF0(this, play); this->flags |= 4; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_GALLOP); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_GALLOP); ObjUm_SetupAction(this, func_80B7A614); } @@ -1488,7 +1488,7 @@ void func_80B7A860(ObjUm* this, PlayState* play) { } void func_80B7AB78(ObjUm* this, PlayState* play) { - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_IDLE); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); if (gSaveContext.save.time != this->lastTime) { ObjUm_SetupAction(this, func_80B7ABE4); } @@ -1500,7 +1500,7 @@ void func_80B7AB78(ObjUm* this, PlayState* play) { void func_80B7ABE4(ObjUm* this, PlayState* play) { this->wheelRot += 0x3E8; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_TROT); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_TROT); switch (ObjUm_UpdatePath(this, play)) { case OBJUM_PATH_STATE_FINISH: func_80B79524(this); @@ -1543,7 +1543,7 @@ void ObjUm_PostMilkRunWaitPathFinished(ObjUm* this, PlayState* play) { ObjUm_RotatePlayer(this, play, 0); this->flags |= OBJ_UM_FLAG_0004; this->wheelRot += 0x3E8; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_TROT); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_TROT); if ((ObjUm_UpdatePath(this, play) == OBJUM_PATH_STATE_4) && !(gSaveContext.save.weekEventReg[59] & 2)) { ActorCutscene_Stop(this->dyna.actor.cutscene); @@ -1566,7 +1566,7 @@ void ObjUm_PostMilkRunStartCs(ObjUm* this, PlayState* play) { ObjUm_SetPlayerPosition(this, play); ObjUm_RotatePlayer(this, play, 0); this->flags |= OBJ_UM_FLAG_0004; - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_IDLE); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); @@ -1577,7 +1577,7 @@ void ObjUm_PostMilkRunStartCs(ObjUm* this, PlayState* play) { } void ObjUm_TerminaFieldIdle(ObjUm* this, PlayState* play) { - ObjUm_UpdateAnim(this, play, OBJ_UM_ANIM_IDLE); + ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); SkelAnime_Update(&this->skelAnime); } @@ -1627,7 +1627,7 @@ void func_80B7AF30(ObjUm* this, PlayState* play) { void ObjUm_DefaultAnim(ObjUm* this, PlayState* play) { Animation_PlayOnce(&this->skelAnime, &gUmTrotAnim); - this->currentAnimIndex = OBJ_UM_ANIM_TROT; + this->animIndex = OBJ_UM_ANIM_TROT; } typedef struct { @@ -1643,45 +1643,45 @@ struct_80B7C25C sUmAnims[] = { { &gUmLookBackAnim, false }, // OBJ_UM_ANIM_LOOK_BACK }; -void ObjUm_UpdateAnim(ObjUm* this, PlayState* play, ObjUmAnimimations index) { +void ObjUm_ChangeAnim(ObjUm* this, PlayState* play, ObjUmAnimation animIndex) { s32 changeAnim; s32 temp; - s32 indexTemp = index; + s32 indexTemp = animIndex; f32 animPlaybackSpeed = 0.0f; - if (sUmAnims[index].doesMove) { + if (sUmAnims[animIndex].doesMove) { this->flags |= OBJ_UM_FLAG_MOVING; } else { this->flags &= ~OBJ_UM_FLAG_MOVING; } - if (index == OBJ_UM_ANIM_TROT) { + if (animIndex == OBJ_UM_ANIM_TROT) { animPlaybackSpeed = this->dyna.actor.speedXZ * 0.25f; - } else if (index == OBJ_UM_ANIM_GALLOP) { + } else if (animIndex == OBJ_UM_ANIM_GALLOP) { animPlaybackSpeed = this->dyna.actor.speedXZ * 0.2f; - } else if (index == OBJ_UM_ANIM_IDLE) { + } else if (animIndex == OBJ_UM_ANIM_IDLE) { animPlaybackSpeed = 1.0f; } this->skelAnime.playSpeed = animPlaybackSpeed; if (this->flags & OBJ_UM_FLAG_LOOK_BACK) { this->skelAnime.playSpeed = 1.0f; - index = OBJ_UM_ANIM_MINUS_1; + animIndex = OBJ_UM_ANIM_MINUS_1; } - changeAnim = (index != this->currentAnimIndex); + changeAnim = (animIndex != this->animIndex); if (SkelAnime_Update(&this->skelAnime) || changeAnim) { - this->currentAnimIndex = index; + this->animIndex = animIndex; - if (index != OBJ_UM_ANIM_MINUS_1) { + if (animIndex != OBJ_UM_ANIM_MINUS_1) { if (this->donkey != NULL) { - this->donkey->unk_538 = index; + this->donkey->unk_538 = animIndex; } if (changeAnim) { - Animation_MorphToPlayOnce(&this->skelAnime, sUmAnims[index].anim, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, sUmAnims[animIndex].anim, -3.0f); } else { - Animation_PlayOnce(&this->skelAnime, sUmAnims[index].anim); + Animation_PlayOnce(&this->skelAnime, sUmAnims[animIndex].anim); } } else { EnHorse* donkey = this->donkey; @@ -1691,10 +1691,10 @@ void ObjUm_UpdateAnim(ObjUm* this, PlayState* play, ObjUmAnimimations index) { } if (changeAnim) { - temp = 3 - index; // OBJ_UM_ANIM_LOOK_BACK + temp = 3 - animIndex; // OBJ_UM_ANIM_LOOK_BACK Animation_MorphToPlayOnce(&this->skelAnime, sUmAnims[temp].anim, -10.0f); } else { - temp = 3 - index; // OBJ_UM_ANIM_LOOK_BACK + temp = 3 - animIndex; // OBJ_UM_ANIM_LOOK_BACK Animation_PlayOnce(&this->skelAnime, sUmAnims[temp].anim); } } diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.h b/src/overlays/actors/ovl_Obj_Um/z_obj_um.h index 9d228eda85..74eb5f5216 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.h +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.h @@ -11,14 +11,14 @@ typedef void (*ObjUmActionFunc)(struct ObjUm*, PlayState*); #define MILK_POTS_COUNT 3 -typedef enum ObjUmAnimimations { +typedef enum ObjUmAnimation { /* -1 */ OBJ_UM_ANIM_MINUS_1 = -1, /* 0 */ OBJ_UM_ANIM_TROT, /* 1 */ OBJ_UM_ANIM_GALLOP, /* 2 */ OBJ_UM_ANIM_IDLE, /* 3 */ OBJ_UM_ANIM_3, // NULL pointer /* 4 */ OBJ_UM_ANIM_LOOK_BACK -} ObjUmAnimimations; +} ObjUmAnimation; typedef struct ObjUm { /* 0x000 */ DynaPolyActor dyna; @@ -40,7 +40,7 @@ typedef struct ObjUm { /* 0x2F4 */ s32 flags; /* 0x2BC */ Vec3s unk_2F8; /* 0x2FE */ Vec3s unk_2FE; - /* 0x304 */ ObjUmAnimimations currentAnimIndex; + /* 0x304 */ ObjUmAnimation animIndex; /* 0x308 */ Vec3f unk_308; /* 0x314 */ s32 potsLife[MILK_POTS_COUNT]; /* 0x320 */ s32 wasPotHit[MILK_POTS_COUNT]; // resets to false in the same frame diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 8ccdfa4b9d..33fb3cd4c0 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -6703,7 +6703,7 @@ 0x808F25A4:("EnKarebaba_Update",), 0x808F280C:("func_808F280C",), 0x808F28F8:("EnKarebaba_Draw",), - 0x808F30B0:("func_808F30B0",), + 0x808F30B0:("EnIn_ChangeAnim",), 0x808F3178:("func_808F3178",), 0x808F322C:("func_808F322C",), 0x808F32A0:("func_808F32A0",), @@ -7539,7 +7539,7 @@ 0x809455A0:("ItemInbox_Draw",), 0x80945650:("EnGe1_Init",), 0x809457C0:("EnGe1_Destroy",), - 0x809457EC:("EnGe1_SetAnimation",), + 0x809457EC:("EnGe1_ChangeAnim",), 0x80945924:("EnGe1_LookAtPlayer",), 0x80945A00:("EnGe1_ShadowDraw",), 0x80945A9C:("EnGe1_SetupPath",), @@ -8016,7 +8016,7 @@ 0x8096F4DC:("BgF40Swlift_Draw",), 0x8096F5E0:("EnKakasi_Destroy",), 0x8096F60C:("EnKakasi_Init",), - 0x8096F800:("EnKakasi_SetAnimation",), + 0x8096F800:("EnKakasi_ChangeAnim",), 0x8096F88C:("EnKakasi_ValidatePictograph",), 0x8096F8D8:("func_8096F8D8",), 0x8096FA18:("func_8096FA18",), @@ -8083,7 +8083,7 @@ 0x80974118:("EnSsh_AddBlureVertex",), 0x80974220:("EnSsh_AddBlureSpace",), 0x8097424C:("EnSsh_InitColliders",), - 0x80974374:("EnSsh_SetAnimation",), + 0x80974374:("EnSsh_ChangeAnim",), 0x809744A8:("EnSsh_SetWaitAnimation",), 0x809744C8:("EnSsh_SetReturnAnimation",), 0x809744FC:("EnSsh_SetLandAnimation",), @@ -8305,7 +8305,7 @@ 0x80987A3C:("OceffWipe3_Destroy",), 0x80987A70:("OceffWipe3_Update",), 0x80987AD0:("OceffWipe3_Draw",), - 0x80989140:("EnDg_ChangeAnimation",), + 0x80989140:("EnDg_ChangeAnim",), 0x80989204:("EnDg_UpdateCollision",), 0x8098933C:("EnDg_GetFloorRot",), 0x80989418:("EnDg_HasReachedPoint",), @@ -8615,7 +8615,7 @@ 0x8099D7DC:("OceffWipe4_Destroy",), 0x8099D810:("OceffWipe4_Update",), 0x8099D870:("OceffWipe4_Draw",), - 0x8099E790:("EnZo_SetAnimation",), + 0x8099E790:("EnZo_ChangeAnim",), 0x8099E858:("EnZo_PlayWalkingSound",), 0x8099E96C:("EnZo_Blink",), 0x8099E9E0:("EnZo_UpdateCollider",), @@ -9749,7 +9749,7 @@ 0x80A16D6C:("EnRaf_ClearPixelPetal",), 0x80A16D90:("EnRaf_Init",), 0x80A17018:("EnRaf_Destroy",), - 0x80A17060:("EnRaf_ChangeAnimation",), + 0x80A17060:("EnRaf_ChangeAnim",), 0x80A1712C:("EnRaf_SetupIdle",), 0x80A171D8:("EnRaf_Idle",), 0x80A17414:("EnRaf_SetupGrab",), @@ -10090,7 +10090,7 @@ 0x80A2CF50:("func_80A2CF50",), 0x80A2CF7C:("func_80A2CF7C",), 0x80A2D0FC:("ElfMsg3_Update",), - 0x80A2D280:("EnFg_UpdateAnimation",), + 0x80A2D280:("EnFg_ChangeAnim",), 0x80A2D348:("func_80A2D348",), 0x80A2D3D4:("func_80A2D3D4",), 0x80A2D400:("func_80A2D400",), @@ -11464,7 +11464,7 @@ 0x80A9FB54:("DmOpstage_Update",), 0x80A9FBB8:("DmOpstage_Draw",), 0x80A9FDB0:("DmStk_LoadObjectForAnimation",), - 0x80A9FE3C:("DmStk_ChangeAnimation",), + 0x80A9FE3C:("DmStk_ChangeAnim",), 0x80A9FED8:("DmStk_PlaySfxForIntroCutsceneFirstPart",), 0x80AA00CC:("DmStk_PlaySfxForTitleCutscene",), 0x80AA0100:("DmStk_PlaySfxForIntroCutsceneSecondPart",), @@ -11547,7 +11547,7 @@ 0x80AA90F4:("func_80AA90F4",), 0x80AA9140:("DmChar01_Update",), 0x80AA922C:("DmChar01_Draw",), - 0x80AAAE30:("DmChar02_ChangeAnimation",), + 0x80AAAE30:("DmChar02_ChangeAnim",), 0x80AAAECC:("DmChar02_PlaySfxForDroppingOcarinaCutscene",), 0x80AAAF2C:("DmChar02_PlaySfxForCutscenes",), 0x80AAAF78:("DmChar02_Init",), @@ -11558,7 +11558,7 @@ 0x80AAB258:("DmChar02_PostLimbDraw",), 0x80AAB270:("DmChar02_TransformLimbDraw",), 0x80AAB284:("DmChar02_Draw",), - 0x80AAB4A0:("DmChar03_ChangeAnimation",), + 0x80AAB4A0:("DmChar03_ChangeAnim",), 0x80AAB53C:("DmChar03_Init",), 0x80AAB5E8:("DmChar03_Destroy",), 0x80AAB5F8:("func_80AAB5F8",), @@ -12865,12 +12865,12 @@ 0x80B00F08:("EnTalkGibud_OverrideLimbDraw",), 0x80B00F64:("EnTalkGibud_PostLimbDraw",), 0x80B01040:("EnTalkGibud_Draw",), - 0x80B01990:("EnGiant_ChangeAnimation",), + 0x80B01990:("EnGiant_ChangeAnim",), 0x80B01A74:("EnGiant_IsImprisoned",), 0x80B01B30:("EnGiant_Init",), 0x80B01E74:("EnGiant_Destroy",), 0x80B01E84:("EnGiant_ChangeToStartOrLoopAnimation",), - 0x80B01EE8:("EnGiant_ChangeAnimationBasedOnCsAction",), + 0x80B01EE8:("EnGiant_ChangeAnimBasedOnCsAction",), 0x80B020A0:("EnGiant_UpdateAlpha",), 0x80B0211C:("EnGiant_PlayAndUpdateAnimation",), 0x80B02234:("EnGiant_PlaySound",), @@ -13277,7 +13277,7 @@ 0x80B23F50:("ObjWind_Destroy",), 0x80B23F60:("ObjWind_Update",), 0x80B243C0:("ObjWind_Draw",), - 0x80B24630:("EnRacedog_ChangeAnimation",), + 0x80B24630:("EnRacedog_ChangeAnim",), 0x80B246F4:("EnRacedog_UpdateCollision",), 0x80B2478C:("EnRacedog_GetYRotation",), 0x80B248B8:("EnRacedog_GetFloorRot",), @@ -14130,7 +14130,7 @@ 0x80B5E1D8:("func_80B5E1D8",), 0x80B5E890:("EnDragon_Init",), 0x80B5EA74:("EnDragon_Destroy",), - 0x80B5EAA0:("EnDragon_ChangeAnimation",), + 0x80B5EAA0:("EnDragon_ChangeAnim",), 0x80B5EB40:("EnDragon_SpawnBubbles",), 0x80B5ED90:("EnDragon_RetreatOnceTimerEnds",), 0x80B5EDF0:("EnDragon_SetupRetreatOrIdle",), @@ -14508,7 +14508,7 @@ 0x80B7AEFC:("ObjUm_TerminaFieldIdle",), 0x80B7AF30:("func_80B7AF30",), 0x80B7B154:("ObjUm_DefaultAnim",), - 0x80B7B18C:("ObjUm_UpdateAnim",), + 0x80B7B18C:("ObjUm_ChangeAnim",), 0x80B7B368:("ObjUm_Update",), 0x80B7B598:("ObjUm_OverrideLimbDraw",), 0x80B7B93C:("ObjUm_SpawnFragments",), @@ -15577,7 +15577,7 @@ 0x80BC61D0:("EnPoComposer_Draw",), 0x80BC6BF0:("EnGuruguru_Init",), 0x80BC6D28:("EnGuruguru_Destroy",), - 0x80BC6D64:("EnGuruguru_ChangeAnimation",), + 0x80BC6D64:("EnGuruguru_ChangeAnim",), 0x80BC6E00:("EnGuruguru_DoNothing",), 0x80BC6E10:("func_80BC6E10",), 0x80BC6F14:("func_80BC6F14",), @@ -16148,7 +16148,7 @@ 0x80BE8390:("EnMuto_Draw",), 0x80BE84F0:("EnBaisen_Init",), 0x80BE8664:("EnBaisen_Destroy",), - 0x80BE8690:("EnBaisen_ChangeAnimation",), + 0x80BE8690:("EnBaisen_ChangeAnim",), 0x80BE871C:("func_80BE871C",), 0x80BE87B0:("func_80BE87B0",), 0x80BE87FC:("func_80BE87FC",), @@ -16161,7 +16161,7 @@ 0x80BE8D94:("EnBaisen_Draw",), 0x80BE8F20:("EnHeishi_Init",), 0x80BE9090:("EnHeishi_Destroy",), - 0x80BE90BC:("EnHeishi_ChangeAnimation",), + 0x80BE90BC:("EnHeishi_ChangeAnim",), 0x80BE9148:("EnHeishi_SetHeadRotation",), 0x80BE91DC:("EnHeishi_SetupIdle",), 0x80BE9214:("EnHeishi_Idle",), @@ -16170,7 +16170,7 @@ 0x80BE93D8:("EnHeishi_Draw",), 0x80BE9510:("EnDemoheishi_Init",), 0x80BE95C0:("EnDemoheishi_Destroy",), - 0x80BE95EC:("EnDemoheishi_ChangeAnimation",), + 0x80BE95EC:("EnDemoheishi_ChangeAnim",), 0x80BE9678:("EnDemoheishi_SetHeadRotation",), 0x80BE970C:("EnDemoheishi_SetupIdle",), 0x80BE975C:("EnDemoheishi_Idle",), @@ -16380,7 +16380,7 @@ 0x80BFA2D0:("EnYb_Destroy",), 0x80BFA2FC:("func_80BFA2FC",), 0x80BFA350:("EnYb_ActorShadowFunc",), - 0x80BFA444:("EnYb_SetAnimation",), + 0x80BFA444:("EnYb_ChangeAnim",), 0x80BFA5CC:("EnYb_CanTalk",), 0x80BFA634:("EnYb_UpdateAnimation",), 0x80BFA67C:("EnYb_FinishTeachingCutscene",), @@ -16437,7 +16437,7 @@ 0x80BFD158:("EnScopecoin_Update",), 0x80BFD17C:("EnScopecoin_Draw",), 0x80BFD2E0:("EnBjt_UpdateSkelAnime",), - 0x80BFD30C:("EnBjt_ChangeAnimation",), + 0x80BFD30C:("EnBjt_ChangeAnim",), 0x80BFD3A4:("EnBjt_UpdateCollision",), 0x80BFD434:("EnBjt_TakeItem",), 0x80BFD4FC:("EnBjt_Appear",), @@ -16930,7 +16930,7 @@ 0x80C1B9D4:("func_80C1B9D4",), 0x80C1BAC8:("EnFall2_Update",), 0x80C1BAEC:("EnFall2_Draw",), - 0x80C1BD90:("DmAl_ChangeAnimation",), + 0x80C1BD90:("DmAl_ChangeAnim",), 0x80C1BDD8:("func_80C1BDD8",), 0x80C1BF08:("DmAl_Init",), 0x80C1BFB8:("DmAl_Destroy",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 47521fcd3e..eaca8ea4bf 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -8529,7 +8529,7 @@ 0x80951C5C:("D_80951C5C","UNK_TYPE1","",0x1), 0x80951C88:("D_80951C88","UNK_TYPE1","",0x1), 0x80951CB4:("D_80951CB4","UNK_TYPE1","",0x1), - 0x80951CC0:("D_80951CC0","UNK_TYPE1","",0x1), + 0x80951CC0:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80951D90:("D_80951D90","UNK_TYPE1","",0x1), 0x80951D9C:("D_80951D9C","UNK_TYPE1","",0x1), 0x80951DA8:("D_80951DA8","UNK_TYPE1","",0x1), @@ -9868,7 +9868,7 @@ 0x809C1008:("D_809C1008","UNK_TYPE1","",0x1), 0x809C1010:("D_809C1010","f32","",0x4), 0x809C3770:("En_Aob_01_InitVars","UNK_TYPE1","",0x1), - 0x809C3790:("D_809C3790","UNK_TYPE4","",0x4), + 0x809C3790:("sAnimationInfo","UNK_TYPE4","",0x4), 0x809C3820:("D_809C3820","UNK_TYPE1","",0x1), 0x809C384C:("D_809C384C","UNK_TYPE4","",0x4), 0x809C392C:("D_809C392C","UNK_TYPE1","",0x1), @@ -9979,7 +9979,7 @@ 0x809CCD14:("D_809CCD14","f32","",0x4), 0x809CDC30:("En_Bji_01_InitVars","ActorInit","",0x20), 0x809CDC50:("D_809CDC50","UNK_TYPE1","",0x1), - 0x809CDC7C:("D_809CDC7C","UNK_TYPE1","",0x1), + 0x809CDC7C:("sAnimationInfo","UNK_TYPE1","",0x1), 0x809CDCBC:("D_809CDCBC","UNK_TYPE1","",0x1), 0x809CDCC8:("D_809CDCC8","UNK_TYPE1","",0x1), 0x809CDCD4:("D_809CDCD4","UNK_TYPE1","",0x1), @@ -11155,7 +11155,7 @@ 0x80A2E630:("D_80A2E630","f32","",0x4), 0x80A2E910:("Dm_Ravine_InitVars","UNK_TYPE1","",0x1), 0x80A2ECE0:("Dm_Sa_InitVars","UNK_TYPE1","",0x1), - 0x80A2ED00:("D_80A2ED00","UNK_TYPE1","",0x1), + 0x80A2ED00:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80A2ED20:("D_80A2ED20","f32","",0x4), 0x80A31AD0:("En_Slime_InitVars","UNK_TYPE1","",0x1), 0x80A31AF0:("D_80A31AF0","UNK_TYPE1","",0x1), @@ -11671,7 +11671,7 @@ 0x80A53444:("En_Dnq_InitVars","UNK_TYPE1","",0x1), 0x80A53464:("D_80A53464","UNK_TYPE1","",0x1), 0x80A53490:("D_80A53490","UNK_PTR","",0x4), - 0x80A5349C:("D_80A5349C","UNK_TYPE1","",0x1), + 0x80A5349C:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80A535DC:("D_80A535DC","UNK_TYPE1","",0x1), 0x80A535F0:("D_80A535F0","UNK_TYPE4","",0x4), 0x80A535FC:("D_80A535FC","UNK_TYPE1","",0x1), @@ -12342,7 +12342,7 @@ 0x80A8B280:("D_80A8B280","UNK_TYPE1","",0x1), 0x80A8B2A0:("D_80A8B2A0","UNK_TYPE1","",0x1), 0x80A8B2CC:("D_80A8B2CC","UNK_TYPE1","",0x1), - 0x80A8B2D8:("D_80A8B2D8","UNK_TYPE1","",0x1), + 0x80A8B2D8:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80A8B3D8:("D_80A8B3D8","UNK_TYPE1","",0x1), 0x80A8B3E4:("D_80A8B3E4","UNK_TYPE1","",0x1), 0x80A8B3F0:("D_80A8B3F0","UNK_TYPE1","",0x1), @@ -13173,7 +13173,7 @@ 0x80ADD940:("D_80ADD940","UNK_TYPE1","",0x1), 0x80ADD944:("En_Sellnuts_InitVars","UNK_TYPE1","",0x1), 0x80ADD964:("D_80ADD964","UNK_TYPE1","",0x1), - 0x80ADD990:("D_80ADD990","UNK_TYPE1","",0x1), + 0x80ADD990:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80ADDB00:("D_80ADDB00","UNK_TYPE1","",0x1), 0x80ADDB10:("jtbl_80ADDB10","UNK_PTR","",0x4), 0x80ADDB4C:("D_80ADDB4C","f32","",0x4), @@ -14287,7 +14287,7 @@ 0x80B3DED0:("D_80B3DED0","f32","",0x4), 0x80B3FBD0:("En_Dai_InitVars","UNK_TYPE1","",0x1), 0x80B3FBF0:("D_80B3FBF0","UNK_TYPE4","",0x4), - 0x80B3FBFC:("D_80B3FBFC","UNK_TYPE1","",0x1), + 0x80B3FBFC:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80B3FC8C:("D_80B3FC8C","UNK_TYPE1","",0x1), 0x80B3FCB4:("D_80B3FCB4","UNK_TYPE4","",0x4), 0x80B3FCE4:("D_80B3FCE4","UNK_TYPE4","",0x4), @@ -14980,7 +14980,7 @@ 0x80B774F0:("En_Tru_Mt_InitVars","UNK_TYPE1","",0x1), 0x80B77510:("D_80B77510","UNK_TYPE1","",0x1), 0x80B7753C:("D_80B7753C","UNK_TYPE1","",0x1), - 0x80B7755C:("D_80B7755C","UNK_TYPE1","",0x1), + 0x80B7755C:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80B7765C:("D_80B7765C","UNK_TYPE1","",0x1), 0x80B77668:("D_80B77668","UNK_TYPE1","",0x1), 0x80B77674:("D_80B77674","UNK_TYPE4","",0x4), @@ -15700,9 +15700,9 @@ 0x80BC7960:("En_Guruguru_InitVars","UNK_TYPE1","",0x1), 0x80BC7980:("D_80BC7980","UNK_TYPE1","",0x1), 0x80BC79A0:("D_80BC79A0","UNK_TYPE1","",0x1), - 0x80BC79CC:("D_80BC79CC","UNK_TYPE1","",0x1), - 0x80BC79D4:("D_80BC79D4","UNK_TYPE1","",0x1), - 0x80BC79D8:("D_80BC79D8","UNK_TYPE1","",0x1), + 0x80BC79CC:("sAnimations","UNK_TYPE1","",0x1), + 0x80BC79D4:("sAnimationModes","UNK_TYPE1","",0x1), + 0x80BC79D8:("sPlaySpeeds","UNK_TYPE1","",0x1), 0x80BC79E0:("D_80BC79E0","UNK_TYPE1","",0x1), 0x80BC79E8:("D_80BC79E8","UNK_TYPE1","",0x1), 0x80BC7EF0:("Oceff_Wipe5_InitVars","UNK_TYPE1","",0x1), @@ -16059,17 +16059,17 @@ 0x80BE8DF0:("En_Baisen_InitVars","UNK_TYPE1","",0x1), 0x80BE8E10:("D_80BE8E10","UNK_TYPE1","",0x1), 0x80BE8E3C:("D_80BE8E3C","UNK_TYPE1","",0x1), - 0x80BE8E4C:("D_80BE8E4C","UNK_TYPE1","",0x1), + 0x80BE8E4C:("sAnimations","UNK_TYPE1","",0x1), 0x80BE8E58:("D_80BE8E58","UNK_TYPE1","",0x1), 0x80BE9430:("En_Heishi_InitVars","UNK_TYPE1","",0x1), 0x80BE9450:("sCylinderInit","UNK_TYPE1","",0x1), 0x80BE947C:("sAnimations","UNK_TYPE1","",0x1), - 0x80BE9490:("sAnimModes","UNK_TYPE1","",0x1), + 0x80BE9490:("sAnimationModes","UNK_TYPE1","",0x1), 0x80BE9A30:("En_Demo_heishi_InitVars","UNK_TYPE1","",0x1), 0x80BE9A50:("sCylinderInit","UNK_TYPE1","",0x1), 0x80BE9A7C:("sTextIds","UNK_TYPE1","",0x1), 0x80BE9A80:("sAnimations","UNK_TYPE1","",0x1), - 0x80BE9A94:("sAnimModes","UNK_TYPE1","",0x1), + 0x80BE9A94:("sAnimationModes","UNK_TYPE1","",0x1), 0x80BEB1B0:("En_Dt_InitVars","UNK_TYPE1","",0x1), 0x80BEB1D0:("D_80BEB1D0","UNK_TYPE1","",0x1), 0x80BEB208:("D_80BEB208","UNK_TYPE1","",0x1), @@ -16314,7 +16314,7 @@ 0x80C058A0:("sTextIds","u16","",0x1), 0x80C058B0:("sCylinderInit","UNK_TYPE1","",0x1), 0x80C058DC:("sAnimations","AnimationHeader*","",0x1), - 0x80C058F8:("sAnimModes","u8","",0x1), + 0x80C058F8:("sAnimationModes","u8","",0x1), 0x80C05900:("sSetPrimColorDL","UNK_TYPE1","",0x1), 0x80C05910:("sSetPrimColorDlPtr","Gfx*","",0x4), 0x80C05914:("sEyeTextures","void*","",0x1), @@ -16585,7 +16585,7 @@ 0x80C1DE20:("D_80C1DE20","UNK_TYPE4","",0x4), 0x80C1DE28:("D_80C1DE28","UNK_TYPE1","",0x1), 0x80C1E1E0:("Dm_Nb_InitVars","UNK_TYPE1","",0x1), - 0x80C1E200:("D_80C1E200","UNK_TYPE1","",0x1), + 0x80C1E200:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80C1E210:("D_80C1E210","UNK_TYPE4","",0x4), 0x80C1E5C0:("En_Drs_InitVars","UNK_TYPE1","",0x1), 0x80C1E5E0:("D_80C1E5E0","UNK_TYPE1","",0x1), @@ -16595,7 +16595,7 @@ 0x80C1E970:("D_80C1E970","UNK_TYPE1","",0x1), 0x80C1E984:("D_80C1E984","UNK_TYPE1","",0x1), 0x80C1F150:("Dm_Bal_InitVars","UNK_TYPE1","",0x1), - 0x80C1F170:("D_80C1F170","UNK_PTR","",0x4), + 0x80C1F170:("sAnimationInfo","UNK_PTR","",0x4), 0x80C1F2C0:("D_80C1F2C0","UNK_TYPE2","",0x2), 0x80C1F2C4:("D_80C1F2C4","UNK_TYPE4","",0x4), 0x80C1F2D0:("D_80C1F2D0","UNK_TYPE1","",0x1),