diff --git a/docs/tutorial/beginning_decomp.md b/docs/tutorial/beginning_decomp.md index 01cc21cf3b..b46bd219ae 100644 --- a/docs/tutorial/beginning_decomp.md +++ b/docs/tutorial/beginning_decomp.md @@ -397,7 +397,7 @@ An actor with SkelAnime has three structs in the Actor struct that handle it: on There are two different sorts of SkelAnime, although for decompilation purposes there is not much difference between them. Looking at the prototype of `SkelAnime_InitFlex` from `functions.h` (or even the definition in `z_skelanime.c`), ```C void SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animationSeg, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); ``` we can read off the types of the various arguments: - The `SkelAnime` struct is at `this + 0x144` diff --git a/include/functions.h b/include/functions.h index 69abef304c..5b7da53e44 100644 --- a/include/functions.h +++ b/include/functions.h @@ -782,7 +782,7 @@ s32 func_800BD2B4(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u void func_800BD888(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3); void func_800BD9E0(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); void func_800BDAA0(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); -void Actor_ChangeAnimation(SkelAnime* skelAnime, ActorAnimationEntry* animation, s32 index); +void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index); void Actor_Noop(Actor* actor, GlobalContext* globalCtx); void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist); @@ -2363,7 +2363,7 @@ void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** s void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor); void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx); void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor); -void SkelAnime_GetFrameData(AnimationHeader* animationSeg, s32 currentFrame, s32 limbCount, Vec3s* dst); +void SkelAnime_GetFrameData(AnimationHeader* animation, s32 currentFrame, s32 limbCount, Vec3s* dst); s16 Animation_GetLength(void* animation); s16 Animation_GetLastFrame(void* animation); Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx); @@ -2381,7 +2381,7 @@ void AnimationContext_DisableQueue(GlobalContext* globalCtx); AnimationEntry* AnimationContext_AddEntry(AnimationContext* animationCtx, AnimationType type); void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader* animation, s32 frame, s32 limbCount, Vec3s* frameTable); void AnimationContext_SetCopyAll(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src); -void AnimationContext_SetInterp(GlobalContext* globalCtx, s32 limbCount, Vec3s* arg2, Vec3s* arg3, f32 arg4); +void AnimationContext_SetInterp(GlobalContext* globalCtx, s32 vecCount, Vec3s* base, Vec3s* mod, f32 weight); void AnimationContext_SetCopyTrue(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src, u8* index); void AnimationContext_SetCopyFalse(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src, u8* index); void AnimationContext_SetMoveActor(GlobalContext* globalCtx, Actor* actor, SkelAnime* skelAnime, f32 arg3); @@ -2399,25 +2399,25 @@ s32 LinkAnimation_Morph(GlobalContext* globalCtx, SkelAnime* skelAnime); void LinkAnimation_AnimateFrame(GlobalContext* globalCtx, SkelAnime* skelAnime); s32 LinkAnimation_Loop(GlobalContext* globalCtx, SkelAnime* skelAnime); s32 LinkAnimation_Once(GlobalContext* globalCtx, SkelAnime* skelAnime); -void Animation_SetMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 transitionRate); -void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 playbackSpeed, f32 frame, f32 frameCount, u8 animationMode, f32 transitionRate); -void LinkAnimation_PlayOnce(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg); -void LinkAnimation_PlayOnceSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 playbackSpeed); -void LinkAnimation_PlayLoop(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg); -void LinkAnimation_PlayLoopSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 playbackSpeed); +void Animation_SetMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 morphFrames); +void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames); +void LinkAnimation_PlayOnce(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation); +void LinkAnimation_PlayOnceSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed); +void LinkAnimation_PlayLoop(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation); +void LinkAnimation_PlayLoopSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed); void LinkAnimation_CopyJointToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime); void LinkAnimation_CopyMorphToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime); -void LinkAnimation_LoadToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 frame); -void LinkAnimation_LoadToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 frame); +void LinkAnimation_LoadToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 frame); +void LinkAnimation_LoadToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 frame); void LinkAnimation_InterpJointMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 frame); -void LinkAnimation_BlendToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 transitionFrame, LinkAnimationHeader* linkAnimetionEntrySeg2, f32 frame, f32 transitionRate, Vec3s* jointTable); -void LinkAnimation_BlendToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 transitionFrame, LinkAnimationHeader* linkAnimetionEntrySeg2, f32 frame, f32 transitionRate, Vec3s* jointTable); +void LinkAnimation_BlendToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation1, f32 frame1, LinkAnimationHeader* animation2, f32 frame2, f32 blendWeight, Vec3s* blendTable); +void LinkAnimation_BlendToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation1, f32 frame1, LinkAnimationHeader* animation2, f32 frame2, f32 blendWeight, Vec3s* blendTable); void LinkAnimation_EndLoop(SkelAnime* skelAnime); -s32 Animation_OnFrameImpl(SkelAnime* skelAnime, f32 arg1, f32 updateRate); -s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 arg1); -void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animationSeg, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); +s32 Animation_OnFrameImpl(SkelAnime* skelAnime, f32 frame, f32 updateRate); +s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 frame); +void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); void SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); -void SkelAnime_InitSkin(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animationSeg); +void SkelAnime_InitSkin(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation); void SkelAnime_SetUpdate(SkelAnime* skelAnime); s32 SkelAnime_Update(SkelAnime* skelAnime); s32 SkelAnime_Morph(SkelAnime* skelAnime); @@ -2426,20 +2426,20 @@ void SkelAnime_AnimateFrame(SkelAnime* skelAnime); s32 SkelAnime_LoopFull(SkelAnime* skelAnime); s32 SkelAnime_LoopPartial(SkelAnime* skelAnime); s32 SkelAnime_Once(SkelAnime* skelAnime); -void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 playbackSpeed, f32 frame, f32 frameCount, u8 animationType, f32 transitionRate, s8 unk2); -void Animation_Change(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 playbackSpeed, f32 frame, f32 frameCount, u8 mode, f32 transitionRate); -void Animation_PlayOnce(SkelAnime* skelAnime, AnimationHeader* animationSeg); -void Animation_MorphToPlayOnce(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 transitionRate); -void Animation_PlayOnceSetSpeed(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 playbackSpeed); -void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animationSeg); -void Animation_MorphToLoop(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 transitionRate); -void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 playbackSpeed); +void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames, s8 taper); +void Animation_Change(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames); +void Animation_PlayOnce(SkelAnime* skelAnime, AnimationHeader* animation); +void Animation_MorphToPlayOnce(SkelAnime* skelAnime, AnimationHeader* animation, f32 morphFrames); +void Animation_PlayOnceSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed); +void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animation); +void Animation_MorphToLoop(SkelAnime* skelAnime, AnimationHeader* animation, f32 morphFrames); +void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed); void Animation_EndLoop(SkelAnime* skelAnime); void Animation_Reverse(SkelAnime* skelAnime); void SkelAnime_CopyFrameTableTrue(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* index); -void SkelAnime_CopyFrameTableFalse(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* arg3); +void SkelAnime_CopyFrameTableFalse(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* copyFlag); void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* pos, s16 angle); -s32 Animation_OnFrame(SkelAnime* skelAnime, f32 arg1); +s32 Animation_OnFrame(SkelAnime* skelAnime, f32 frame); void SkelAnime_Free(SkelAnime* skelAnime, GlobalContext* globalCtx); void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src); // void func_80137970(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); @@ -2503,7 +2503,7 @@ s32 func_8013B6B0(Path* path, f32* arg1, s32* arg2, s32 arg3, s32 arg4, s32* arg void func_8013B878(GlobalContext* globalCtx, Path* path, s32 arg2, Vec3f* arg3); Path* func_8013BB34(GlobalContext* globalCtx, u8 arg1, s32 arg2); Actor* SubS_FindNearestActor(Actor* actor, GlobalContext* globalCtx, u8 actorCategory, s16 actorId); -s32 func_8013BC6C(SkelAnime* skelAnime, ActorAnimationEntryS* arg1, s32 arg2); +s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index); s32 func_8013BD40(Actor* actor, Path* path, s32 arg2); Path* func_8013BEDC(GlobalContext* globalCtx, u8 arg1, u8 arg2, s32* arg3); s32 func_8013C068(Path* path, s32 arg1, Vec3f* arg2, f32 arg3, s32 arg4); @@ -2524,7 +2524,7 @@ s16 func_8013D83C(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq); s8 func_8013D8DC(s8 arg0, GlobalContext* globalCtx); s8 func_8013D924(s16 arg0, GlobalContext* globalCtx); Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorCategory, s16 actorId); -s32 func_8013D9C8(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3); +s32 SubS_FillLimbRotTables(GlobalContext* globalCtx, s16* limbRotTableY, s16* limbRotTableZ, s32 limbRotTableLen); s32 func_8013DB90(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2); s32 func_8013DC40(Path* arg0, s32 arg1, s32 arg2, Vec3f* arg3); void func_8013DCE0(GlobalContext* globalCtx, Vec3f* arg1, Actor* arg2, struct_8013DF3C_arg1* arg3, Path* arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, u8 arg9); @@ -2533,7 +2533,7 @@ void func_8013DF3C(GlobalContext* globalCtx, struct_8013DF3C_arg1* arg1); s32 func_8013E054(GlobalContext* globalCtx, struct_8013DF3C_arg1* arg1); s32 func_8013E07C(GlobalContext* globalCtx, struct_8013DF3C_arg1* arg1); s32 func_8013E0A4(GlobalContext* globalCtx, struct_8013DF3C_arg1* arg1); -void func_8013E1C8(SkelAnime* skelAnime, struct_80B8E1A8 animations[], s32 animationIndex, s32* actorAnimationIndex); +void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex, s32* curIndex); s32 func_8013E2D4(Actor* actor, s16 arg1, s16 arg2, s32 arg3); s32 func_8013E3B8(Actor* actor, s16 cutscenes[], s16 len); void func_8013E4B0(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, Plane* plane); diff --git a/include/z64actor.h b/include/z64actor.h index 8c6992f495..9c0aa7e7db 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -297,24 +297,6 @@ typedef enum { /* 0x0C */ ACTORCAT_MAX } ActorType; -typedef struct { - /* 0x00 */ AnimationHeader* animation; - /* 0x04 */ f32 playSpeed; - /* 0x08 */ f32 startFrame; - /* 0x0C */ f32 frameCount; - /* 0x10 */ u8 mode; - /* 0x14 */ f32 morphFrames; -} ActorAnimationEntry; // size = 0x18 - -typedef struct { - /* 0x00 */ AnimationHeader* animationSeg; - /* 0x04 */ f32 playbackSpeed; - /* 0x08 */ s16 frame; - /* 0x0A */ s16 frameCount; - /* 0x0C */ u8 mode; - /* 0x0E */ s16 transitionRate; -} ActorAnimationEntryS; // size = 0x10 - typedef struct { /* 0x00 */ Vec3f pos; /* 0x0C */ f32 unkC; diff --git a/include/z64animation.h b/include/z64animation.h index 2aa97e2ecb..10b145d38a 100644 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -316,11 +316,29 @@ typedef struct { /* 0x008 */ Gfx* unk_8; } Struct_800A5E28; // size = 0xC -typedef struct struct_80B8E1A8 { - /* 0x00 */ AnimationHeader* animationSeg; - /* 0x04 */ f32 playbackSpeed; +typedef struct { + /* 0x00 */ AnimationHeader* animation; + /* 0x04 */ f32 playSpeed; + /* 0x08 */ f32 startFrame; + /* 0x0C */ f32 frameCount; + /* 0x10 */ u8 mode; + /* 0x14 */ f32 morphFrames; +} AnimationInfo; // size = 0x18 + +typedef struct { + /* 0x00 */ AnimationHeader* animation; + /* 0x04 */ f32 playSpeed; + /* 0x08 */ s16 startFrame; + /* 0x0A */ s16 frameCount; + /* 0x0C */ u8 mode; + /* 0x0E */ s16 morphFrames; +} AnimationInfoS; // size = 0x10 + +typedef struct AnimationSpeedInfo { + /* 0x00 */ AnimationHeader* animation; + /* 0x04 */ f32 playSpeed; /* 0x08 */ u8 mode; - /* 0x0C */ f32 transitionRate; -} struct_80B8E1A8; // size = 0x10 + /* 0x0C */ f32 morphFrames; +} AnimationSpeedInfo; // size = 0x10 #endif diff --git a/src/code/z_actor.c b/src/code/z_actor.c index d4f1def2f1..2eac6470a4 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4252,7 +4252,7 @@ s16 func_800BDB6C(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) { return arg2; } -void Actor_ChangeAnimation(SkelAnime* skelAnime, ActorAnimationEntry* animation, s32 index) { +void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index) { f32 frameCount; animation += index; diff --git a/src/code/z_en_hy.c b/src/code/z_en_hy.c index 4fac2c2ae7..b99b77daeb 100644 --- a/src/code/z_en_hy.c +++ b/src/code/z_en_hy.c @@ -11,7 +11,7 @@ #include "objects/object_boj/object_boj.h" #include "objects/object_os_anime/object_os_anime.h" -ActorAnimationEntryS sAnimations[] = { +static AnimationInfoS sAnimations[] = { { &object_aob_Anim_00007C, 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 }, @@ -49,11 +49,11 @@ s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) { isChanged = true; frameCount = sAnimations[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(&sAnimations[animIndex].animationSeg->common); + frameCount = Animation_GetLastFrame(&sAnimations[animIndex].animation->common); } - Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed, - sAnimations[animIndex].frame, frameCount, sAnimations[animIndex].mode, - sAnimations[animIndex].transitionRate); + Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, + sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode, + sAnimations[animIndex].morphFrames); } return isChanged; } diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 8ebb2ca67f..9fc5467e07 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -8,10 +8,10 @@ s32 LinkAnimation_Once(GlobalContext* globalCtx, SkelAnime* skelAnime); s32 SkelAnime_LoopFull(SkelAnime* skelAnime); s32 SkelAnime_LoopPartial(SkelAnime* skelAnime); s32 SkelAnime_Once(SkelAnime* skelAnime); -void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animationSeg); +void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animation); void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* pos, s16 angle); -void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, - f32 playbackSpeed, f32 frame, f32 frameCount, u8 animationMode, f32 transitionRate); +void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed, + f32 frame, f32 frameCount, u8 animationMode, f32 morphFrames); void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src); static AnimationEntryCallback sAnimationLoadDone[] = { @@ -1074,13 +1074,13 @@ void AnimationContext_SetCopyFalse(GlobalContext* globalCtx, s32 vecCount, Vec3s /** * Requests moving an actor according to the translation of its root limb */ -void AnimationContext_SetMoveActor(GlobalContext* globalCtx, Actor* actor, SkelAnime* skelAnime, f32 actor3) { +void AnimationContext_SetMoveActor(GlobalContext* globalCtx, Actor* actor, SkelAnime* skelAnime, f32 arg3) { AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMENTRY_MOVEACTOR); if (entry != NULL) { entry->data.move.actor = actor; entry->data.move.skelAnime = skelAnime; - entry->data.move.unk08 = actor3; + entry->data.move.unk08 = arg3; } } @@ -1829,8 +1829,8 @@ void Animation_PlayOnce(SkelAnime* skelAnime, AnimationHeader* animation) { * animation. Negative morph frames start the new animation immediately, modified by the pose immediately before the * animation change. */ -void Animation_MorphToPlayOnce(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 morphFrames) { - Animation_Change(skelAnime, animationSeg, 1.0f, 0, Animation_GetLastFrame(&animationSeg->common), ANIMMODE_ONCE, +void Animation_MorphToPlayOnce(SkelAnime* skelAnime, AnimationHeader* animation, f32 morphFrames) { + Animation_Change(skelAnime, animation, 1.0f, 0, Animation_GetLastFrame(&animation->common), ANIMMODE_ONCE, morphFrames); } @@ -1862,9 +1862,9 @@ void Animation_MorphToLoop(SkelAnime* skelAnime, AnimationHeader* animation, f32 /** * Immediately changes to an animation that loops at the specified speed. */ -void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playbackSpeed) { - Animation_Change(skelAnime, animation, playbackSpeed, 0.0f, Animation_GetLastFrame(&animation->common), - ANIMMODE_LOOP, 0.0f); +void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed) { + Animation_Change(skelAnime, animation, playSpeed, 0.0f, Animation_GetLastFrame(&animation->common), ANIMMODE_LOOP, + 0.0f); } /** diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index 764b3525f3..2ce355d472 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -205,7 +205,26 @@ Actor* SubS_FindNearestActor(Actor* actor, GlobalContext* globalCtx, u8 actorCat return closestActor; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BC6C.s") +s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index) { + s32 endFrame; + s32 startFrame; + + animations += index; + endFrame = animations->frameCount; + if (animations->frameCount < 0) { + endFrame = Animation_GetLastFrame(&animations->animation->common); + } + startFrame = animations->startFrame; + if (startFrame >= endFrame || startFrame < 0) { + return false; + } + if (animations->playSpeed < 0.0f) { + SWAP(s32, endFrame, startFrame); + } + Animation_Change(skelAnime, animations->animation, animations->playSpeed, startFrame, endFrame, animations->mode, + animations->morphFrames); + return true; +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BD40.s") @@ -262,7 +281,17 @@ Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorC return actor; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D9C8.s") +s32 SubS_FillLimbRotTables(GlobalContext* globalCtx, s16* limbRotTableY, s16* limbRotTableZ, s32 limbRotTableLen) { + s32 i; + u32 frames = globalCtx->gameplayFrames; + + for (i = 0; i < limbRotTableLen; i++) { + limbRotTableY[i] = (i * 50 + 0x814) * frames; + limbRotTableZ[i] = (i * 50 + 0x940) * frames; + } + + return true; +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013DB90.s") @@ -282,7 +311,34 @@ Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorC #pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E0A4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E1C8.s") +void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex, + s32* curIndex) { + AnimationSpeedInfo* animation = &animations[nextIndex]; + f32 startFrame = skelAnime->curFrame; + f32 endFrame; + f32 morphFrames; + + if ((*curIndex < 0) || (nextIndex == *curIndex)) { + morphFrames = 0.0f; + if (*curIndex < 0) { + startFrame = 0.0f; + } + } else { + morphFrames = animation->morphFrames; + if (nextIndex != *curIndex) { + startFrame = 0.0f; + } + } + if (animation->playSpeed >= 0.0f) { + endFrame = Animation_GetLastFrame(&animation->animation->common); + } else { + startFrame = Animation_GetLastFrame(&animation->animation->common); + endFrame = 0.0f; + } + Animation_Change(skelAnime, animation->animation, animation->playSpeed, startFrame, endFrame, animation->mode, + morphFrames); + *curIndex = nextIndex; +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E2D4.s") 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 b30a63fe2f..5258a0f1e0 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c @@ -47,16 +47,16 @@ const ActorInit Dm_Char05_InitVars = { (ActorFunc)DmChar05_Draw, }; -static ActorAnimationEntry sAnimations[] = { - { &object_dmask_Anim_001090, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_dmask_Anim_004288, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_dmask_Anim_0001A8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_dmask_Anim_00017C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_dmask_Anim_0011A0, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_dmask_Anim_0013A4, 1.0f, 0.0f, -1.0f, 0, 0.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_dmask_Anim_00017C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_dmask_Anim_0011A0, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_dmask_Anim_0013A4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, }; -void func_80AAC5A0(SkelAnime* skelAnime, ActorAnimationEntry* animation, u16 arg2) { +void func_80AAC5A0(SkelAnime* skelAnime, AnimationInfo* animation, u16 arg2) { f32 phi_f2; animation += arg2; 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 871cc0cf29..e726913954 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 ActorAnimationEntryS D_80C1E200[] = { &object_nb_Anim_000990, 1.0f, 0, -1, 0, 0 }; +static AnimationInfoS D_80C1E200[] = { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }; s32 func_80C1DED0(DmNb* this, s32 arg1) { - s32 ret = 0; + s32 ret = false; if (arg1 != this->unk1F0) { this->unk1F0 = arg1; - ret = func_8013BC6C(&this->skelAnime, D_80C1E200, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80C1E200, 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 53e0fec63b..7f3d3d63c8 100644 --- a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c +++ b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c @@ -30,12 +30,12 @@ const ActorInit Dm_Sa_InitVars = { (ActorFunc)DmSa_Draw, }; -static ActorAnimationEntry D_80A2ED00[] = { { &object_stk_Anim_00CC94, 1.0f, 0, -1.0f, 0, 0 } }; +static AnimationInfo D_80A2ED00[] = { { &object_stk_Anim_00CC94, 1.0f, 0, -1.0f, ANIMMODE_LOOP, 0 } }; -void func_80A2E960(SkelAnime* arg0, ActorAnimationEntry* animations, u16 index) { +void func_80A2E960(SkelAnime* arg0, AnimationInfo* animations, u16 index) { f32 frameCount; - animations += index; + animations += index; if (animations->frameCount < 0.0f) { frameCount = Animation_GetLastFrame(animations->animation); } else { 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 5f4f6461b3..ec46e86d6d 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -102,43 +102,79 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -static ActorAnimationEntry sAnimations[] = { - { &object_stk_Anim_01C21C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk_Anim_01D3D0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk_Anim_001030, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk_Anim_01D008, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk_Anim_01D008, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk_Anim_015C14, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_0070DC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk2_Anim_00D830, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_00055C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_00130C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_00C270, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_00CBB8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_01AA80, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_01D07C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_016910, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_018ED0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_01DDE0, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_01EF50, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_02DC64, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_02E9A0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_02DC64, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_02E9A0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_0035C8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_0049C8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_0259F4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_0266C8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_026CF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_01C114, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_stk2_Anim_004580, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_020CAC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_02200C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_02336C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk_Anim_002774, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk_Anim_003068, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_0101A4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_010B60, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_02A2D8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_01F9E4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_stk2_Anim_029A04, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk2_Anim_02AD54, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_stk_Anim_00BB2C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk_Anim_00C964, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_0110B4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_011FB0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_012A58, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_0141E4, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_00E6EC, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_00EEC0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_027CF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_028F28, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_03323C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk2_Anim_031210, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_0322FC, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_032AE0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_03021C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk2_Anim_036964, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_stk_Anim_016508, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk_Anim_015028, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk_Anim_014920, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_02FA70, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_037B94, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_03967C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &object_stk2_Anim_03967C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_03A8F8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk2_Anim_034FD8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk3_Anim_005F44, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk3_Anim_002CD8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk3_Anim_0039F0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk3_Anim_004554, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk3_Anim_0051C0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &object_stk3_Anim_001374, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk3_Anim_001EDC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, +static AnimationInfo sAnimations[] = { + { &object_stk_Anim_01C21C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk_Anim_01D3D0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk_Anim_001030, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk_Anim_01D008, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk_Anim_01D008, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk_Anim_015C14, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_0070DC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_00D830, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_00055C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_00130C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_00C270, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_00CBB8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_01AA80, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_01D07C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_016910, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_018ED0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_01DDE0, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_01EF50, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_02DC64, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_02E9A0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_02DC64, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_02E9A0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_0035C8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_0049C8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_0259F4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_0266C8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_026CF4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_01C114, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_004580, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_020CAC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_02200C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_02336C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk_Anim_002774, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk_Anim_003068, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_0101A4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_010B60, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_02A2D8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_01F9E4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_029A04, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_02AD54, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk_Anim_00BB2C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk_Anim_00C964, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_0110B4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_011FB0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_012A58, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_0141E4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_00E6EC, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_00EEC0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_027CF4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_028F28, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_03323C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_031210, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_0322FC, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_032AE0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_03021C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_036964, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk_Anim_016508, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk_Anim_015028, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk_Anim_014920, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_02FA70, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_037B94, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_03967C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_03967C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk2_Anim_03A8F8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk2_Anim_034FD8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk3_Anim_005F44, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk3_Anim_002CD8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk3_Anim_0039F0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk3_Anim_004554, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk3_Anim_0051C0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_stk3_Anim_001374, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_stk3_Anim_001EDC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, }; void func_80A9FDB0(DmStk* this, GlobalContext* globalCtx) { @@ -158,8 +194,7 @@ void func_80A9FDB0(DmStk* this, GlobalContext* globalCtx) { } } -void func_80A9FE3C(DmStk* this, GlobalContext* globalCtx, SkelAnime* skelAnime, ActorAnimationEntry* animation, - u16 index) { +void func_80A9FE3C(DmStk* this, GlobalContext* globalCtx, SkelAnime* skelAnime, AnimationInfo* animation, u16 index) { func_80A9FDB0(this, globalCtx); animation += index; 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 d00c5ead98..ccbfae14f6 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -62,19 +62,30 @@ static ColliderCylinderInitType1 sCylinderInit = { { 27, 32, 0, { 0, 0, 0 } }, }; -static ActorAnimationEntryS sAnimations[] = { - { &object_dnt_Anim_005488, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_004AA0, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004E38, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_005CA8, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_0038CC, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003CC0, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_0012F4, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004700, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003438, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001E2C, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_000994, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_002268, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_002F08, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_00577C, 1.0f, 0, -1, 0, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 8, -1, 2, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 4, -1, 2, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_0012F4, -1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_002670, 1.0f, 0, -1, 2, 0 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, + { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; static u16 D_80BF048C[] = { @@ -1143,7 +1154,7 @@ void func_80BEE938(EnAkindonuts* this, GlobalContext* globalCtx) { void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) { s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common); + s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common); s16 phi_v0; Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); @@ -1166,7 +1177,7 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) { this->actionFunc = func_80BEEDC0; this->unk_338 = 3; this->collider.dim.height = 64; - func_8013BC6C(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); return; } } @@ -1176,19 +1187,19 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) { this->unk_338 = 17; this->collider.dim.height = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); - func_8013BC6C(&this->skelAnime, sAnimations, 17); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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); - func_8013BC6C(&this->skelAnime, sAnimations, 16); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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; - func_8013BC6C(&this->skelAnime, sAnimations, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 2); } } else if (this->unk_338 == 16) { phi_v0 = DECR(this->unk_33A); @@ -1196,7 +1207,7 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) { this->unk_33A = Rand_S16Offset(40, 40); this->unk_338 = 18; this->collider.dim.height = 32; - func_8013BC6C(&this->skelAnime, sAnimations, 18); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 18); } } } @@ -1205,7 +1216,7 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) { void func_80BEEDC0(EnAkindonuts* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { this->actionFunc = func_80BEEE10; - func_8013BC6C(&this->skelAnime, sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0); } } @@ -1223,7 +1234,7 @@ void func_80BEEE10(EnAkindonuts* this, GlobalContext* globalCtx) { } 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; - func_8013BC6C(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); this->actionFunc = func_80BEEB20; } } @@ -1247,7 +1258,7 @@ void func_80BEEFA8(EnAkindonuts* this, GlobalContext* globalCtx) { globalCtx->msgCtx.unk12023 = 4; this->unk_338 = 8; this->unk_33C = 0; - func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338); this->actionFunc = func_80BEF518; } else { this->unk_2DC(this, globalCtx); @@ -1285,18 +1296,18 @@ void func_80BEF18C(EnAkindonuts* this, GlobalContext* globalCtx) { void func_80BEF20C(EnAkindonuts* this, GlobalContext* globalCtx) { u8 sp27 = Message_GetState(&globalCtx->msgCtx); s16 sp24 = this->skelAnime.curFrame; - s16 sp22 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common); + s16 sp22 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common); if (this->unk_356 == 40) { this->unk_338 = 5; - func_8013BC6C(&this->skelAnime, sAnimations, 5); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 5); } this->unk_356++; if ((sp24 == sp22) && (this->unk_338 == 5)) { this->unk_338 = 6; - func_8013BC6C(&this->skelAnime, sAnimations, 6); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 6); } if ((sp27 == 5) && func_80147624(globalCtx)) { @@ -1347,7 +1358,7 @@ void func_80BEF4B8(EnAkindonuts* this, GlobalContext* globalCtx) { void func_80BEF518(EnAkindonuts* this, GlobalContext* globalCtx) { s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common); + s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common); switch (sp26) { case 10: @@ -1421,7 +1432,7 @@ void func_80BEF518(EnAkindonuts* this, GlobalContext* globalCtx) { if (sp26 == sp24) { this->unk_33E = 3; this->unk_338 = 19; - func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_32C &= ~2; this->unk_32C |= 0x80; @@ -1454,7 +1465,7 @@ void func_80BEF770(EnAkindonuts* this, GlobalContext* globalCtx) { void func_80BEF83C(EnAkindonuts* this, GlobalContext* globalCtx) { Vec3f sp34; s16 sp32 = this->skelAnime.curFrame; - s16 sp30 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common); + s16 sp30 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common); if (sp32 == sp30) { Math_SmoothStepToS(&this->unk_362, 0x1C71, 3, 0x100, 0); @@ -1480,7 +1491,7 @@ void func_80BEF83C(EnAkindonuts* this, GlobalContext* globalCtx) { if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { this->unk_34C = 0.3f; this->unk_338 = 9; - func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80BEF9F0; } @@ -1499,7 +1510,7 @@ void func_80BEF9F0(EnAkindonuts* this, GlobalContext* globalCtx) { 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; - func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338); if (ENAKINDONUTS_GET_3(&this->actor) == ENAKINDONUTS_3_2) { this->unk_32C |= 0x2; } @@ -1602,7 +1613,7 @@ void EnAkindonuts_Init(Actor* thisx, GlobalContext* globalCtx) { } } - func_8013BC6C(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); this->unk_32C |= 0x2; this->unk_32C |= 0x4; this->unk_338 = 4; 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 d9213e75cd..38b9c3eced 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 @@ -45,10 +45,13 @@ const ActorInit En_Aob_01_InitVars = { (ActorFunc)EnAob01_Draw, }; -static ActorAnimationEntry D_809C3790[6] = { - { &object_aob_Anim_007758, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_aob_Anim_0068B4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &object_aob_Anim_00700C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_aob_Anim_0058EC, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &object_aob_Anim_006040, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_aob_Anim_007758, 1.0f, 0.0f, 0.0f, 0, -6.0f }, +static AnimationInfo D_809C3790[6] = { + { &object_aob_Anim_007758, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_aob_Anim_0068B4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &object_aob_Anim_00700C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_aob_Anim_0058EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &object_aob_Anim_006040, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_aob_Anim_007758, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -150,7 +153,7 @@ s32 func_809C1424(EnAob01* this) { if (this->unk_43C == 1) { if (curFrame == lastFrame) { this->unk_43C = 2; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 2); return true; } } else if (this->unk_43C == 2) { @@ -166,13 +169,13 @@ s32 func_809C14D0(EnAob01* this) { if ((this->unk_43C == 0) || (this->unk_43C == 5)) { if (curFrame == lastFrame) { this->unk_43C = 3; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 3); return true; } } else if (this->unk_43C == 3) { if (curFrame == lastFrame) { this->unk_43C = 4; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 4); return true; } } else if (this->unk_43C == 4) { @@ -188,7 +191,7 @@ s32 func_809C15BC(EnAob01* this) { if ((this->unk_43C != 0) && (this->unk_43C != 5)) { if (curFrame == lastFrame) { this->unk_43C = 5; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 5); return true; } } else { @@ -330,7 +333,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 0x40; this->unk_2D2 |= 0x10; this->unk_43C = 1; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); break; case 0x3525: @@ -345,7 +348,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 0x40; this->unk_2D2 |= 0x10; this->unk_43C = 1; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); break; } @@ -360,7 +363,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 4; this->unk_2D2 |= 0x10; this->unk_43C = 1; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); break; case 0x3527: @@ -372,7 +375,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_210 = 0x3536; this->unk_2D2 |= 0x40; this->unk_43C = 1; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); break; } @@ -380,7 +383,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_210 = 0x3537; this->unk_2D2 |= 0x40; this->unk_43C = 1; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); break; } @@ -483,7 +486,7 @@ void func_809C1EC8(EnAob01* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->unk_2E0.y, 0, 4, 1000, 1); } func_809C10B0(this, 3); - func_8013D9C8(globalCtx, this->unk_2F8, this->unk_318, 0x10); + SubS_FillLimbRotTables(globalCtx, this->unk_2F8, this->unk_318, ARRAY_COUNT(this->unk_2F8)); func_809C165C(this, globalCtx); if (player->stateFlags1 & 0x20) { func_809C1124(); @@ -552,7 +555,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 0x10; this->unk_2D2 |= 0x40; this->unk_43C = 1; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); func_801518B0(globalCtx, 0x354B, &this->actor); } this->unk_2D2 &= ~8; @@ -731,7 +734,7 @@ void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) { this->unk_210 = 0x352D; this->unk_2D2 |= 0x40; this->unk_43C = 1; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1); break; } @@ -927,7 +930,7 @@ void EnAob01_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->unk_43C = 0; - Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 0); Actor_SetScale(&this->actor, 0.01f); switch (gSaveContext.eventInf[0] & 7) { 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 b9ae56f28b..f052362ac3 100644 --- a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c +++ b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c @@ -59,7 +59,7 @@ 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 u8 animModes[] = { 0, 0 }; +static u8 animModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP }; void EnBaisen_Init(Actor* thisx, GlobalContext* globalCtx) { EnBaisen* this = THIS; 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 030a2f9e04..145dc2311c 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 @@ -64,11 +64,11 @@ static ColliderCylinderInit sCylinderInit = { }; /* Animations struct */ -static struct_80B8E1A8 D_809CDC7C[] = { - { &object_bji_Anim_000FDC, 1.0f, 0, 0.0f }, /* Looking through telescope */ - { &object_bji_Anim_005B58, 1.0f, 0, 10.0f }, /* Breathing? Unused? */ - { &object_bji_Anim_000AB0, 1.0f, 0, 0.0f }, /* Talking */ - { &object_bji_Anim_00066C, 1.0f, 2, -5.0f }, /* Scratching chin? */ +static AnimationSpeedInfo D_809CDC7C[] = { + { &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 */ + { &object_bji_Anim_00066C, 1.0f, ANIMMODE_ONCE, -5.0f }, /* Scratching chin? */ }; void func_809CCDE0(EnBji01* this, GlobalContext* globalCtx) { @@ -84,7 +84,7 @@ void func_809CCDE0(EnBji01* this, GlobalContext* globalCtx) { } void func_809CCE98(EnBji01* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, D_809CDC7C, 0, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 0, &this->animationIndex); this->actor.textId = 0; this->actionFunc = func_809CCEE8; } @@ -193,7 +193,7 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) { } break; } - func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); this->actionFunc = EnBji01_DialogueHandler; } @@ -239,7 +239,7 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10000; switch (globalCtx->msgCtx.unk11F04) { case 0x5DE: - func_8013E1C8(&this->skelAnime, D_809CDC7C, 3, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 3, &this->animationIndex); func_80151938(globalCtx, 0x5DF); break; case 0x5E4: @@ -290,7 +290,7 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) { break; } if ((this->animationIndex == 3) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) { - func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); } } @@ -308,7 +308,7 @@ void EnBji01_DoNothing(EnBji01* this, GlobalContext* globalCtx) { } void func_809CD6C0(EnBji01* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex); this->actionFunc = func_809CD70C; } 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 8b47025e4c..77cb0cca8a 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 @@ -112,7 +112,8 @@ void EnCne01_UpdateModel(EnCne01* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->enHy.torsoRot.x, 0, 4, 0x3E8, 1); Math_SmoothStepToS(&this->enHy.torsoRot.y, 0, 4, 0x3E8, 1); } - func_8013D9C8(globalCtx, this->enHy.limbRotTableY, this->enHy.limbRotTableZ, ARRAY_COUNT(this->enHy.limbRotTableY)); + SubS_FillLimbRotTables(globalCtx, this->enHy.limbRotTableY, this->enHy.limbRotTableZ, + ARRAY_COUNT(this->enHy.limbRotTableY)); EnHy_UpdateCollider(&this->enHy, globalCtx); } 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 b622dab8e7..fe13b6757d 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -130,16 +130,20 @@ s32 func_80B3E5B4(EnDai* this, GlobalContext* globalCtx) { } s32 func_80B3E5DC(EnDai* this, s32 arg1) { - static ActorAnimationEntryS D_80B3FBFC[] = { - { &object_dai_Anim_0079E4, 1.0f, 0, -1, 0, 0 }, { &object_dai_Anim_0079E4, 1.0f, 0, -1, 0, -4 }, - { &object_dai_Anim_007354, 1.0f, 0, -1, 2, -4 }, { &object_dai_Anim_000CEC, 1.0f, 0, -1, 2, -4 }, - { &object_dai_Anim_0069DC, 1.0f, 0, -1, 2, -4 }, { &object_dai_Anim_00563C, 1.0f, 0, -1, 2, 0 }, - { &object_dai_Anim_00563C, 1.0f, 0, -1, 2, -4 }, { &object_dai_Anim_002E58, 1.0f, 0, -1, 0, -4 }, - { &object_dai_Anim_006590, 1.0f, 0, -1, 2, -4 }, + static AnimationInfoS D_80B3FBFC[] = { + { &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 }, + { &object_dai_Anim_000CEC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dai_Anim_0069DC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dai_Anim_00563C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dai_Anim_00563C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dai_Anim_002E58, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dai_Anim_006590, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, }; s32 phi_v1 = false; - s32 ret = 0; + s32 ret = false; switch (arg1) { case 0: @@ -165,7 +169,7 @@ s32 func_80B3E5DC(EnDai* this, s32 arg1) { if (phi_v1) { this->unk_A70 = arg1; - ret = func_8013BC6C(&this->skelAnime, D_80B3FBFC, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80B3FBFC, arg1); } return ret; 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 040dd4c57b..b852ff0a47 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -129,33 +129,41 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &object_dog_Anim_0021C8, 1.0f, 0, -1, 0, 0 }, { &object_dog_Anim_0021C8, 1.0f, 0, -1, 0, -6 }, - { &object_dog_Anim_001BD8, 1.0f, 0, -1, 0, 0 }, { &object_dog_Anim_000998, 1.0f, 0, -1, 0, -6 }, - { &object_dog_Anim_001FB0, 1.0f, 0, -1, 2, -6 }, { &object_dog_Anim_001FB0, 1.0f, 0, -1, 4, -6 }, - { &object_dog_Anim_001048, 1.0f, 0, -1, 2, -6 }, { &object_dog_Anim_001348, 1.0f, 0, -1, 0, -6 }, - { &object_dog_Anim_001048, 1.0f, 0, 27, 2, -6 }, { &object_dog_Anim_001048, 1.0f, 28, -1, 2, -6 }, - { &object_dog_Anim_001048, 1.0f, 54, 54, 2, -6 }, { &object_dog_Anim_0021C8, -1.5f, -1, 0, 0, -6 }, - { &object_dog_Anim_001560, 1.0f, 0, -1, 2, 0 }, { &object_dog_Anim_001A84, 1.2f, 0, -1, 2, 0 }, - { &object_dog_Anim_0017C0, 1.2f, 0, -1, 2, 0 }, { &object_dog_Anim_0021C8, 0.5f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimations[] = { + { &object_dog_Anim_0021C8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dog_Anim_0021C8, 1.0f, 0, -1, ANIMMODE_LOOP, -6 }, + { &object_dog_Anim_001BD8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dog_Anim_000998, 1.0f, 0, -1, ANIMMODE_LOOP, -6 }, + { &object_dog_Anim_001FB0, 1.0f, 0, -1, ANIMMODE_ONCE, -6 }, + { &object_dog_Anim_001FB0, 1.0f, 0, -1, ANIMMODE_LOOP_PARTIAL, -6 }, + { &object_dog_Anim_001048, 1.0f, 0, -1, ANIMMODE_ONCE, -6 }, + { &object_dog_Anim_001348, 1.0f, 0, -1, ANIMMODE_LOOP, -6 }, + { &object_dog_Anim_001048, 1.0f, 0, 27, ANIMMODE_ONCE, -6 }, + { &object_dog_Anim_001048, 1.0f, 28, -1, ANIMMODE_ONCE, -6 }, + { &object_dog_Anim_001048, 1.0f, 54, 54, ANIMMODE_ONCE, -6 }, + { &object_dog_Anim_0021C8, -1.5f, -1, 0, ANIMMODE_LOOP, -6 }, + { &object_dog_Anim_001560, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dog_Anim_001A84, 1.2f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dog_Anim_0017C0, 1.2f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dog_Anim_0021C8, 0.5f, 0, -1, ANIMMODE_LOOP, 0 }, }; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_STOP), }; -void func_80989140(SkelAnime* skelAnime, ActorAnimationEntryS arg1[], s32 arg2) { +void func_80989140(SkelAnime* skelAnime, AnimationInfoS arg1[], s32 arg2) { f32 frameCount; arg1 += arg2; if (arg1->frameCount < 0) { - frameCount = Animation_GetLastFrame(arg1->animationSeg); + frameCount = Animation_GetLastFrame(arg1->animation); } else { frameCount = arg1->frameCount; } - Animation_Change(skelAnime, arg1->animationSeg, arg1->playbackSpeed + (BREG(88) * 0.1f), arg1->frame, frameCount, - arg1->mode, arg1->transitionRate); + Animation_Change(skelAnime, arg1->animation, arg1->playSpeed + (BREG(88) * 0.1f), arg1->startFrame, frameCount, + arg1->mode, arg1->morphFrames); } void func_80989204(EnDg* this, GlobalContext* globalCtx) { @@ -690,7 +698,7 @@ void func_8098A938(EnDg* this, GlobalContext* globalCtx) { this->actionFunc = func_8098AC34; } else { func_80989140(&this->skelAnime, sAnimations, 11); - sAnimations[11].playbackSpeed = -1.0f; + sAnimations[11].playSpeed = -1.0f; this->actionFunc = func_8098B198; } } @@ -765,7 +773,7 @@ void func_8098AC34(EnDg* this, GlobalContext* globalCtx) { if (sp26 < 9) { if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - sAnimations[14].playbackSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f; + sAnimations[14].playSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f; } func_80989864(this, globalCtx); } else { @@ -773,7 +781,7 @@ void func_8098AC34(EnDg* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 9.0f)) { f32 rand = randPlusMinusPoint5Scaled(1.5f); - sAnimations[14].playbackSpeed = 1.2f; + sAnimations[14].playSpeed = 1.2f; this->actor.velocity.y = 2.0f * rand + 3.0f; this->actor.speedXZ = 8.0f + rand; } else if (sp26 >= 0x15) { 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 9333810346..4225c32256 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -93,25 +93,43 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &object_dnk_Anim_000B70, 1.0f, 0, -1, 2, 0 }, { &object_dnk_Anim_000B70, 1.0f, 0, -1, 2, -4 }, - { &object_dnk_Anim_002A08, 1.0f, 0, -1, 0, -4 }, { &object_dnk_Anim_00031C, 1.0f, 0, -1, 0, -4 }, - { &object_dnk_Anim_000430, 1.0f, -1, -1, 2, 0 }, { &object_dnk_Anim_000430, 1.0f, 0, -1, 2, -4 }, - { &object_dnk_Anim_000894, 1.0f, 0, -1, 2, -4 }, { &object_dnk_Anim_002B6C, 1.0f, 0, -1, 0, 0 }, - { &object_dnk_Anim_002B6C, 1.0f, 0, -1, 0, -4 }, { &object_dnk_Anim_0006CC, 1.0f, 0, -1, 0, -4 }, - { &object_hintnuts_Anim_000168, 1.0f, 0, -1, 2, -4 }, { &object_hintnuts_Anim_0024CC, 1.0f, -1, -1, 2, 0 }, - { &object_hintnuts_Anim_0024CC, 1.0f, 0, -1, 2, -4 }, { &object_hintnuts_Anim_0026C4, 1.0f, 0, -1, 2, -4 }, - { &object_hintnuts_Anim_002894, 1.0f, 0, -1, 2, -4 }, { &object_hintnuts_Anim_002B90, 1.0f, 0, -1, 2, -4 }, - { &object_hintnuts_Anim_002F7C, 1.0f, 0, -1, 0, 0 }, { &object_hintnuts_Anim_002F7C, 1.0f, 0, -1, 0, -4 }, - { &object_hintnuts_Anim_003128, 1.0f, 0, -1, 0, 0 }, { &object_hintnuts_Anim_003128, 1.0f, 0, -1, 0, -4 }, - { &object_hintnuts_Anim_0029BC, 1.0f, 0, -1, 0, -4 }, { &object_hintnuts_Anim_002E84, 1.0f, 0, -1, 0, -4 }, - { &object_dekunuts_Anim_000168, 1.0f, 0, -1, 0, -4 }, { &object_dekunuts_Anim_00259C, 1.0f, 0, -1, 2, -4 }, - { &object_dekunuts_Anim_002A5C, 1.0f, 0, -1, 2, 0 }, { &object_dekunuts_Anim_002A5C, 1.0f, 0, -1, 2, -4 }, - { &object_dekunuts_Anim_002BD4, 1.0f, 0, -1, 2, -4 }, { &object_dekunuts_Anim_002DD4, 1.0f, 0, -1, 2, -4 }, - { &object_dekunuts_Anim_002FA4, 1.0f, 0, -1, 0, -4 }, { &object_dekunuts_Anim_003180, 1.0f, 0, -1, 2, -4 }, - { &object_dekunuts_Anim_00326C, 1.0f, 0, -1, 0, 0 }, { &object_dekunuts_Anim_00326C, 1.0f, 0, -1, 0, -4 }, - { &object_dekunuts_Anim_0033E4, 1.0f, 0, -1, 0, -4 }, { &object_dekunuts_Anim_003780, 1.0f, 0, -1, 0, 0 }, - { &object_dekunuts_Anim_003780, 1.0f, 0, -1, 0, -4 }, { &object_dekunuts_Anim_002950, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimations[] = { + { &object_dnk_Anim_000B70, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnk_Anim_000B70, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnk_Anim_002A08, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnk_Anim_00031C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnk_Anim_000430, 1.0f, -1, -1, ANIMMODE_ONCE, 0 }, + { &object_dnk_Anim_000430, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnk_Anim_000894, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnk_Anim_002B6C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnk_Anim_002B6C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnk_Anim_0006CC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_hintnuts_Anim_000168, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_hintnuts_Anim_0024CC, 1.0f, -1, -1, ANIMMODE_ONCE, 0 }, + { &object_hintnuts_Anim_0024CC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_hintnuts_Anim_0026C4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_hintnuts_Anim_002894, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_hintnuts_Anim_002B90, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_hintnuts_Anim_002F7C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_hintnuts_Anim_002F7C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_hintnuts_Anim_003128, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_hintnuts_Anim_003128, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_hintnuts_Anim_0029BC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_hintnuts_Anim_002E84, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dekunuts_Anim_000168, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dekunuts_Anim_00259C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dekunuts_Anim_002A5C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dekunuts_Anim_002A5C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dekunuts_Anim_002BD4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dekunuts_Anim_002DD4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dekunuts_Anim_002FA4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dekunuts_Anim_003180, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dekunuts_Anim_00326C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dekunuts_Anim_00326C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dekunuts_Anim_0033E4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dekunuts_Anim_003780, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dekunuts_Anim_003780, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dekunuts_Anim_002950, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) { @@ -124,14 +142,14 @@ s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) { sp30 = true; frameCount = sAnimations[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(sAnimations[animIndex].animationSeg); + frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation); } - frame = sAnimations[animIndex].frame; + frame = sAnimations[animIndex].startFrame; if (frame < 0) { frame = frameCount; } - Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed, - frame, frameCount, sAnimations[animIndex].mode, sAnimations[animIndex].transitionRate); + Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, frame, + frameCount, sAnimations[animIndex].mode, sAnimations[animIndex].morphFrames); } } return sp30; diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/src/overlays/actors/ovl_En_Dno/z_en_dno.c index 4f8fe5b7a6..67bbd22d01 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -42,17 +42,17 @@ void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve extern u8 D_801C20C0; -static struct_80B8E1A8 sAnimations[] = { - { &object_dno_Anim_000470, 1.0f, 2, 0.0f }, { &object_dno_Anim_0008F0, 1.0f, 2, 0.0f }, - { &object_dno_Anim_000F6C, 1.0f, 0, 0.0f }, { &object_dno_Anim_001A50, 1.0f, 2, 0.0f }, - { &object_dno_Anim_002530, 1.0f, 2, 0.0f }, { &object_dno_Anim_003320, 1.0f, 2, 0.0f }, - { &object_dno_Anim_0036D0, 1.0f, 0, 0.0f }, { &object_dno_Anim_0041CC, 1.0f, 2, 0.0f }, - { &object_dno_Anim_004DD8, 1.0f, 2, 0.0f }, { &object_dno_Anim_005F98, 1.0f, 0, 0.0f }, - { &object_dno_Anim_006488, 1.0f, 2, 0.0f }, { &object_dno_Anim_0073E4, 1.0f, 0, 0.0f }, - { &object_dno_Anim_0077A8, 1.0f, 0, 0.0f }, { &object_dno_Anim_007CA4, 1.0f, 0, 0.0f }, - { &object_dno_Anim_008324, 1.0f, 0, 0.0f }, { &object_dno_Anim_008AE4, 1.0f, 2, 0.0f }, - { &object_dno_Anim_009100, 1.0f, 2, 0.0f }, { &object_dno_Anim_0051E4, 1.0f, 2, 0.0f }, - { &object_dno_Anim_005E20, 1.0f, 0, 0.0f }, { &object_dno_Anim_006F84, 1.0f, 0, 0.0f }, +static AnimationSpeedInfo sAnimations[] = { + { &object_dno_Anim_000470, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_0008F0, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_dno_Anim_000F6C, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_001A50, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_dno_Anim_002530, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_003320, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_dno_Anim_0036D0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_0041CC, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_dno_Anim_004DD8, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_005F98, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_dno_Anim_006488, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_0073E4, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_dno_Anim_0077A8, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_007CA4, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_dno_Anim_008324, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_008AE4, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_dno_Anim_009100, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_0051E4, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_dno_Anim_005E20, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_006F84, 1.0f, ANIMMODE_LOOP, 0.0f }, }; const ActorInit En_Dno_InitVars = { @@ -201,9 +201,9 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4); - Animation_Change(&this->skelAnime, sAnimations[14].animationSeg, 1.0f, 0.0f, - Animation_GetLastFrame(sAnimations[14].animationSeg), sAnimations[14].mode, - sAnimations[14].transitionRate); + Animation_Change(&this->skelAnime, sAnimations[14].animation, 1.0f, 0.0f, + Animation_GetLastFrame(sAnimations[14].animation), sAnimations[14].mode, + sAnimations[14].morphFrames); this->unk_3BE = 0x3E93; this->unk_3C0 = 60.0f; this->unk_3B0 = 0; @@ -216,7 +216,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) { if (!(gSaveContext.weekEventReg[23] & 0x20) || (gSaveContext.weekEventReg[93] & 2)) { Actor_MarkForDeath(thisx); } else { - func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C); thisx->room = -1; gSaveContext.unk_3DD0[1] = 5; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); @@ -230,7 +230,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.weekEventReg[23] & 0x20) { Actor_MarkForDeath(thisx); } else { - func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C); this->unk_460 = SubS_FindActor(globalCtx, NULL, ACTORCAT_NPC, ACTOR_EN_DNQ); if (this->unk_460 == NULL) { Actor_MarkForDeath(thisx); @@ -258,7 +258,7 @@ void EnDno_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80A71B04(EnDno* this, GlobalContext* globalCtx) { this->unk_452 = 0; - func_8013E1C8(&this->skelAnime, sAnimations, 19, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 19, &this->unk_32C); this->actionFunc = EnDno_DoNothing; } @@ -271,14 +271,14 @@ void func_80A71B68(EnDno* this, GlobalContext* globalCtx) { if (CHECK_QUEST_ITEM(QUEST_SONG_SONATA)) { if (gSaveContext.weekEventReg[27] & 1) { if (!(this->unk_3B0 & 0x20)) { - func_8013E1C8(&this->skelAnime, sAnimations, 6, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 6, &this->unk_32C); this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->unk_460); } } else { - func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C); } } else { - func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C); } this->actionFunc = func_80A71C3C; } @@ -287,23 +287,23 @@ void func_80A71C3C(EnDno* this, GlobalContext* globalCtx) { switch (this->unk_32C) { case 9: case 16: - func_8013E1C8(&this->skelAnime, sAnimations, 10, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 10, &this->unk_32C); break; case 3: case 10: if (this->skelAnime.curFrame == this->skelAnime.endFrame) { - func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C); } break; case 11: - func_8013E1C8(&this->skelAnime, sAnimations, 15, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 15, &this->unk_32C); break; case 15: if (this->skelAnime.curFrame == this->skelAnime.endFrame) { - func_8013E1C8(&this->skelAnime, sAnimations, 6, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 6, &this->unk_32C); } case 6: @@ -363,7 +363,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xE38)) { switch (this->unk_464) { case 0x80B: - func_8013E1C8(&this->skelAnime, sAnimations, 16, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 16, &this->unk_32C); case 0x811: func_801518B0(globalCtx, this->unk_464, &this->actor); @@ -372,9 +372,9 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { case 0x80C: case 0x80F: if (this->unk_32C == 13) { - func_8013E1C8(&this->skelAnime, sAnimations, 4, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 4, &this->unk_32C); } else if ((this->unk_32C == 4) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) { - func_8013E1C8(&this->skelAnime, sAnimations, 11, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 11, &this->unk_32C); func_801518B0(globalCtx, this->unk_464, &this->actor); } break; @@ -387,7 +387,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { switch (this->unk_32C) { case 16: if (this->skelAnime.curFrame == this->skelAnime.endFrame) { - func_8013E1C8(&this->skelAnime, sAnimations, 9, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 9, &this->unk_32C); } Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, this->unk_460), 0x71C); @@ -396,7 +396,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { case 10: if (this->skelAnime.curFrame == this->skelAnime.endFrame) { func_801477B4(globalCtx); - func_8013E1C8(&this->skelAnime, sAnimations, 0xD, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C); func_80A71B68(this, globalCtx); } break; @@ -412,13 +412,13 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { switch (this->unk_32C) { case 16: if (this->skelAnime.curFrame == this->skelAnime.endFrame) { - func_8013E1C8(&this->skelAnime, sAnimations, 9, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 9, &this->unk_32C); } break; case 9: if (func_80147624(globalCtx)) { - func_8013E1C8(&this->skelAnime, sAnimations, 10, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 10, &this->unk_32C); globalCtx->msgCtx.msgMode = 0x44; } break; @@ -426,7 +426,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { case 10: if (this->skelAnime.curFrame == this->skelAnime.endFrame) { func_801477B4(globalCtx); - func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C); func_80A71B68(this, globalCtx); } break; @@ -447,10 +447,10 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { case 0x80E: if (this->unk_32C == 11) { - func_8013E1C8(&this->skelAnime, sAnimations, 3, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 3, &this->unk_32C); } else if (this->unk_32C == 3) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { - func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C); } } else if ((this->unk_32C == 13) && func_80147624(globalCtx)) { func_801477B4(globalCtx); @@ -474,12 +474,12 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { switch (this->unk_32C) { case 11: - func_8013E1C8(&this->skelAnime, sAnimations, 15, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 15, &this->unk_32C); break; case 15: if (this->skelAnime.curFrame == this->skelAnime.endFrame) { - func_8013E1C8(&this->skelAnime, sAnimations, 6, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 6, &this->unk_32C); } break; } @@ -498,7 +498,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { void func_80A72438(EnDno* this, GlobalContext* globalCtx) { this->unk_452 = 1; - func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C); this->actor.textId = 0; if (Flags_GetSwitch(globalCtx, ENDNO_GET_3F80(&this->actor))) { this->unk_454 = 1.0f; @@ -544,7 +544,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { case 0: if (this->unk_32C == 14) { if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x2D8)) { - func_8013E1C8(&this->skelAnime, sAnimations, 5, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 5, &this->unk_32C); } } else if ((this->unk_32C == 5) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Flags_GetSwitch(globalCtx, ENDNO_GET_3F80(&this->actor))) { @@ -554,7 +554,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { } else { func_801518B0(globalCtx, 0x800, &this->actor); } - func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C); } break; @@ -589,7 +589,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_8013E1C8(&this->skelAnime, sAnimations, 12, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 12, &this->unk_32C); func_801518B0(globalCtx, 0x803, &this->actor); } } @@ -605,7 +605,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { globalCtx->msgCtx.msgMode = 0x44; this->unk_452 = 1; this->unk_454 = 0.0f; - func_8013E1C8(&this->skelAnime, sAnimations, 8, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 8, &this->unk_32C); } break; @@ -631,7 +631,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { case 0x804: if (this->unk_32C == 14) { if (func_80147624(globalCtx)) { - func_8013E1C8(&this->skelAnime, sAnimations, 5, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 5, &this->unk_32C); if (!(this->unk_3B0 & 0x40)) { func_80A72CF8(this, globalCtx); this->unk_3B0 |= 0x40; @@ -658,7 +658,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { } void func_80A72AE4(EnDno* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->unk_32C); func_80A714B4(this, globalCtx); this->actionFunc = func_80A72B3C; } @@ -685,7 +685,7 @@ void func_80A72BA4(EnDno* this, GlobalContext* globalCtx) { } void func_80A72C04(EnDno* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->unk_32C); this->actor.flags |= 0x8000000; this->actor.flags &= ~(8 | 1); Math_Vec3f_Copy(&this->unk_334, &this->actor.world.pos); @@ -784,7 +784,7 @@ void func_80A730A0(EnDno* this, GlobalContext* globalCtx) { } if (phi_a2 >= 0) { - func_8013E1C8(&this->skelAnime, sAnimations, phi_a2, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, phi_a2, &this->unk_32C); } } @@ -829,11 +829,11 @@ void func_80A732C8(EnDno* this, GlobalContext* globalCtx) { if (Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C)) { this->unk_3B0 |= 4; this->unk_44E = 3; - func_8013E1C8(&this->skelAnime, sAnimations, 7, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 7, &this->unk_32C); } } else if (this->unk_44E == 3) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C); func_80A72438(this, globalCtx); } else { if (this->skelAnime.curFrame >= 20.0f) { @@ -875,7 +875,7 @@ void func_80A73408(EnDno* this, GlobalContext* globalCtx) { } if (sp33) { - func_8013E1C8(&this->skelAnime, sAnimations, phi_a2, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, phi_a2, &this->unk_32C); } } func_800EDF24(&this->actor, globalCtx, temp_v0); @@ -883,7 +883,7 @@ void func_80A73408(EnDno* this, GlobalContext* globalCtx) { if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && (this->unk_32C == 17)) { if (0) {}; - func_8013E1C8(&this->skelAnime, sAnimations, 18, &this->unk_32C); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 18, &this->unk_32C); } } 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 9a2d6099cf..e297117378 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -56,20 +56,33 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static ActorAnimationEntryS sAnimations[] = { - { &object_dnp_Anim_0007D8, 1.0f, 0, -1, 2, -4 }, { &object_dnp_Anim_0021DC, 1.0f, 0, -1, 0, 0 }, - { &object_dnp_Anim_0021DC, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_0026B8, 1.0f, 0, -1, 2, -4 }, - { &object_dnp_Anim_004D08, 1.0f, 0, -1, 2, -4 }, { &object_dnp_Anim_0071F4, 1.0f, 0, -1, 2, -4 }, - { &object_dnp_Anim_007960, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_008588, 1.0f, 0, -1, 2, 0 }, - { &object_dnp_Anim_00A900, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_00AEB8, 1.0f, 0, -1, 0, -4 }, - { &object_dnp_Anim_00B754, 1.0f, 0, -1, 2, -4 }, { &object_dnp_Anim_00674C, 1.0f, 0, -1, 0, -4 }, - { &object_dnp_Anim_00BAD8, 1.0f, 0, -1, 2, -4 }, { &object_dnp_Anim_006B74, 1.0f, 0, -1, 0, -4 }, - { &object_dnp_Anim_012428, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_00B324, 1.0f, 0, -1, 0, 0 }, - { &object_dnp_Anim_00B324, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_0115B8, 1.0f, 0, -1, 0, -4 }, - { &object_dnp_Anim_0115B8, 1.0f, 0, -1, 0, 0 }, { &object_dnp_Anim_00923C, 1.0f, 0, -1, 2, -4 }, - { &object_dnp_Anim_009AA0, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_00125C, 1.0f, 0, -1, 2, -4 }, - { &object_dnp_Anim_0017F8, 1.0f, 0, -1, 2, 0 }, { &object_dnp_Anim_001C1C, 1.0f, 0, -1, 0, -4 }, - { &object_dnp_Anim_0057AC, 1.0f, 0, -1, 2, 0 }, { &object_dnp_Anim_00625C, 1.0f, 0, -1, 0, -4 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_dnp_Anim_0026B8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnp_Anim_004D08, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnp_Anim_0071F4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnp_Anim_007960, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_008588, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnp_Anim_00A900, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_00AEB8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_00B754, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnp_Anim_00674C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_00BAD8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnp_Anim_006B74, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_012428, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_00B324, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnp_Anim_00B324, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_0115B8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_0115B8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnp_Anim_00923C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnp_Anim_009AA0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_00125C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnp_Anim_0017F8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnp_Anim_001C1C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnp_Anim_0057AC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnp_Anim_00625C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; static s32 D_80B3DE58[] = { @@ -122,7 +135,7 @@ s32 func_80B3CC38(EnDnp* this, s32 arg1) { if (arg1 != this->unk_340) { this->unk_340 = arg1; - ret = func_8013BC6C(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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 667d205fc1..3a9027b76d 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -57,17 +57,27 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; -static ActorAnimationEntryS D_80A5349C[] = { - { &object_dnq_Anim_008328, 1.0f, 0, -1, 0, 0 }, { &object_dnq_Anim_008328, 1.0f, 0, -1, 0, -4 }, - { &object_dnq_Anim_007528, 1.0f, 0, -1, 2, -4 }, { &object_dnq_Anim_0006F0, 1.0f, 0, -1, 2, 0 }, - { &object_dnq_Anim_000BF8, 1.0f, 0, -1, 0, -4 }, { &object_dnq_Anim_002690, 0.0f, 0, -1, 2, 0 }, - { &object_dnq_Anim_002690, 1.0f, 0, -1, 2, -4 }, { &object_dnq_Anim_003408, 1.0f, 0, -1, 0, -4 }, - { &object_dnq_Anim_006984, 1.0f, 0, -1, 2, -4 }, { &object_dnq_Anim_005E18, 1.0f, 0, -1, 2, -4 }, - { &object_dnq_Anim_005A14, 1.0f, 0, -1, 2, -4 }, { &object_dnq_Anim_005284, 1.0f, 0, -1, 2, -4 }, - { &object_dnq_Anim_001AEC, 1.0f, 0, -1, 2, 0 }, { &object_dnq_Anim_001100, 1.0f, 0, -1, 2, 0 }, - { &object_dnq_Anim_004EA0, 1.0f, 0, -1, 0, -4 }, { &object_dnq_Anim_00F504, 1.0f, 0, -1, 0, -4 }, - { &object_dnq_Anim_0047B8, 1.0f, 0, -1, 0, -4 }, { &object_dnq_Anim_003DBC, 1.0f, 0, -1, 2, -4 }, - { &object_dnq_Anim_005A14, 1.0f, 0, -1, 0, -4 }, { &object_dnq_Anim_003DBC, 1.0f, 0, -1, 0, -4 }, +static AnimationInfoS D_80A5349C[] = { + { &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 }, + { &object_dnq_Anim_0006F0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnq_Anim_000BF8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnq_Anim_002690, 0.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnq_Anim_002690, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnq_Anim_003408, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnq_Anim_006984, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnq_Anim_005E18, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnq_Anim_005A14, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnq_Anim_005284, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnq_Anim_001AEC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnq_Anim_001100, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnq_Anim_004EA0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnq_Anim_00F504, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnq_Anim_0047B8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnq_Anim_003DBC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dnq_Anim_005A14, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnq_Anim_003DBC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; void func_80A52530(GlobalContext* globalCtx, EnDnq* this) { @@ -94,7 +104,7 @@ s32 func_80A5257C(EnDnq* this, s32 arg1) { if (phi_v1) { this->unk_398 = arg1; - ret = func_8013BC6C(&this->skelAnime, D_80A5349C, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80A5349C, 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 f9b3bdcebc..378db036db 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -60,12 +60,17 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; -static ActorAnimationEntryS sAnimations[] = { - { &object_dns_Anim_003310, 1.0f, 0, -1, 0, 0 }, { &object_dns_Anim_003310, 1.0f, 0, -1, 0, -4 }, - { &object_dns_Anim_0034EC, 1.0f, 0, -1, 0, 0 }, { &object_dns_Anim_0034EC, 1.0f, 0, -1, 0, -4 }, - { &object_dns_Anim_0008F4, 1.0f, 0, -1, 2, 0 }, { &object_dns_Anim_000BD8, 1.0f, 0, -1, 0, 0 }, - { &object_dns_Anim_000D58, 1.0f, 0, -1, 2, 0 }, { &object_dns_Anim_000FEC, 1.0f, 0, -1, 0, 0 }, - { &object_dns_Anim_0002A8, 1.0f, 0, -1, 2, 0 }, { &object_dns_Anim_000734, 1.0f, 0, -1, 2, 0 }, +static AnimationInfoS sAnimations[] = { + { &object_dns_Anim_003310, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dns_Anim_003310, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dns_Anim_0034EC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dns_Anim_0034EC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dns_Anim_0008F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dns_Anim_000BD8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dns_Anim_000D58, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dns_Anim_000FEC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dns_Anim_0002A8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dns_Anim_000734, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; void func_8092C5C0(EnDns* this) { @@ -79,7 +84,7 @@ void func_8092C5C0(EnDns* this) { s32 func_8092C63C(EnDns* this, s32 arg1) { s32 phi_v1 = false; - s32 ret = 0; + s32 ret = false; switch (arg1) { case 0: @@ -104,7 +109,7 @@ s32 func_8092C63C(EnDns* this, s32 arg1) { if (phi_v1) { this->unk_2F8 = arg1; - ret = func_8013BC6C(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); } return ret; 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 ea0c820270..18a63fff2b 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -95,11 +95,11 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &object_fr_Anim_001534, 1.0f, 0, -1, 0, 0 }, - { &object_fr_Anim_001534, 1.0f, 0, -1, 0, -4 }, - { &object_fr_Anim_0011C0, 1.0f, 0, -1, 0, -4 }, - { &object_fr_Anim_0007BC, 1.0f, 0, -1, 2, -4 }, +static AnimationInfoS sAnimations[] = { + { &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) { @@ -111,11 +111,11 @@ s32 EnFg_UpdateAnimation(SkelAnime* skelAnime, s16 animIndex) { ret = true; frameCount = sAnimations[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(sAnimations[animIndex].animationSeg); + frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation); } - Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed, - sAnimations[animIndex].frame, frameCount, sAnimations[animIndex].mode, - sAnimations[animIndex].transitionRate); + Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, + sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode, + sAnimations[animIndex].morphFrames); } return ret; } 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 4b6210dd0e..a59f775ceb 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -59,14 +59,20 @@ const ActorInit En_Fsn_InitVars = { (ActorFunc)EnFsn_Draw, }; -static ActorAnimationEntryS sAnimations[] = { - { &object_fsn_Anim_012C34, 1.0f, 0, -1, 0, 0 }, { &object_fsn_Anim_0131FC, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_00C58C, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00C58C, -1.0f, 0, -1, 2, 0 }, - { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00F00C, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00D354, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_0138B0, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_01430C, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00C26C, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_00DE34, 1.0f, 0, -1, 2, 0 }, +static AnimationInfoS sAnimations[] = { + { &object_fsn_Anim_012C34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_0131FC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_00C58C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00C58C, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00F00C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00D354, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_0138B0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_01430C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00C26C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_00DE34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; static ColliderCylinderInit sCylinderInit = { @@ -687,7 +693,7 @@ void EnFsn_InitShop(EnFsn* this, GlobalContext* globalCtx) { this->blinkTimer = 20; this->animationIdx = 4; this->eyeTextureIdx = 0; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); this->actionFunc = EnFsn_Idle; } @@ -696,10 +702,10 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) { if (this->animationIdx == 4) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animationSeg); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); if (curFrame == frameCount) { this->animationIdx = 5; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); } return; } @@ -732,12 +738,12 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) { void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animationSeg); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); if (this->flags & ENFSN_ANGRY) { this->flags &= ~ENFSN_ANGRY; this->animationIdx = 11; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); } else { if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); @@ -745,16 +751,16 @@ void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) { if (this->flags & ENFSN_CALM_DOWN) { this->flags &= ~ENFSN_CALM_DOWN; this->animationIdx = 5; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); } else if (this->flags & ENFSN_OFFER_FINAL_PRICE) { this->flags &= ~ENFSN_OFFER_FINAL_PRICE; this->animationIdx = 12; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); } else { if (this->animationIdx == 12) { if (curFrame == frameCount) { this->animationIdx = 5; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); } else { if (Animation_OnFrame(&this->skelAnime, 28.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); @@ -1403,7 +1409,7 @@ void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 1; this->actor.targetMode = 0; this->animationIdx = 0; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); this->actionFunc = EnFsn_IdleBackroom; } } @@ -1420,7 +1426,7 @@ void EnFsn_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveWithGravity(&this->actor); func_800E9250(globalCtx, &this->actor, &this->headRot, &this->unk27A, this->actor.focus.pos); - func_8013D9C8(globalCtx, this->limbRotYTable, this->limbRotZTable, 19); + SubS_FillLimbRotTables(globalCtx, this->limbRotYTable, this->limbRotZTable, ARRAY_COUNT(this->limbRotYTable)); EnFsn_Blink(this); if (ENFSN_IS_SHOP(&this->actor) && EnFsn_HasItemsToSell()) { EnFsn_UpdateJoystickInputState(this, globalCtx); 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 3ffd64097b..19360748a7 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -74,11 +74,14 @@ 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 ActorAnimationEntry sAnimations[] = { - { &object_mu_Anim_0053E0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &object_mu_Anim_001F74, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_mu_Anim_002F64, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &object_mu_Anim_004904, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_mu_Anim_005304, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_mu_Anim_005304, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_mu_Anim_00BAC4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_mu_Anim_004904, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_mu_Anim_005304, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_mu_Anim_005304, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_mu_Anim_00BAC4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -369,7 +372,7 @@ void func_8096209C(EnFu* this, GlobalContext* globalCtx) { } void func_809622FC(EnFu* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80962340; } @@ -534,7 +537,7 @@ void func_80962660(EnFu* this, GlobalContext* globalCtx) { func_801477B4(globalCtx); player->stateFlags1 |= 0x20; this->unk_53C = 0; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); func_801A2BB8(NA_BGM_MINI_GAME_2); if (this->unk_542 == 0) { if (this->unk_546 == 1) { @@ -1211,7 +1214,7 @@ void func_80964190(EnFu* this, GlobalContext* globalCtx) { case 0x2842: case 0x2844: case 0x2848: - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); break; case 0x2840: @@ -1237,21 +1240,21 @@ void func_80964190(EnFu* this, GlobalContext* globalCtx) { case 0x286B: case 0x286D: case 0x2871: - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); break; case 0x2860: - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); break; case 0x285F: - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); break; case 0x287E: case 0x2880: case 0x2883: - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); break; } } 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 2c13764b9e..3207a1d12d 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -125,18 +125,28 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, 0, 0 }, { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, 0, -4 }, - { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, 0 }, { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, -4 }, - { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, 2, -4 }, { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, 0, 0 }, - { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, 0, -4 }, { &object_oF1d_map_Anim_0039D8, 1.0f, 0, -1, 2, -4 }, - { &object_taisou_Anim_0016C8, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_004DD4, 1.0f, 0, -1, 0, 0 }, - { &object_taisou_Anim_00283C, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_007764, 1.0f, 0, -1, 0, 0 }, - { &object_taisou_Anim_005EE0, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_002C48, 1.0f, 0, -1, 0, 0 }, - { &object_taisou_Anim_0031D8, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_005790, 1.0f, 0, -1, 0, 0 }, - { &object_oF1d_map_Anim_003650, 1.0f, 0, -1, 0, 0 }, { &object_hakugin_demo_Anim_002704, 1.0f, 0, -1, 2, 0 }, - { &object_hakugin_demo_Anim_003378, 1.0f, 0, -1, 0, -4 }, { &object_oF1d_map_Anim_0135E8, 1.0f, 0, -1, 2, 0 }, - { &object_oF1d_map_Anim_014CE0, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimations[] = { + { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_oF1d_map_Anim_0039D8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_taisou_Anim_0016C8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_004DD4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_00283C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_007764, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_005EE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_002C48, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_0031D8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_005790, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_oF1d_map_Anim_003650, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_hakugin_demo_Anim_002704, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_hakugin_demo_Anim_003378, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_oF1d_map_Anim_0135E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_oF1d_map_Anim_014CE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; u16 func_80BB16D0(EnGeg* this) { @@ -368,7 +378,7 @@ void func_80BB1FCC(EnGeg* this, GlobalContext* globalCtx) { void func_80BB2020(EnGeg* this, GlobalContext* globalCtx) { gSegments[6] = PHYSICAL_TO_VIRTUAL2(globalCtx->objectCtx.status[this->unk_248].segment); - func_8013BC6C(&this->skelAnime, sAnimations, this->unk_4AC); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_4AC); } s32 func_80BB2088(EnGeg* this, GlobalContext* globalCtx) { @@ -598,7 +608,7 @@ void func_80BB27D4(EnGeg* this, GlobalContext* globalCtx) { void func_80BB2944(EnGeg* this, GlobalContext* globalCtx) { u8 sp27 = Message_GetState(&globalCtx->msgCtx); s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_4AC].animationSeg); + s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_4AC].animation); if (this->unk_4AC == 19) { if (curFrame == lastFrame) { @@ -694,7 +704,7 @@ void func_80BB2B1C(EnGeg* this, GlobalContext* globalCtx) { void func_80BB2E00(EnGeg* this, GlobalContext* globalCtx) { s16 sp2E = this->skelAnime.curFrame; - s16 sp2C = Animation_GetLastFrame(sAnimations[this->unk_4AC].animationSeg); + s16 sp2C = Animation_GetLastFrame(sAnimations[this->unk_4AC].animation); if (this->unk_4AC == 2) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100); @@ -894,7 +904,7 @@ void EnGeg_Update(Actor* thisx, GlobalContext* globalCtx) { func_80BB1FCC(this, globalCtx); func_80BB2088(this, globalCtx); func_80BB1C8C(this); - func_8013D9C8(globalCtx, &this->unk_238, &this->unk_232, 3); + SubS_FillLimbRotTables(globalCtx, this->unk_238, this->unk_232, ARRAY_COUNT(this->unk_238)); func_80BB1D04(this); func_80BB178C(this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.h b/src/overlays/actors/ovl_En_Geg/z_en_geg.h index c846f447b7..f5e9ad34db 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.h +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.h @@ -14,10 +14,8 @@ typedef struct EnGeg { /* 0x18C */ ColliderCylinder colliderCylinder; /* 0x1D8 */ ColliderSphere colliderSphere; /* 0x230 */ u16 unk_230; - /* 0x232 */ s16 unk_232; - /* 0x234 */ UNK_TYPE1 unk234[4]; - /* 0x238 */ s16 unk_238; - /* 0x23A */ UNK_TYPE1 unk23A[0x4]; + /* 0x232 */ s16 unk_232[3]; + /* 0x238 */ s16 unk_238[3]; /* 0x23E */ s16 unk_23E; /* 0x240 */ s16 unk_240; /* 0x242 */ s16 unk_242; 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 9ade835fc2..d4190d1dba 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,12 +42,12 @@ const ActorInit En_Ginko_Man_InitVars = { (ActorFunc)EnGinkoMan_Draw, }; -ActorAnimationEntry animations[] = { - { &object_boj_Anim_0008C0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_boj_Anim_0043F0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_boj_Anim_004F40, 1.0f, 0.0f, 0.0f, 2, -4.0f }, - { &object_boj_Anim_000AC4, 1.0f, 0.0f, 0.0f, 0, -4.0f }, // looking around for customers - { &object_boj_Anim_004A7C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_boj_Anim_000AC4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, // looking around for customers + { &object_boj_Anim_004A7C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, }; void EnGinkoMan_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -72,7 +72,7 @@ void EnGinkoMan_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnGinkoMan_SetupIdle(EnGinkoMan* this) { this->actor.flags |= 1; // targetable - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); this->actionFunc = EnGinkoMan_Idle; } @@ -82,11 +82,11 @@ void EnGinkoMan_Idle(EnGinkoMan* this, GlobalContext* globalCtx) { EnGinkoMan_SwitchAnimation(this, globalCtx); if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if ((gSaveContext.bankRupees & 0xFFFF) == 0) { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x44C, &this->actor); this->curTextId = 0x44C; // would you like to make an account } else { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) { func_801518B0(globalCtx, 0x467, &this->actor); this->curTextId = 0x467; // "What's this? You need somethin' on a day like this? @@ -109,7 +109,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { switch (this->curTextId) { case 0x44C: // "Hey there, little guy! Won't you deposit some Rupees? (first dialogue) - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); if (gSaveContext.weekEventReg[10] & 8) { func_801518B0(globalCtx, 0x44E, &this->actor); this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees" @@ -124,7 +124,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { 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_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x450, &this->actor); this->curTextId = 0x450; // "How much? How much? [rupee prompt] break; @@ -135,14 +135,14 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { if (this->isNewAccount == true) { this->isNewAccount = false; if (this->curTextId != 0x453) { // "That's it? That ain't nothing at all, big spender! - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); } func_801518B0(globalCtx, 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_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); } globalCtx->msgCtx.bankRupees = gSaveContext.bankRupees & 0xFFFF; @@ -172,17 +172,17 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { func_801518B0(globalCtx, 0x45D, &this->actor); this->curTextId = 0x45D; // "What's this? You've already saved up 5000 Rupees?! } else if (this->previousBankValue < (s16)(gSaveContext.bankRupees & 0xFFFF)) { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); func_801518B0(globalCtx, 0x45E, &this->actor); this->curTextId = 0x45E; // "...Hang on there, little guy. I can't take any more deposits. Sorry..." } else { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x460, &this->actor); this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!" } } else { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x460, &this->actor); this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!" } @@ -212,7 +212,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { EnGinkoMan_SetupStamp(this); // stamp player break; case 0x465: // "There! Now I'll know you when I see you!" - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); globalCtx->msgCtx.bankRupees = gSaveContext.bankRupees & 0xFFFF; func_801518B0(globalCtx, 0x45A, &this->actor); this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!" @@ -269,7 +269,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { break; case 0x476: // "...You haven't deposited that many Rupees, so that much isn't available for withdrawal. Do the // math! - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_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 +336,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx) if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) { if (gSaveContext.rupees < globalCtx->msgCtx.bankRupeesSelected) { play_sound(NA_SE_SY_ERROR); - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); func_801518B0(globalCtx, 0x459, &this->actor); this->curTextId = 0x459; // HEY you dont have that much } else { @@ -348,7 +348,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx) func_801518B0(globalCtx, 0x454, &this->actor); this->curTextId = 0x454; // Seriously? that's a lot. A lot! } else { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); func_801518B0(globalCtx, 0x453, &this->actor); this->curTextId = 0x453; // That's it? That aint nothing at all } @@ -365,7 +365,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx) } } else { // GINKOMAN_CHOICE_NO func_8019F230(); - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); if ((gSaveContext.bankRupees & 0xFFFF) == 0) { func_801518B0(globalCtx, 0x456, &this->actor); this->curTextId = 0x456; // Is that so? think about it @@ -398,7 +398,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx) if ((s32)((gSaveContext.bankRupees & 0xFFFF)) < ((s32)(globalCtx->msgCtx.bankRupeesSelected + this->serviceFee))) { play_sound(NA_SE_SY_ERROR); - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x476, &this->actor); this->curTextId = 0x476; // you dont have enough deposited to withdrawl } else if (CUR_CAPACITY(UPG_WALLET) < (globalCtx->msgCtx.bankRupeesSelected + gSaveContext.rupees)) { @@ -440,7 +440,7 @@ void EnGinkoMan_WaitForRupeeCount(EnGinkoMan* this, GlobalContext* globalCtx) { switch (this->curTextId) { case 0x450: // "How much? How much?" [rupee prompt] Set the amount with [Control Stick] and if (globalCtx->msgCtx.bankRupeesSelected == 0) { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); func_801518B0(globalCtx, 0x457, &this->actor); this->curTextId = 0x457; // Zero Rupees? Cruel joke! } else { @@ -539,7 +539,7 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) { func_801518B0(globalCtx, 0x47A, &this->actor); this->curTextId = 0x47A; // Message after receiving reward for depositing 200 rupees. } else { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); func_801518B0(globalCtx, 0x47B, &this->actor); this->curTextId = 0x47B; // Message after receiving reward for depositing 1000 rupees. } @@ -558,7 +558,7 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) { } void EnGinkoMan_SetupStamp(EnGinkoMan* this) { - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_REACHING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_REACHING); this->actionFunc = EnGinkoMan_Stamp; } @@ -571,12 +571,12 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) { 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_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); func_801518B0(globalCtx, 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_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING); globalCtx->msgCtx.bankRupees = (gSaveContext.bankRupees & 0xFFFF); if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) { func_801518B0(globalCtx, 0x46C, &this->actor); @@ -597,12 +597,12 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx) { if (this->animTimer == 0) { if (this->skelAnime.animation != &object_boj_Anim_004A7C) { this->animTimer = 40; - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_ADVERTISING); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_ADVERTISING); } } } else if ((this->animTimer == 0) && (this->skelAnime.animation != &object_boj_Anim_000AC4)) { this->animTimer = 40; - Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_AMAZED); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_AMAZED); } DECR(this->animTimer); 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 b3a84c672c..e8e8d5b0a3 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -128,14 +128,20 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static ActorAnimationEntryS D_80951CC0[13] = { - { &object_in2_Anim_009CDC, 1.0f, 0, -1, 0, 0 }, { &object_in2_Anim_009CDC, 1.0f, 0, -1, 0, -4 }, - { &object_in2_Anim_00A5E0, 1.0f, 0, -1, 0, 0 }, { &object_in2_Anim_00A70C, 1.0f, 0, 1, 0, 0 }, - { &object_in2_Anim_008090, 1.0f, 0, -1, 0, 0 }, { &object_in2_Anim_00898C, 1.0f, 0, -1, 2, -4 }, - { &object_in2_Anim_009450, 1.0f, 0, -1, 2, -4 }, { &object_in2_Anim_00AD18, 1.0f, 0, -1, 0, 0 }, - { &object_in2_Anim_00AD18, 1.0f, 0, -1, 0, -4 }, { &object_in2_Anim_00B8B0, 1.0f, 0, -1, 2, 0 }, - { &object_in2_Anim_00BA80, 1.0f, 0, -1, 0, -4 }, { &object_in2_Anim_00C03C, 1.0f, 0, -1, 0, -4 }, - { &object_in2_Anim_00B990, 1.0f, 0, -1, 0, -4 }, +static AnimationInfoS D_80951CC0[] = { + { &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 }, + { &object_in2_Anim_00A70C, 1.0f, 0, 1, ANIMMODE_LOOP, 0 }, + { &object_in2_Anim_008090, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_in2_Anim_00898C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_in2_Anim_009450, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_in2_Anim_00AD18, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_in2_Anim_00AD18, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in2_Anim_00B8B0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_in2_Anim_00BA80, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in2_Anim_00C03C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in2_Anim_00B990, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; Actor* func_8094DEE0(EnGm* this, GlobalContext* globalCtx, u8 arg2, s16 arg3) { @@ -230,7 +236,7 @@ s32 func_8094E054(EnGm* this, GlobalContext* globalCtx, s32 arg2) { if (phi_v1) { if (tmp >= 0) { this->unk_3E8 = arg2; - ret = func_8013BC6C(&this->skelAnime, D_80951CC0, arg2); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80951CC0, arg2); this->unk_3A8 = this->skelAnime.playSpeed; } } @@ -1344,7 +1350,7 @@ s32 func_80950690(EnGm* this, GlobalContext* globalCtx) { break; } - func_8013D9C8(globalCtx, this->unk_3D8, this->unk_3D2, ARRAY_COUNT(this->unk_3D2)); + SubS_FillLimbRotTables(globalCtx, this->unk_3D8, this->unk_3D2, ARRAY_COUNT(this->unk_3D8)); return false; } @@ -1532,16 +1538,11 @@ void func_80950DB8(EnGm* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&sp34, &sp40), 4, 0x2AA8); } } - func_8013D9C8(globalCtx, this->unk_3D8, this->unk_3D2, 3); + SubS_FillLimbRotTables(globalCtx, this->unk_3D8, this->unk_3D2, ARRAY_COUNT(this->unk_3D8)); } void func_80950F2C(EnGm* this, GlobalContext* globalCtx) { - s32 sp50[] = { - 0, - 0, - 3, - 2, - }; + s32 sp50[] = { 0, 0, 3, 2 }; Player* player = GET_PLAYER(globalCtx); s32 pad; Vec3f sp3C; 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 156651ee25..1d6d192ac0 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -186,20 +186,31 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, 0, 0 }, { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, 0, -4 }, - { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, 0 }, { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, -4 }, - { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, 2, 0 }, { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, 0, 0 }, - { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, 0, -4 }, { &object_oF1d_map_Anim_0039D8, 1.0f, 0, -1, 2, -4 }, - { &object_oF1d_map_Anim_003650, 1.0f, 0, -1, 0, 0 }, { &object_oF1d_map_Anim_0135E8, 1.0f, 0, -1, 2, -4 }, +static AnimationInfoS sAnimations[] = { + { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_oF1d_map_Anim_0039D8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_oF1d_map_Anim_003650, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_oF1d_map_Anim_0135E8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_taisou_Anim_004DD4, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_0016C8, 1.0f, 0, -1, 0, 0 }, - { &object_taisou_Anim_00283C, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_007764, 1.0f, 0, -1, 0, 0 }, - { &object_taisou_Anim_005EE0, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_002C48, 1.0f, 0, -1, 0, 0 }, - { &object_taisou_Anim_0031D8, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_005790, 1.0f, 0, -1, 0, 0 }, + { &object_taisou_Anim_004DD4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_0016C8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_00283C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_007764, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_005EE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_002C48, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_0031D8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_taisou_Anim_005790, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_hakugin_demo_Anim_001420, 1.0f, 0, -1, 2, 0 }, { &object_hakugin_demo_Anim_001A4C, 1.0f, 0, -1, 0, -4 }, - { &object_hakugin_demo_Anim_002704, 1.0f, 0, -1, 2, 0 }, { &object_hakugin_demo_Anim_003378, 1.0f, 0, -1, 0, -4 }, + { &object_hakugin_demo_Anim_001420, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_hakugin_demo_Anim_001A4C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_hakugin_demo_Anim_002704, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_hakugin_demo_Anim_003378, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; EnGoStruct* func_80A10FD0(EnGoStruct ptr[], Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 arg4, f32 arg5, s32 arg6) { @@ -768,7 +779,7 @@ s32 func_80A12B78(EnGo* this, GlobalContext* globalCtx) { s32 func_80A12C48(EnGo* this, GlobalContext* globalCtx, s32 arg2) { s8 objIdx = this->actor.objBankIndex; s8 objIdx2 = -1; - s32 ret = 0; + s32 ret = false; if ((arg2 >= 18) && (this->unk_289 >= 0)) { objIdx2 = this->unk_289; @@ -781,7 +792,7 @@ s32 func_80A12C48(EnGo* this, GlobalContext* globalCtx, s32 arg2) { if (objIdx2 >= 0) { gSegments[6] = PHYSICAL_TO_VIRTUAL2(globalCtx->objectCtx.status[objIdx2].segment); this->unk_3DC = arg2; - ret = func_8013BC6C(&this->skelAnime, sAnimations, arg2); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2); this->unk_398 = this->skelAnime.playSpeed; gSegments[6] = PHYSICAL_TO_VIRTUAL2(globalCtx->objectCtx.status[objIdx].segment); } @@ -1579,7 +1590,7 @@ void func_80A14B30(EnGo* this, GlobalContext* globalCtx) { this->actor.shape.yOffset = 0.0f; } - func_8013D9C8(globalCtx, &this->unk_3CE[0], &this->unk_3C8[0], 3); + SubS_FillLimbRotTables(globalCtx, this->unk_3CE, this->unk_3C8, ARRAY_COUNT(this->unk_3CE)); Math_ApproachS(&this->actor.shape.rot.y, sp26, 4, 0x2AA8); } @@ -1733,7 +1744,7 @@ void func_80A14FC8(EnGo* this, GlobalContext* globalCtx) { } } - func_8013D9C8(globalCtx, this->unk_3CE, this->unk_3C8, 3); + SubS_FillLimbRotTables(globalCtx, this->unk_3CE, this->unk_3C8, ARRAY_COUNT(this->unk_3CE)); func_800EDF24(&this->actor, globalCtx, sp2C); } } @@ -1853,7 +1864,7 @@ void func_80A157C4(EnGo* this, GlobalContext* globalCtx) { Math_Vec3f_Copy(&sp34, &this->actor.world.pos); Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&sp34, &sp40), 4, 0x2AA8); } - func_8013D9C8(globalCtx, this->unk_3CE, this->unk_3C8, 3); + SubS_FillLimbRotTables(globalCtx, this->unk_3CE, this->unk_3C8, ARRAY_COUNT(this->unk_3CE)); return; } 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 2ad64ef94c..708c798282 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -102,15 +102,15 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, 0x80, }; -static ActorAnimationEntry sAnimations[] = { - { &object_harfgibud_Anim_00260C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_harfgibud_Anim_009D44, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_harfgibud_Anim_00A164, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_harfgibud_Anim_000370, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &object_harfgibud_Anim_001138, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_harfgibud_Anim_0015D4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &object_harfgibud_Anim_001960, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_harfgibud_Anim_00AE1C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_harfgibud_Anim_000370, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &object_harfgibud_Anim_001138, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_harfgibud_Anim_0015D4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &object_harfgibud_Anim_001960, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_harfgibud_Anim_00AE1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, }; static u32 D_80BD00C8 = false; @@ -149,7 +149,7 @@ void EnHg_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80BCF354(EnHg* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80BCF398; } @@ -167,7 +167,7 @@ void func_80BCF398(EnHg* this, GlobalContext* globalCtx) { } void func_80BCF468(EnHg* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80BCF4AC; } @@ -191,7 +191,7 @@ void func_80BCF4AC(EnHg* this, GlobalContext* globalCtx) { } void func_80BCF5F0(EnHg* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80BCF634; } @@ -204,7 +204,7 @@ void func_80BCF634(EnHg* this, GlobalContext* globalCtx) { } void func_80BCF68C(EnHg* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); this->actionFunc = func_80BCF6D0; } @@ -278,17 +278,17 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) { case 1: this->currentAnimation = 0; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); break; case 2: this->cutscenes[2] = 0; this->currentAnimation = 3; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); break; case 3: this->cutscenes[2] = 0; this->currentAnimation = 5; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); break; case 4: this->cutscenes[2] = 0; @@ -296,11 +296,11 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) { if ((this->unk218 == 1) || (this->unk218 == 3)) { func_8019F128(NA_SE_EN_HALF_REDEAD_TRANS); } - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); break; case 5: this->currentAnimation = 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); break; case 6: gSaveContext.weekEventReg[0x4B] |= 0x20; @@ -312,11 +312,11 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) { switch (this->currentAnimation) { case 3: this->currentAnimation = 4; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); break; case 5: this->currentAnimation = 6; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); break; } } 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 2e2b6a84b3..38f25f9548 100644 --- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c +++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c @@ -40,14 +40,14 @@ const ActorInit En_Hgo_InitVars = { (ActorFunc)EnHgo_Draw, }; -static ActorAnimationEntry sAnimations[] = { - { &object_harfgibud_Anim_00B644, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_harfgibud_Anim_013684, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_harfgibud_Anim_0152EC, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &object_harfgibud_Anim_015C70, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_harfgibud_Anim_0165F0, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_harfgibud_Anim_014220, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &object_harfgibud_Anim_014A9C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_harfgibud_Anim_015C70, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_harfgibud_Anim_0165F0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_harfgibud_Anim_014220, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &object_harfgibud_Anim_014A9C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -128,7 +128,7 @@ void func_80BD0434(EnHgo* this, GlobalContext* globalCtx) { } void func_80BD049C(EnHgo* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80BD04E0; } @@ -255,28 +255,28 @@ s32 func_80BD0898(EnHgo* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) { case 1: this->unk_218 = 0; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); break; case 2: this->actor.draw = EnHgo_Draw; this->unk_218 = 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); break; case 3: this->unk_218 = 2; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); break; case 4: this->unk_218 = 3; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); break; case 5: this->unk_218 = 4; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); break; case 6: this->unk_218 = 5; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); break; } } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -292,11 +292,11 @@ s32 func_80BD0898(EnHgo* this, GlobalContext* globalCtx) { break; case 2: this->unk_218 = 3; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); break; case 5: this->unk_218 = 6; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 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 28225d2f68..de73118dad 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 @@ -125,14 +125,20 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -static ActorAnimationEntry sAnimations[] = { - { &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, 0, -4.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -1.0f }, - { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, 3, 4.0f }, { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -4.0f }, - { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, 2, -4.0f }, { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -16.0f }, - { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, - { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, 0, -8.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -16.0f }, + { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; static InitChainEntry sInitChain[] = { @@ -174,7 +180,7 @@ void func_80C1FE20(EnHintSkb* this, GlobalContext* globalCtx) { } void func_80C1FE30(EnHintSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->actor.speedXZ = 1.6f; this->actionFunc = func_80C1FE80; } @@ -193,7 +199,7 @@ void func_80C1FE80(EnHintSkb* this, GlobalContext* globalCtx) { void func_80C1FF30(EnHintSkb* this) { this->collider.base.atFlags &= ~AT_BOUNCED; this->actor.speedXZ = 0.0f; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); this->actionFunc = func_80C1FF88; } @@ -266,12 +272,12 @@ void func_80C2016C(EnHintSkb* this, GlobalContext* globalCtx) { void func_80C20274(EnHintSkb* this) { if (this->skelAnime.animation == &object_skb_Anim_00697C) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); this->actor.gravity = -1.0f; this->actor.speedXZ = 1.0f; } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -4.0f; } @@ -308,7 +314,7 @@ void func_80C20334(EnHintSkb* this, GlobalContext* globalCtx) { } void func_80C20484(EnHintSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); this->unk_3E8 |= 4; if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -6.0f; @@ -340,7 +346,7 @@ void func_80C20590(EnHintSkb* this, GlobalContext* globalCtx) { this->unk_2D4 = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3E8 |= 1; func_80C20274(this); @@ -367,7 +373,7 @@ void func_80C2069C(EnHintSkb* this, GlobalContext* globalCtx) { this->unk_2D4 = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3E8 |= 1; func_80C20274(this); @@ -396,10 +402,10 @@ void func_80C2077C(EnHintSkb* this, GlobalContext* globalCtx) { this->actor.speedXZ = 2.4f; this->actor.gravity = -1.0f; this->actor.velocity.y = 3.0f; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); } } else { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); func_801518B0(globalCtx, 0x1148, &this->actor); this->unk_3E6 = 0x1148; } @@ -458,7 +464,7 @@ void func_80C208D0(EnHintSkb* this, GlobalContext* globalCtx) { Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { func_801518B0(globalCtx, 0x1147, &this->actor); this->unk_3E6 = 0x1147; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); } } @@ -533,7 +539,7 @@ void func_80C20C24(EnHintSkb* this, GlobalContext* globalCtx) { case 0x1147: func_801518B0(globalCtx, 0x1148, &this->actor); this->unk_3E6 = 0x1148; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); break; case 0x1148: @@ -582,7 +588,7 @@ void func_80C20D64(EnHintSkb* this, GlobalContext* globalCtx) { this->actor.hintId = 255; this->actor.textId = 0; if (this->actionFunc == func_80C1FE80) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); } func_80C2075C(this); } @@ -692,7 +698,7 @@ void func_80C20E90(EnHintSkb* this, GlobalContext* globalCtx) { this->unk_2D8 = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); func_80C2066C(this); break; @@ -709,7 +715,7 @@ void func_80C20E90(EnHintSkb* this, GlobalContext* globalCtx) { case 13: Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); func_80C20274(this); break; 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 383ef2cd43..6539128c34 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -112,12 +112,17 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static ActorAnimationEntryS sAnimations[] = { - { &object_dai_Anim_0048B4, 1.0f, 0, -1, 0, 0 }, { &object_dai_Anim_0048B4, 1.0f, 0, -1, 0, -4 }, - { &object_dai_Anim_005100, 1.0f, 0, -1, 0, 0 }, { &object_dai_Anim_005100, 1.0f, 0, -1, 0, -4 }, - { &object_dai_Anim_0010F8, 1.0f, 0, -1, 2, 0 }, { &object_dai_Anim_001E44, 1.0f, 0, -1, 0, -4 }, - { &object_dai_Anim_0014BC, 1.0f, 0, -1, 2, 0 }, { &object_dai_Anim_003CAC, 1.0f, 0, -1, 2, -4 }, - { &object_dai_Anim_0040E0, 1.0f, 0, -1, 0, 0 }, { &object_dai_Anim_0040E0, 1.0f, 0, -1, 0, -4 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_dai_Anim_005100, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dai_Anim_0010F8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dai_Anim_001E44, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dai_Anim_0014BC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dai_Anim_003CAC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_dai_Anim_0040E0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dai_Anim_0040E0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; Actor* func_80BF1150(EnIg* this, GlobalContext* globalCtx, u8 actorCat, s16 actorId) { @@ -201,7 +206,7 @@ s32 func_80BF1284(EnIg* this, s32 arg1) { if (phi_v1) { this->unk_3FC = arg1; - ret = func_8013BC6C(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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 d749462946..bc4d3a89b8 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -131,16 +131,25 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &object_in_Anim_001D10, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_001D10, 1.0f, 0, -1, 0, -4 }, - { &object_in_Anim_014F8C, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_014F8C, 1.0f, 0, -1, 0, -4 }, - { &object_in_Anim_000CB0, 1.0f, 0, -1, 0, -4 }, { &object_in_Anim_0003B4, 1.0f, 0, -1, 0, -4 }, - { &object_in_Anim_001BE0, 1.0f, 0, -1, 0, -4 }, { &object_in_Anim_015918, 1.0f, 0, -1, 0, -4 }, - { &object_in_Anim_01C0B0, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_01C0B0, 1.0f, 0, -1, 0, -4 }, - { &object_in_Anim_01A140, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_01A140, 1.0f, 0, -1, 0, -4 }, - { &object_in_Anim_01B904, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_01B904, 1.0f, 0, -1, 0, -4 }, - { &object_in_Anim_01B3C4, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_01B3C4, 0.0f, 0, -1, 2, 0 }, - { &object_in_Anim_01B3C4, 1.0f, 0, -1, 0, -4 }, { &object_in_Anim_019EB4, 1.0f, 0, -1, 2, -4 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_in_Anim_014F8C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_000CB0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_0003B4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_001BE0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_015918, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_01C0B0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_in_Anim_01C0B0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_01A140, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_in_Anim_01A140, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_01B904, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_in_Anim_01B904, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_01B3C4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_in_Anim_01B3C4, 0.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_in_Anim_01B3C4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_in_Anim_019EB4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, }; static u16 D_808F6C0C[] = { @@ -155,11 +164,11 @@ s32 func_808F30B0(SkelAnime* skelAnime, s16 animIndex) { ret = true; frameCount = sAnimations[animIndex].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(sAnimations[animIndex].animationSeg); + frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation); } - Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed, - sAnimations[animIndex].frame, frameCount, sAnimations[animIndex].mode, - sAnimations[animIndex].transitionRate); + Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, + sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode, + sAnimations[animIndex].morphFrames); } return ret; } @@ -254,7 +263,7 @@ void func_808F3414(EnIn* this, GlobalContext* globalCtx) { } func_808F322C(this, 3); func_808F3178(this, globalCtx); - func_8013D9C8(globalCtx, this->unk376, this->unk39E, 20); + SubS_FillLimbRotTables(globalCtx, this->unk376, this->unk39E, ARRAY_COUNT(this->unk376)); } void func_808F35AC(EnIn* this, GlobalContext* globalCtx) { 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 0dc1d5df50..4613842957 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -133,17 +133,26 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &gGoronElderIdleAnim, 1.0f, 0, -1, 0, -10 }, { &gGoronElderWalkAnim, 1.0f, 0, -1, 0, -10 }, - { &gGoronElderWavingAnim, 1.0f, 0, -1, 0, -10 }, { &gGoronElderHeadShakeAnim, 1.0f, 0, -1, 0, -10 }, - { &gGoronElderSurpriseStartAnim, 1.0f, 0, -1, 2, -10 }, { &gGoronElderSurpriseLoopAnim, 1.0f, 0, -1, 0, -10 }, - { &gGoronElderAngryAnim, 1.0f, 0, -1, 0, -10 }, { &gGoronElderSurpriseStartAnim, 2.0f, 0, -1, 2, 0 }, - { &gGoronElderSurpriseStartAnim, -2.0f, 0, -1, 2, 0 }, { &gGoronElderWalkAnim, -1.0f, 0, -1, 0, -10 }, - { &gGoronElderTakeOutDrumAnim, 1.0f, 0, -1, 2, 0 }, { &gGoronElderDrumIdleAnim, 1.0f, 0, -1, 0, 0 }, - { &gGoronElderPlayingDrumAnim, 1.0f, 1, 44, 2, 0 }, { &gGoronElderThinkingAnim, 1.0f, 0, -1, 0, 0 }, - { &gGoronElderRememberingAnim, 1.0f, 0, -1, 2, 0 }, { &gGoronElderStrongRememberingAnim, 1.0f, 0, -1, 2, 0 }, - { &gGoronElderDepressedAnim, 1.0f, 0, -1, 0, 0 }, { &gGoronElderIdleAnim, 1.0f, 0, -1, 0, 0 }, - { &gGoronElderCradleAnim, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimations[] = { + { &gGoronElderIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &gGoronElderWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &gGoronElderWavingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &gGoronElderHeadShakeAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &gGoronElderSurpriseStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -10 }, + { &gGoronElderSurpriseLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &gGoronElderAngryAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &gGoronElderSurpriseStartAnim, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gGoronElderSurpriseStartAnim, -2.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gGoronElderWalkAnim, -1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &gGoronElderTakeOutDrumAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gGoronElderDrumIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gGoronElderPlayingDrumAnim, 1.0f, 1, 44, ANIMMODE_ONCE, 0 }, + { &gGoronElderThinkingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gGoronElderRememberingAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gGoronElderStrongRememberingAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gGoronElderDepressedAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gGoronElderIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gGoronElderCradleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; static Vec3f sSfxPos = { 0.0f, 0.0f, 0.0f }; @@ -288,19 +297,19 @@ void EnJg_SetupTalk(EnJg* this, GlobalContext* globalCtx) { switch (this->textId) { case 0xDAC: // What was I doing? this->animationIndex = EN_JG_ANIMATION_SHAKING_HEAD; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Talk; break; case 0xDAD: // I must hurry! this->animationIndex = EN_JG_ANIMATION_SURPRISE_START; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_AlternateTalkOrWalkInPlace; break; case 0xDB7: // You're Darmani! this->animationIndex = EN_JG_ANIMATION_SURPRISE_START; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Talk; break; @@ -311,7 +320,7 @@ void EnJg_SetupTalk(EnJg* this, GlobalContext* globalCtx) { case 0xDBD: // "...What?" case 0xDC4: // It's so cold I can't play this->animationIndex = EN_JG_ANIMATION_IDLE; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Talk; break; @@ -320,14 +329,14 @@ void EnJg_SetupTalk(EnJg* this, GlobalContext* globalCtx) { case 0xDBC: // Following me won't do you any good case 0xDC6: // I am counting on you this->animationIndex = EN_JG_ANIMATION_ANGRY; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); 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; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Talk; break; } @@ -408,12 +417,12 @@ void EnJg_GoronShrineCheer(EnJg* this, GlobalContext* globalCtx) { void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, GlobalContext* globalCtx) { u8 messageState = Message_GetState(&globalCtx->msgCtx); s16 currentFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animationSeg); + s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_START) { if (currentFrame == lastFrame) { this->animationIndex = EN_JG_ANIMATION_SURPRISE_LOOP; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); } } else if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_LOOP) { if ((messageState == 5) && (func_80147624(globalCtx))) { @@ -421,7 +430,7 @@ void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, GlobalContext* globalCtx) { globalCtx->msgCtx.unk12023 = 4; this->flags &= ~FLAG_LOOKING_AT_PLAYER; this->animationIndex = EN_JG_ANIMATION_WALK; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Walk; } } else if (this->animationIndex == EN_JG_ANIMATION_WALK) { @@ -463,12 +472,12 @@ void EnJg_Walk(EnJg* this, GlobalContext* globalCtx) { void EnJg_Talk(EnJg* this, GlobalContext* globalCtx) { u8 messageState = Message_GetState(&globalCtx->msgCtx); s16 currentFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animationSeg); + s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); u16 temp; if ((this->animationIndex == EN_JG_ANIMATION_SURPRISE_START) && (currentFrame == lastFrame)) { this->animationIndex = EN_JG_ANIMATION_SURPRISE_LOOP; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); } if ((messageState == 5) && (func_80147624(globalCtx))) { @@ -523,7 +532,7 @@ void EnJg_SetupWalk(EnJg* this, GlobalContext* globalCtx) { if (this->animationIndex != EN_JG_ANIMATION_WALK) { this->animationIndex = EN_JG_ANIMATION_WALK; this->freezeTimer = 1000; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Walk; } else { this->freezeTimer = 1000; @@ -533,7 +542,7 @@ void EnJg_SetupWalk(EnJg* this, GlobalContext* globalCtx) { void EnJg_Freeze(EnJg* this, GlobalContext* globalCtx) { s16 currentFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animationSeg); + s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); if (this->action == EN_JG_ACTION_SPAWNING) { this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW; @@ -543,7 +552,7 @@ void EnJg_Freeze(EnJg* this, GlobalContext* globalCtx) { 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; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_FrozenIdle; } else if (this->animationIndex == EN_JG_ANIMATION_FROZEN_START) { this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW; @@ -553,7 +562,7 @@ void EnJg_Freeze(EnJg* this, GlobalContext* globalCtx) { 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; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_FrozenIdle; } } @@ -571,11 +580,11 @@ void EnJg_FrozenIdle(EnJg* this, GlobalContext* globalCtx) { // Otherwise, he immediately begins walking after being // thawed out. if (this->textId == 0xDAC) { - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Idle; } else { this->freezeTimer = 1000; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Walk; } } @@ -665,7 +674,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, GlobalContext* globalCtx) { break; } - func_8013BC6C(&this->skelAnime, sAnimations, this->cutsceneAnimationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->cutsceneAnimationIndex); } if ((!(this->flags & FLAG_DRUM_SPAWNED)) && @@ -890,7 +899,7 @@ void EnJg_SpawnBreath(EnJg* this, GlobalContext* globalCtx) { */ void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, GlobalContext* globalCtx) { s16 currentFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animationSeg); + s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->flags |= FLAG_LOOKING_AT_PLAYER; @@ -917,7 +926,7 @@ void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, GlobalContext* this->freezeTimer--; if ((this->freezeTimer <= 0) && (currentFrame == lastFrame)) { this->animationIndex = EN_JG_ANIMATION_FROZEN_START; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); Audio_PlaySfxAtPos(&sSfxPos, NA_SE_EV_FREEZE_S); this->actionFunc = EnJg_Freeze; } @@ -944,7 +953,7 @@ void EnJg_Init(Actor* thisx, GlobalContext* globalCtx) { // This is the elder that appears in the cutscene for learning the full Goron Lullaby. this->animationIndex = EN_JG_ANIMATION_IDLE; this->action = EN_JG_ACTION_LULLABY_INTRO_CS; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_LullabyIntroCutsceneAction; } else { // This is the elder that appears in Mountain Village or the Path to Goron Village in winter. @@ -953,14 +962,14 @@ void EnJg_Init(Actor* thisx, GlobalContext* globalCtx) { this->action = EN_JG_ACTION_SPAWNING; this->freezeTimer = 1000; this->textId = 0xDAC; // What was I doing? - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_Freeze; } } else { // This is the elder that appears in Goron Shrine in spring. this->animationIndex = EN_JG_ANIMATION_IDLE; this->cutscene = this->actor.cutscene; - func_8013BC6C(&this->skelAnime, sAnimations, this->animationIndex); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnJg_GoronShrineIdle; } } 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 040d13859f..bd750edae5 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -132,8 +132,10 @@ static AnimationHeader* kakasiAnimations[] = { &object_ka_Anim_00686C, &object_ka_Anim_0081A4, &object_ka_Anim_000214, }; -static u8 sAnimModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE, - ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE }; +static u8 sAnimModes[] = { + ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE, + ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, +}; void EnKakasi_Destroy(Actor* thisx, GlobalContext* globalCtx) { EnKakasi* this = THIS; 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 7b53287fd1..d28ec4622a 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -112,33 +112,33 @@ void EnMa4_UpdateEyes(EnMa4* this) { } } -static struct_80B8E1A8 sAnimationInfo[] = { - { &object_ma1_Anim_009E58, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_009E58, 1.0f, 0, -6.0f }, // Idle anim - { &object_ma1_Anim_002A8C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_002A8C, 1.0f, 0, -6.0f }, // Looking around anim - { &object_ma1_Anim_018948, 1.0f, 2, 0.0f }, - { &object_ma1_Anim_018948, 1.0f, 2, -6.0f }, // Starts holding hands anim - { &object_ma1_Anim_01B76C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_01B76C, 1.0f, 0, -6.0f }, // Holnding hands anim - { &object_ma1_Anim_007328, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_007328, 1.0f, 0, -6.0f }, // Walking anim - { &object_ma1_Anim_014088, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_014088, 1.0f, 0, -6.0f }, // - { &object_ma1_Anim_015B7C, 1.0f, 2, 0.0f }, - { &object_ma1_Anim_015B7C, 1.0f, 2, -6.0f }, // Shoot arrow anim - { &object_ma1_Anim_007D98, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_007D98, 1.0f, 0, -6.0f }, // Sitting anim - { &object_ma1_Anim_00852C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_00852C, 1.0f, 0, -6.0f }, // Sitting traumatized anim - { &object_ma1_Anim_008F6C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_008F6C, 1.0f, 0, -6.0f }, // Sitting sad anim +static AnimationSpeedInfo sAnimationInfo[] = { + { &object_ma1_Anim_009E58, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_009E58, 1.0f, ANIMMODE_LOOP, -6.0f }, // Idle anim + { &object_ma1_Anim_002A8C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_002A8C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Looking around anim + { &object_ma1_Anim_018948, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_ma1_Anim_018948, 1.0f, ANIMMODE_ONCE, -6.0f }, // Starts holding hands anim + { &object_ma1_Anim_01B76C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_01B76C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Holnding hands anim + { &object_ma1_Anim_007328, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_007328, 1.0f, ANIMMODE_LOOP, -6.0f }, // Walking anim + { &object_ma1_Anim_014088, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_014088, 1.0f, ANIMMODE_LOOP, -6.0f }, // + { &object_ma1_Anim_015B7C, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_ma1_Anim_015B7C, 1.0f, ANIMMODE_ONCE, -6.0f }, // Shoot arrow anim + { &object_ma1_Anim_007D98, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_007D98, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting anim + { &object_ma1_Anim_00852C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_00852C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting traumatized anim + { &object_ma1_Anim_008F6C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_008F6C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting sad anim }; void EnMa4_ChangeAnim(EnMa4* this, s32 index) { - Animation_Change(&this->skelAnime, sAnimationInfo[index].animationSeg, 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationInfo[index].animationSeg), sAnimationInfo[index].mode, - sAnimationInfo[index].transitionRate); + Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, + sAnimationInfo[index].morphFrames); } void func_80ABDD9C(EnMa4* this, GlobalContext* globalCtx) { 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 67d44caffb..69948f426b 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 @@ -109,19 +109,19 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, MASS_IMMOVABLE, }; -static struct_80B8E1A8 sAnimationInfo[] = { - { &object_ma2_Anim_00A174, 1.0f, 0, 0.0f }, { &object_ma2_Anim_00A174, 1.0f, 0, -6.0f }, // - { &object_ma2_Anim_00AF7C, 1.0f, 2, 0.0f }, { &object_ma2_Anim_00AF7C, 1.0f, 2, -6.0f }, // - { &object_ma2_Anim_000CC0, 1.0f, 0, 0.0f }, { &object_ma2_Anim_000CC0, 1.0f, 0, -6.0f }, // - { &object_ma2_Anim_016720, 1.0f, 0, 0.0f }, { &object_ma2_Anim_016720, 1.0f, 0, -8.0f }, // - { &object_ma2_Anim_005314, 1.0f, 0, 0.0f }, { &object_ma2_Anim_005314, 1.0f, 0, -8.0f }, // - { &object_ma2_Anim_0093E8, 1.0f, 0, 0.0f }, { &object_ma2_Anim_0093E8, 1.0f, 0, -10.0f }, // - { &object_ma2_Anim_007E28, 1.0f, 0, 0.0f }, { &object_ma2_Anim_007E28, 1.0f, 0, -8.0f }, // - { &object_ma2_Anim_0070EC, 1.0f, 0, 0.0f }, { &object_ma2_Anim_0070EC, 1.0f, 0, -8.0f }, // - { &object_ma2_Anim_003D54, 1.0f, 0, 0.0f }, { &object_ma2_Anim_003D54, 1.0f, 0, -8.0f }, // - { &object_ma2_Anim_001FD0, 1.0f, 0, 0.0f }, { &object_ma2_Anim_001FD0, 1.0f, 0, -8.0f }, // - { &object_ma2_Anim_0030B4, 1.0f, 0, 0.0f }, { &object_ma2_Anim_0030B4, 1.0f, 0, -8.0f }, // - { &object_ma2_Anim_004370, 1.0f, 0, 0.0f }, { &object_ma2_Anim_004370, 1.0f, 0, -8.0f }, // +static AnimationSpeedInfo sAnimationInfo[] = { + { &object_ma2_Anim_00A174, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_00A174, 1.0f, ANIMMODE_LOOP, -6.0f }, // + { &object_ma2_Anim_00AF7C, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_ma2_Anim_00AF7C, 1.0f, ANIMMODE_ONCE, -6.0f }, // + { &object_ma2_Anim_000CC0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_000CC0, 1.0f, ANIMMODE_LOOP, -6.0f }, // + { &object_ma2_Anim_016720, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_016720, 1.0f, ANIMMODE_LOOP, -8.0f }, // + { &object_ma2_Anim_005314, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_005314, 1.0f, ANIMMODE_LOOP, -8.0f }, // + { &object_ma2_Anim_0093E8, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0093E8, 1.0f, ANIMMODE_LOOP, -10.0f }, // + { &object_ma2_Anim_007E28, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_007E28, 1.0f, ANIMMODE_LOOP, -8.0f }, // + { &object_ma2_Anim_0070EC, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0070EC, 1.0f, ANIMMODE_LOOP, -8.0f }, // + { &object_ma2_Anim_003D54, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_003D54, 1.0f, ANIMMODE_LOOP, -8.0f }, // + { &object_ma2_Anim_001FD0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_001FD0, 1.0f, ANIMMODE_LOOP, -8.0f }, // + { &object_ma2_Anim_0030B4, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0030B4, 1.0f, ANIMMODE_LOOP, -8.0f }, // + { &object_ma2_Anim_004370, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_004370, 1.0f, ANIMMODE_LOOP, -8.0f }, // }; static TexturePtr sMouthTextures[] = { @@ -1265,9 +1265,9 @@ void EnMaYto_BarnStartDialogue(EnMaYto* this, GlobalContext* globalCtx) { } void EnMaYto_ChangeAnim(EnMaYto* this, s32 index) { - Animation_Change(&this->skelAnime, sAnimationInfo[index].animationSeg, 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationInfo[index].animationSeg), sAnimationInfo[index].mode, - sAnimationInfo[index].transitionRate); + Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, + sAnimationInfo[index].morphFrames); } void func_80B90C78(EnMaYto* this, GlobalContext* globalCtx) { 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 ee186086cc..dc1129e07a 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 @@ -78,29 +78,29 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, MASS_IMMOVABLE, }; -static struct_80B8E1A8 sAnimationInfo[] = { - { &object_ma1_Anim_009E58, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_009E58, 1.0f, 0, -6.0f }, // Idle anim - { &object_ma1_Anim_018948, 1.0f, 2, 0.0f }, - { &object_ma1_Anim_018948, 1.0f, 2, -6.0f }, // Starts holding hands anim - { &object_ma1_Anim_01B76C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_01B76C, 1.0f, 0, -6.0f }, // Holnding hands anim - { &object_ma1_Anim_007328, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_007328, 1.0f, 0, -6.0f }, // Walking anim - { &object_ma1_Anim_014088, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_014088, 1.0f, 0, -6.0f }, // - { &object_ma1_Anim_002A8C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_002A8C, 1.0f, 0, -6.0f }, // Looking around anim - { &object_ma1_Anim_015B7C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_015B7C, 1.0f, 0, -6.0f }, // Shoot arrow anim - { &object_ma1_Anim_007D98, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_007D98, 1.0f, 0, -6.0f }, // Sitting anim - { &object_ma1_Anim_00852C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_00852C, 1.0f, 0, -6.0f }, // Sitting traumatized anim - { &object_ma1_Anim_008F6C, 1.0f, 0, 0.0f }, - { &object_ma1_Anim_008F6C, 1.0f, 0, -6.0f }, // Sitting sad anim - { &object_ma1_Anim_0180DC, 1.0f, 2, 0.0f }, - { &object_ma1_Anim_0180DC, 1.0f, 2, -6.0f }, // Turns around anim +static AnimationSpeedInfo sAnimationInfo[] = { + { &object_ma1_Anim_009E58, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_009E58, 1.0f, ANIMMODE_LOOP, -6.0f }, // Idle anim + { &object_ma1_Anim_018948, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_ma1_Anim_018948, 1.0f, ANIMMODE_ONCE, -6.0f }, // Starts holding hands anim + { &object_ma1_Anim_01B76C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_01B76C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Holnding hands anim + { &object_ma1_Anim_007328, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_007328, 1.0f, ANIMMODE_LOOP, -6.0f }, // Walking anim + { &object_ma1_Anim_014088, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_014088, 1.0f, ANIMMODE_LOOP, -6.0f }, // + { &object_ma1_Anim_002A8C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_002A8C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Looking around anim + { &object_ma1_Anim_015B7C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_015B7C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Shoot arrow anim + { &object_ma1_Anim_007D98, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_007D98, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting anim + { &object_ma1_Anim_00852C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_00852C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting traumatized anim + { &object_ma1_Anim_008F6C, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &object_ma1_Anim_008F6C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting sad anim + { &object_ma1_Anim_0180DC, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &object_ma1_Anim_0180DC, 1.0f, ANIMMODE_ONCE, -6.0f }, // Turns around anim }; static TexturePtr sMouthTextures[] = { @@ -115,9 +115,9 @@ static TexturePtr sEyeTextures[] = { }; void EnMaYts_ChangeAnim(EnMaYts* this, s32 index) { - Animation_Change(&this->skelAnime, sAnimationInfo[index].animationSeg, 1.0f, 0.0f, - Animation_GetLastFrame(sAnimationInfo[index].animationSeg), sAnimationInfo[index].mode, - sAnimationInfo[index].transitionRate); + Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, + sAnimationInfo[index].morphFrames); } void func_80B8D12C(EnMaYts* this, GlobalContext* globalCtx) { 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 ed752ea1cf..10214b6095 100644 --- a/src/overlays/actors/ovl_En_Muto/z_en_muto.c +++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.c @@ -101,7 +101,7 @@ void EnMuto_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnMuto_ChangeAnim(EnMuto* this, s32 animIndex) { static AnimationHeader* sAnimations[] = { &object_toryo_Anim_000E50, &object_toryo_Anim_000E50 }; - static u8 sAnimationModes[] = { 0, 2 }; + static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_ONCE }; this->animIndex = animIndex; this->frameIndex = Animation_GetLastFrame(&sAnimations[animIndex]->common); 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 1e0b4e4951..9bf1abcfe6 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -65,28 +65,40 @@ const ActorInit En_Ossan_InitVars = { (ActorFunc)NULL, }; -static ActorAnimationEntryS sAnimationsCuriosityShopMan[] = { - { &object_fsn_Anim_012C34, 1.0f, 0, -1, 0, 0 }, { &object_fsn_Anim_0131FC, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_00C58C, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00C58C, -1.0f, 0, -1, 2, 0 }, - { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00F00C, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00D354, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_0138B0, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_01430C, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00C26C, 1.0f, 0, -1, 0, 0 }, - { &object_fsn_Anim_00DE34, 1.0f, 0, -1, 2, 0 }, +static AnimationInfoS sAnimationsCuriosityShopMan[] = { + { &object_fsn_Anim_012C34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_0131FC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_00C58C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00C58C, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00F00C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00D354, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_0138B0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_01430C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_fsn_Anim_00C26C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_fsn_Anim_00DE34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; -static ActorAnimationEntryS sAnimationsPartTimeWorker[] = { - { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, -10 }, { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, -10 }, - { &object_ani_Anim_009D34, 1.0f, 0, -1, 2, 0 }, { &object_ani_Anim_009D34, -1.0f, 0, -1, 2, 0 }, - { &object_ani_Anim_009D34, 1.0f, 0, -1, 2, 0 }, { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, 0 }, - { &object_ani_Anim_009D34, 1.0f, 0, -1, 2, 0 }, { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, 0 }, - { &object_ani_Anim_00A460, 1.0f, 0, -1, 2, -5 }, { &object_ani_Anim_00A460, 1.0f, 0, -1, 0, -5 }, - { &object_ani_Anim_009D34, 1.0f, 0, -1, 2, 0 }, { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimationsPartTimeWorker[] = { + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_LOOP, -10 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_ani_Anim_009D34, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_ani_Anim_00A460, 1.0f, 0, -1, ANIMMODE_ONCE, -5 }, + { &object_ani_Anim_00A460, 1.0f, 0, -1, ANIMMODE_LOOP, -5 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; static s16 sObjectIds[] = { OBJECT_FSN, OBJECT_ANI }; -static ActorAnimationEntryS* sAnimations[] = { sAnimationsCuriosityShopMan, sAnimationsPartTimeWorker }; +static AnimationInfoS* sAnimations[] = { sAnimationsCuriosityShopMan, sAnimationsPartTimeWorker }; static f32 sActorScales[] = { 0.01f, 0.01f }; @@ -313,7 +325,7 @@ void EnOssan_SetupLookToShopkeeperFromShelf(GlobalContext* globalCtx, EnOssan* t void EnOssan_Idle(EnOssan* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - func_8013D9C8(globalCtx, this->limbRotTableY, this->limbRotTableZ, 19); + SubS_FillLimbRotTables(globalCtx, this->limbRotTableY, this->limbRotTableZ, ARRAY_COUNT(this->limbRotTableY)); if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { player->stateFlags2 |= 0x20000000; EnOssan_SetupAction(this, EnOssan_BeginInteraction); @@ -338,9 +350,9 @@ void EnOssan_Idle(EnOssan* this, GlobalContext* globalCtx) { } void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) { - ActorAnimationEntryS* animations = sAnimations[this->actor.params]; + AnimationInfoS* animations = sAnimations[this->actor.params]; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(animations[this->animationIdx].animationSeg); + s16 frameCount = Animation_GetLastFrame(animations[this->animationIdx].animation); if (this->animationIdx == 3) { frameCount = 0; @@ -358,19 +370,19 @@ void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) { switch (this->animationIdx) { case 1: this->animationIdx = 2; - func_8013BC6C(&this->skelAnime, animations, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 2); break; case 2: EnOssan_SetHaveMet(this); this->textId = EnOssan_GetWelcomeCuriosityShopMan(this, globalCtx); - func_8013BC6C(&this->skelAnime, animations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIdx); break; case 4: case 6: case 8: case 10: this->animationIdx++; - func_8013BC6C(&this->skelAnime, animations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIdx); func_801518B0(globalCtx, this->textId, &this->actor); EnOssan_SetupStartShopping(globalCtx, this, false); break; @@ -379,16 +391,16 @@ void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) { case 9: case 11: this->animationIdx = 3; - func_8013BC6C(&this->skelAnime, animations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 3); break; case 3: this->animationIdx = 1; - func_8013BC6C(&this->skelAnime, animations, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); EnOssan_SetupAction(this, EnOssan_Idle); break; default: this->animationIdx = 1; - func_8013BC6C(&this->skelAnime, animations, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); EnOssan_SetupAction(this, EnOssan_Idle); break; } @@ -506,7 +518,7 @@ u8 EnOssan_CursorLeft(EnOssan* this, u8 cursorIdx, u8 shelfSlotMax) { } void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) { - ActorAnimationEntryS* animations = sAnimations[this->actor.params]; + AnimationInfoS* animations = sAnimations[this->actor.params]; u8 talkState = Message_GetState(&globalCtx->msgCtx); s32 pad; Player* player = GET_PLAYER(globalCtx); @@ -515,7 +527,7 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) { if (talkState == 5 && func_80147624(globalCtx)) { if (this->animationIdx == 9 && this->actor.params == ENOSSAN_PART_TIME_WORKER) { this->animationIdx = 1; - func_8013BC6C(&this->skelAnime, animations, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); } this->flags &= ~LOOKED_AT_PLAYER; if (player->transformation == PLAYER_FORM_DEKU) { @@ -532,7 +544,7 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) { if (talkState == 10 && this->actor.params == ENOSSAN_PART_TIME_WORKER && player->transformation == PLAYER_FORM_ZORA && func_80147624(globalCtx)) { this->animationIdx = 9; - func_8013BC6C(&this->skelAnime, animations, 9); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 9); } if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); @@ -540,7 +552,7 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) { } s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, GlobalContext* globalCtx) { - ActorAnimationEntryS* animations = sAnimations[this->actor.params]; + AnimationInfoS* animations = sAnimations[this->actor.params]; Player* player = GET_PLAYER(globalCtx); switch (globalCtx->msgCtx.choiceIndex) { @@ -548,7 +560,7 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, GlobalContext* globalCtx func_8019F208(); if (this->actor.params == ENOSSAN_PART_TIME_WORKER && player->transformation == PLAYER_FORM_ZORA) { this->animationIdx = 9; - func_8013BC6C(&this->skelAnime, animations, 9); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 9); } EnOssan_SetupAction(this, EnOssan_TalkToShopkeeper); func_80151938(globalCtx, sTalkOptionTextIds[this->actor.params]); @@ -612,12 +624,12 @@ void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx) { } void EnOssan_TalkToShopkeeper(EnOssan* this, GlobalContext* globalCtx) { - ActorAnimationEntryS* animations = sAnimations[this->actor.params]; + AnimationInfoS* animations = sAnimations[this->actor.params]; if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { if (this->animationIdx == 9 && this->actor.params == ENOSSAN_PART_TIME_WORKER) { this->animationIdx = 1; - func_8013BC6C(&this->skelAnime, animations, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); } EnOssan_StartShopping(globalCtx, this); } @@ -1476,7 +1488,7 @@ void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx) { this->shopItemSelectedTween = 0.0f; Actor_SetScale(&this->actor, sActorScales[this->actor.params]); this->animationIdx = 1; - func_8013BC6C(&this->skelAnime, sAnimations[this->actor.params], 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations[this->actor.params], 1); EnOssan_SpawnShopItems(this, globalCtx, shopItems); this->blinkTimer = 20; this->eyeTexIndex = 0; 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 83538be6d6..7dc501cfe5 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -95,10 +95,10 @@ static ColliderCylinderInit sCylinderInit = { { 5, 33, -20, { 0, 0, 0 } }, }; -static struct_80B8E1A8 sAnimations[] = { - { &object_ot_Anim_004B30, 1.0f, 0, -5.0f }, - { &object_ot_Anim_0008D8, 1.0f, 0, -5.0f }, - { &object_ot_Anim_000420, 1.0f, 0, 0.0f }, +static AnimationSpeedInfo sAnimations[] = { + { &object_ot_Anim_004B30, 1.0f, ANIMMODE_LOOP, -5.0f }, + { &object_ot_Anim_0008D8, 1.0f, ANIMMODE_LOOP, -5.0f }, + { &object_ot_Anim_000420, 1.0f, ANIMMODE_LOOP, 0.0f }, }; static InitChainEntry sInitChain[] = { @@ -152,10 +152,10 @@ void EnOt_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ot_Skel_004800, &object_ot_Anim_0008D8, this->jointTable, this->morphTable, 19); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Animation_Change(&this->skelAnime, sAnimations[0].animationSeg, 1.0f, - Animation_GetLastFrame(&sAnimations[0].animationSeg->common) * Rand_ZeroOne(), - Animation_GetLastFrame(&sAnimations[0].animationSeg->common), sAnimations[0].mode, - sAnimations[0].transitionRate); + Animation_Change(&this->skelAnime, sAnimations[0].animation, 1.0f, + Animation_GetLastFrame(&sAnimations[0].animation->common) * Rand_ZeroOne(), + Animation_GetLastFrame(&sAnimations[0].animation->common), sAnimations[0].mode, + sAnimations[0].morphFrames); this->unk_346 = ENOT_GET_7F(&this->actor); this->unk_344 = this->actor.world.rot.z; this->actor.world.rot.z = 0; @@ -163,7 +163,7 @@ void EnOt_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.gravity = 0.0f; func_8013E3B8(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); - func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); this->skelAnime.curFrame = Rand_ZeroOne() * this->skelAnime.endFrame; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->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, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, sAnimations, 1, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx); func_8013E3B8(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); this->actionFunc = func_80B5BE04; } @@ -322,7 +322,7 @@ void func_80B5BE04(EnOt* this, GlobalContext* globalCtx) { } void func_80B5BE88(EnOt* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, sAnimations, 1, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx); this->actionFunc = func_80B5BED4; } @@ -337,7 +337,7 @@ void func_80B5BED4(EnOt* this, GlobalContext* globalCtx) { void func_80B5BF60(EnOt* this, GlobalContext* globalCtx) { this->unk_32C |= 0x40; - func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); this->actionFunc = func_80B5BFB8; } @@ -410,8 +410,8 @@ void func_80B5C25C(EnOt* this, GlobalContext* globalCtx) { 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; - func_8013E1C8(&this->skelAnime, sAnimations, 2, &this->animIdx); - func_8013E1C8(&this->unk_360->skelAnime, sAnimations, 2, &this->unk_360->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 2, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->unk_360->skelAnime, sAnimations, 2, &this->unk_360->animIdx); this->actor.flags |= 0x8000000; this->actor.flags &= ~(0x8 | 0x1); this->unk_360->actor.flags |= 0x8000000; @@ -489,7 +489,7 @@ void func_80B5C64C(EnOt* this, GlobalContext* globalCtx) { void func_80B5C684(EnOt* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; - func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); this->actionFunc = func_80B5C6DC; } @@ -635,7 +635,7 @@ void func_80B5CCA0(EnOt* this, GlobalContext* globalCtx) { } void func_80B5CCF4(EnOt* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); this->actionFunc = func_80B5CD40; } @@ -676,7 +676,7 @@ void func_80B5CD40(EnOt* this, GlobalContext* globalCtx) { void func_80B5CE6C(EnOt* this, GlobalContext* globalCtx) { this->unk_384 = 0; this->unk_32C |= 0x20; - func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); this->actionFunc = func_80B5CEC8; } @@ -731,7 +731,7 @@ void func_80B5CEC8(EnOt* this, GlobalContext* globalCtx) { } void func_80B5D114(EnOt* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx); this->actionFunc = func_80B5D160; } @@ -891,7 +891,7 @@ void func_80B5D648(EnOt* this, GlobalContext* globalCtx) { this->unk_2C0.unk_2C.z = 0.0f; this->actor.gravity = 0.0f; this->actor.speedXZ = 0.0f; - func_8013E1C8(&this->skelAnime, sAnimations, 1, &this->animIdx); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx); this->actor.flags |= 0x8000000; this->actor.flags &= ~(0x8 | 0x1); Flags_SetSwitch(globalCtx, ENOT_GET_3F80(&this->actor)); diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 1b6059607e..644c0d5e9a 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -41,7 +41,7 @@ void func_8095C484(EnOwl* this); void func_8095CCF4(Actor* thisx, GlobalContext* globalCtx); void func_8095D074(Actor* thisx, GlobalContext* globalCtx); void EnOwl_ChangeMode(EnOwl* this, EnOwlActionFunc actionFunc, EnOwlFunc unkFunc, SkelAnime* skelAnime, - AnimationHeader* animationSeg, f32 transitionRate); + AnimationHeader* animation, f32 morphFrames); typedef enum { /* 0x00 */ OWL_REPEAT, @@ -1191,10 +1191,9 @@ void func_8095D074(Actor* thisx, GlobalContext* globalCtx) { } void EnOwl_ChangeMode(EnOwl* this, EnOwlActionFunc actionFunc, EnOwlFunc unkFunc, SkelAnime* skelAnime, - AnimationHeader* animationSeg, f32 transitionRate) { + AnimationHeader* animation, f32 morphFrames) { this->skelAnime3 = skelAnime; - Animation_Change(this->skelAnime3, animationSeg, 1.0f, 0.0f, Animation_GetLastFrame(animationSeg), 2, - transitionRate); + Animation_Change(this->skelAnime3, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), 2, morphFrames); this->actionFunc = actionFunc; this->unk_414 = unkFunc; } 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 d445b962d6..371386f58e 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -106,14 +106,20 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, MASS_IMMOVABLE, }; -static ActorAnimationEntry sAnimations[] = { - { &object_pamera_Anim_0005BC, 1.0f, 0, 0.0f, 0, -4.0f }, { &object_pamera_Anim_008AE0, 1.0f, 0, 0.0f, 0, -4.0f }, - { &object_pamera_Anim_008E38, 1.0f, 0, 0.0f, 0, -4.0f }, { &object_pamera_Anim_00A844, 1.0f, 0, 0.0f, 0, -4.0f }, - { &object_pamera_Anim_00B0C4, 1.0f, 0, 0.0f, 0, -4.0f }, { &object_pamera_Anim_009870, 1.0f, 0, 0.0f, 0, 0.0f }, - { &object_pamera_Anim_009F54, 1.0f, 0, 0.0f, 0, 0.0f }, { &object_pamera_Anim_00B5B0, 1.0f, 0, 0.0f, 0, 0.0f }, - { &object_pamera_Anim_00BCC4, 1.0f, 0, 0.0f, 0, 0.0f }, { &object_pamera_Anim_00D9DC, 1.0f, 0, 0.0f, 0, 0.0f }, - { &object_pamera_Anim_00E16C, 1.0f, 0, 0.0f, 0, 0.0f }, { &object_pamera_Anim_00C9F4, 1.0f, 0, 0.0f, 2, 0.0f }, - { &object_pamera_Anim_00D0F0, 1.0f, 0, 0.0f, 0, 0.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_pamera_Anim_00A844, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_pamera_Anim_00B0C4, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_pamera_Anim_009870, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_pamera_Anim_009F54, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_pamera_Anim_00B5B0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_pamera_Anim_00BCC4, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_pamera_Anim_00D9DC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_pamera_Anim_00E16C, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_pamera_Anim_00C9F4, 1.0f, 0, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &object_pamera_Anim_00D0F0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, }; static Vec3f D_80BDA5F0 = { 1000.0f, 0.0f, 0.0f }; @@ -227,7 +233,7 @@ void EnPamera_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80BD8700(EnPamera* this) { this->hideInisdeTimer = 0; this->actor.flags &= ~1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80BD8758; } @@ -237,7 +243,7 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) { ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[0], &this->actor); func_800E02AC(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->cutscenes[0])), &this->actor); this->actor.speedXZ = 1.5f; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; func_80BD9338(this, globalCtx); @@ -246,7 +252,7 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscenes[0]); } else { this->actor.speedXZ = 1.5f; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; func_80BD9338(this, globalCtx); @@ -268,7 +274,7 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) { void func_80BD8908(EnPamera* this) { this->actor.draw = EnPamera_Draw; this->actor.flags |= 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80BD8964; } @@ -281,14 +287,14 @@ void func_80BD8964(EnPamera* this, GlobalContext* globalCtx) { if (Math_Vec3f_StepTo(&this->actor.world.pos, &vec, 1.0f) < 5.0f) { this->actor.speedXZ = 1.5f; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); gSaveContext.weekEventReg[59] |= 1; func_80BD8B50(this); } } void func_80BD8A38(EnPamera* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80BD8A7C; } @@ -335,14 +341,14 @@ void func_80BD8B70(EnPamera* this, GlobalContext* globalCtx) { void func_80BD8CCC(EnPamera* this) { this->hideInisdeTimer = 0; this->actor.speedXZ = 0.0f; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); this->actionFunc = func_80BD8D1C; } void func_80BD8D1C(EnPamera* this, GlobalContext* globalCtx) { if (this->hideInisdeTimer++ > 200) { this->actor.speedXZ = 1.5f; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); func_80BD8D80(this); } } @@ -378,14 +384,14 @@ void func_80BD8DB0(EnPamera* this, GlobalContext* globalCtx) { void EnPamera_LookDownWell(EnPamera* this) { func_80BD93CC(this, 1, 1); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); this->actionFunc = func_80BD8F60; } void func_80BD8F60(EnPamera* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x3000, 0x1000); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); this->actor.speedXZ = 3.0f; func_80BD93CC(this, 0, 0); func_80BD8D80(this); @@ -402,7 +408,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_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); this->actionFunc = func_80BD909C; } @@ -738,7 +744,7 @@ void func_80BD9E78(EnPamera* this, GlobalContext* globalCtx) { } void func_80BD9E88(EnPamera* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->unk_31E = 0; this->setupFunc = func_80BD9ED0; } @@ -747,7 +753,7 @@ void func_80BD9ED0(EnPamera* this, GlobalContext* globalCtx) { } void func_80BD9EE0(EnPamera* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); func_80BD93CC(this, 1, 0); this->unk_31E = 1; this->setupFunc = func_80BD9F3C; @@ -764,14 +770,14 @@ void func_80BD9F3C(EnPamera* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); } } } void func_80BDA038(EnPamera* this) { func_80BD93CC(this, 0, 1); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); this->unk_31E = 0; this->setupFunc = func_80BDA090; } @@ -781,7 +787,7 @@ void func_80BDA090(EnPamera* this, GlobalContext* globalCtx) { void func_80BDA0A0(EnPamera* this) { func_80BD93CC(this, 0, 1); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); this->unk_31E = 1; this->setupFunc = func_80BDA0FC; } @@ -791,7 +797,7 @@ void func_80BDA0FC(EnPamera* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); } } } @@ -799,7 +805,7 @@ void func_80BDA0FC(EnPamera* this, GlobalContext* globalCtx) { void func_80BDA170(EnPamera* this) { this->unk_31E = 1; func_80BD93CC(this, 0, 1); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); this->setupFunc = func_80BDA1C8; } @@ -812,7 +818,7 @@ void func_80BDA1C8(EnPamera* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); } } } @@ -820,7 +826,7 @@ void func_80BDA1C8(EnPamera* this, GlobalContext* globalCtx) { void func_80BDA288(EnPamera* this) { this->unk_31E = 1; func_80BD93CC(this, 0, 0); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); this->setupFunc = func_80BDA2E0; } @@ -828,7 +834,7 @@ void func_80BDA2E0(EnPamera* this, GlobalContext* globalCtx) { if (this->unk_31E == 1) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 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 6b39406652..ad008c3e92 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -230,14 +230,21 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static ActorAnimationEntryS sAnimations[] = { - { &object_mm_Anim_002238, 1.0f, 0, -1, 0, 0 }, { &object_mm_Anim_002238, 1.0f, 0, -1, 0, -4 }, - { &object_mm_Anim_00A4E0, 1.0f, 0, -1, 2, 0 }, { &object_mm_Anim_00B09C, 1.0f, 0, -1, 0, 0 }, - { &object_mm_Anim_00B09C, 1.0f, 0, -1, 0, -4 }, { &object_mm_Anim_00BA78, 1.0f, 0, -1, 2, 0 }, - { &object_mm_Anim_00C32C, 1.0f, 0, -1, 0, -4 }, { &object_mm_Anim_0099B4, 1.0f, 0, -1, 0, 0 }, - { &object_mm_Anim_000FC4, 1.0f, 0, -1, 0, 0 }, { &object_mm_Anim_00A8D8, 1.0f, 0, -1, 0, 0 }, - { &object_mm_Anim_00099C, 1.0f, 0, -1, 0, 0 }, { &object_mm_Anim_001F84, 1.0f, 0, -1, 2, 0 }, - { &object_mm_Anim_000468, 1.0f, 0, -1, 0, 0 }, { &object_mm_Anim_00C640, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_mm_Anim_00B09C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_mm_Anim_00B09C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_mm_Anim_00BA78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_mm_Anim_00C32C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_mm_Anim_0099B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_mm_Anim_000FC4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_mm_Anim_00A8D8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_mm_Anim_00099C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_mm_Anim_001F84, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_mm_Anim_000468, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_mm_Anim_00C640, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; s32 func_80AF7B40(void) { @@ -415,7 +422,7 @@ s32 func_80AF7E98(EnPm* this, s32 arg1) { if (phi_v1) { this->unk_384 = arg1; - ret = func_8013BC6C(&this->skelAnime, sAnimations, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1); this->unk_35C = this->skelAnime.playSpeed; } 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 8f15008106..0c18be89ab 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,14 +62,20 @@ const ActorInit En_Rail_Skb_InitVars = { (ActorFunc)EnRailSkb_Draw, }; -static ActorAnimationEntry sAnimations[] = { - { &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, 0, -4.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -1.0f }, - { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, 3, 4.0f }, { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -4.0f }, - { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, 2, -4.0f }, { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -16.0f }, - { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, - { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, 0, -8.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -16.0f }, + { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; static ColliderJntSphElementInit sJntSphElementsInit[2] = { @@ -306,7 +312,7 @@ void EnRailSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80B70FA0(EnRailSkb* this) { this->unk_3F2 = 0; if (this->actionFunc != func_80B716A8) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); } this->actionFunc = func_80B70FF8; } @@ -350,7 +356,7 @@ void func_80B7114C(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_2EC = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_402 |= 1; func_80B712FC(this); @@ -374,7 +380,7 @@ void func_80B7123C(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_2EC = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_402 |= 1; func_80B712FC(this); @@ -400,7 +406,7 @@ void func_80B71314(EnRailSkb* this, GlobalContext* globalCtx) { void func_80B71354(EnRailSkb* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); this->actionFunc = func_80B713A4; } @@ -409,7 +415,7 @@ void func_80B713A4(EnRailSkb* this, GlobalContext* globalCtx) { if ((this->actor.xzDistToPlayer > 65.0f) || (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN)) { func_80B70FA0(this); } else { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); } } @@ -450,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_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80B715AC; } @@ -473,7 +479,7 @@ void func_80B715AC(EnRailSkb* this, GlobalContext* globalCtx) { void func_80B71650(EnRailSkb* this) { this->unk_3FE = 0; if (this->actionFunc != func_80B70FF8) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); } this->actionFunc = func_80B716A8; } @@ -490,7 +496,7 @@ void func_80B716A8(EnRailSkb* this, GlobalContext* globalCtx) { func_801518B0(globalCtx, 0x13F5, &this->actor); this->unk_400 = 0x13F5; } - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); func_80B717C8(this); } else if ((this->actor.xzDistToPlayer < 100.0f) && !(this->collider.base.acFlags & AC_HIT)) { func_800B8614(&this->actor, globalCtx, 100.0f); @@ -552,7 +558,7 @@ void func_80B718C4(EnRailSkb* this, GlobalContext* globalCtx) { } void func_80B71910(EnRailSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80B71954; } @@ -570,7 +576,7 @@ void func_80B71954(EnRailSkb* this, GlobalContext* globalCtx) { void func_80B71A08(EnRailSkb* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); this->actionFunc = func_80B71A58; } @@ -579,7 +585,7 @@ void func_80B71A58(EnRailSkb* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); if (this->unk_2E8 < this->unk_22C->actor.colChkInfo.health) { this->unk_22C->actor.colChkInfo.health--; } else { @@ -602,7 +608,7 @@ void func_80B71A58(EnRailSkb* this, GlobalContext* globalCtx) { void func_80B71B6C(EnRailSkb* this) { this->unk_3F2 = 10; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80B71BB8; } @@ -635,7 +641,7 @@ void func_80B71BB8(EnRailSkb* this, GlobalContext* globalCtx) { if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & 1)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); this->actor.velocity.y = 10.0f; for (i = 0; i < 4; i++) { @@ -668,7 +674,7 @@ void func_80B71DF0(EnRailSkb* this) { this->unk_3F0 = 0; } - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); this->actionFunc = func_80B71EA8; } @@ -994,7 +1000,7 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_2F0 = 0.0f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); this->unk_402 |= 1; func_80B712FC(this); break; @@ -1020,7 +1026,7 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_2F0 = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); func_80B71228(this); break; @@ -1037,7 +1043,7 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) { case 13: Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 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 37d1d120e6..6738c44ab8 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -60,17 +60,27 @@ const ActorInit En_Railgibud_InitVars = { (ActorFunc)EnRailgibud_Draw, }; -static ActorAnimationEntry sAnimations[] = { - { &object_rd_Anim_006678, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_006B08, 0.5f, 0.0f, 0.0f, 3, 0.0f }, - { &object_rd_Anim_006EEC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_0073A4, 0.0f, 0.0f, 0.0f, 2, -8.0f }, - { &object_rd_Anim_007BBC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_0081A8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_rd_Anim_009298, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_009900, 1.0f, 0.0f, 0.0f, 2, -8.0f }, - { &object_rd_Anim_00A450, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_00ABE0, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_rd_Anim_0113EC, 0.4f, 0.0f, 0.0f, 1, -8.0f }, { &object_rd_Anim_01216C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_rd_Anim_0118D8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_011DB8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_rd_Anim_00A450, 3.0f, 0.0f, 0.0f, 2, -6.0f }, { &object_rd_Anim_005DF4, 1.0f, 0.0f, 0.0f, 2, -8.0f }, - { &object_rd_Anim_0061E4, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_001600, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_rd_Anim_0009C4, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_000F1C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, +static AnimationInfo sAnimations[] = { + { &object_rd_Anim_006678, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_006B08, 0.5f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 0.0f }, + { &object_rd_Anim_006EEC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_0073A4, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_007BBC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_0081A8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_009298, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_009900, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_00A450, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_00ABE0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_0113EC, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -8.0f }, + { &object_rd_Anim_01216C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_0118D8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_011DB8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_00A450, 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -6.0f }, + { &object_rd_Anim_005DF4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_0061E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_001600, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_0009C4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_000F1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -219,7 +229,7 @@ void EnRailgibud_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80BA57A8(EnRailgibud* this) { this->actor.speedXZ = 0.6f; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); this->actionFunc = func_80BA57F8; } @@ -267,7 +277,7 @@ void func_80BA57F8(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA59F0(EnRailgibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); this->actionFunc = func_80BA5A34; } @@ -287,7 +297,7 @@ void func_80BA5A34(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA5AF0(EnRailgibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); this->actor.speedXZ = 0.4f; if (this->actionFunc == func_80BA5A34) { this->unk_3F2 = 80; @@ -342,7 +352,7 @@ void func_80BA5B64(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA5DBC(EnRailgibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); this->actor.flags &= ~1; this->unk_3F2 = 0; this->unk_3F0 = 0; @@ -360,9 +370,9 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) { sp34 = func_80BA7088(this, globalCtx); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (sp34 == 1)) { this->unk_3F0 = 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); } else if (!(player->stateFlags2 & 0x80)) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actor.flags |= 1; this->unk_3F0 = 2; this->unk_3F2 = 0; @@ -391,7 +401,7 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->unk_AE8 = 100; } - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actor.flags |= 1; this->unk_3F0 = 2; this->unk_3F2 = 0; @@ -411,7 +421,7 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA6054(EnRailgibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->actor.speedXZ = -2.0f; this->actionFunc = func_80BA60B0; @@ -433,7 +443,7 @@ void func_80BA60B0(EnRailgibud* this, GlobalContext* globalCtx) { void func_80BA6158(EnRailgibud* this) { this->unk_3F2 = 0; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); this->actionFunc = func_80BA61A0; } @@ -450,7 +460,7 @@ void func_80BA61A0(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA6284(EnRailgibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); this->actor.speedXZ = 0.4f; this->actionFunc = func_80BA62D4; } @@ -482,7 +492,7 @@ void func_80BA62D4(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA6440(EnRailgibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->unk_3F2 = 0; this->unk_3F4 = 0; @@ -535,7 +545,7 @@ void func_80BA6604(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA6664(EnRailgibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); this->actor.flags &= ~1; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); this->unk_3F2 = 0; @@ -1050,37 +1060,37 @@ s32 func_80BA7DC8(EnRailgibud* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.npcActions[sp2C]->unk0) { case 1: this->unk_3F0 = 9; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); break; case 2: this->unk_3F0 = 15; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_WEAKENED2); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 15); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 15); break; case 3: this->unk_3F0 = 17; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 17); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 17); break; case 4: this->unk_3F0 = 18; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 18); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 18); break; case 5: this->unk_3F0 = 10; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); break; } } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (this->unk_3F0 == 15) { this->unk_3F0 = 16; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 16); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 16); } else if (this->unk_3F0 == 18) { this->unk_3F0 = 19; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 19); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 19); func_80BA7D14(this); } } diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index b2c9c9c61c..97f4fd3a5b 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -118,9 +118,9 @@ s32 D_80BF57E4[][4] = { { 56, 34, 44, 41 }, { 60, 38, 50, 45 }, { 67, 42, 55, 49 }, { 74, 47, 61, 54 }, }; -ActorAnimationEntryS D_80BF5914[] = { - { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, 0 }, - { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, 2, 0 }, +AnimationInfoS D_80BF5914[] = { + { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; TexturePtr D_80BF5934[] = { @@ -303,7 +303,7 @@ s32 func_80BF409C(EnRg* this, s32 arg1) { if (arg1 != this->unk_334) { this->unk_334 = arg1; - ret = func_8013BC6C(&this->skelAnime, D_80BF5914, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80BF5914, arg1); this->unk_314 = this->skelAnime.playSpeed; } return ret; @@ -677,7 +677,7 @@ void func_80BF4EBC(EnRg* this, GlobalContext* globalCtx) { this->unk_318 = Rand_S16Offset(0, 20); } } - func_8013D9C8(globalCtx, this->unk_32E, this->unk_328, ARRAY_COUNT(this->unk_328)); + SubS_FillLimbRotTables(globalCtx, this->unk_32E, this->unk_328, ARRAY_COUNT(this->unk_328)); } void func_80BF4FC4(EnRg* this, GlobalContext* globalCtx) { 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 cd7bcf6fa7..0dc71d3df8 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 ActorAnimationEntry animations[] = { { &object_rs_Anim_00788C, 1.0f, 0.0f, 0.0f, 0, 0.0f } }; +static AnimationInfo sAnimations[] = { { &object_rs_Anim_00788C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f } }; void func_80C25D40(EnRsn* this) { - Actor_ChangeAnimation(&this->skelAnime, animations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 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 2b45e7304a..eecf3c8ff1 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -64,19 +64,30 @@ static ColliderCylinderInitType1 sCylinderInit = { { 27, 32, 0, { 0, 0, 0 } }, }; -static ActorAnimationEntryS sAnimations[] = { - { &object_dnt_Anim_005488, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_004AA0, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004E38, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_005CA8, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_0038CC, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003CC0, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_0012F4, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004700, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003438, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001E2C, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_000994, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_002268, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_002F08, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_00577C, 1.0f, 0, -1, 0, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 8, -1, 2, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 4, -1, 2, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_0012F4, -1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_002670, 1.0f, 0, -1, 2, 0 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, + { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; Gfx* D_80BCCCDC[] = { gameplay_keep_DL_0527F0, gameplay_keep_DL_0528B0 }; @@ -186,7 +197,7 @@ void func_80BCAFA8(EnScopenuts* this, GlobalContext* globalCtx) { if (sp1C.y < 150.0f) { this->actor.draw = EnScopenuts_Draw; this->unk_348 = 10; - func_8013BC6C(&this->skelAnime, sAnimations, 10); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 10); this->actionFunc = func_80BCB078; } } @@ -235,7 +246,7 @@ void func_80BCB1C8(EnScopenuts* this, GlobalContext* globalCtx) { void func_80BCB230(EnScopenuts* this, GlobalContext* globalCtx) { s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animationSeg); + s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animation); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); @@ -246,30 +257,30 @@ void func_80BCB230(EnScopenuts* this, GlobalContext* globalCtx) { this->unk_348 = 3; this->collider.dim.height = 64; func_80BCAC40(this, globalCtx); - func_8013BC6C(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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); - func_8013BC6C(&this->skelAnime, sAnimations, 17); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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); - func_8013BC6C(&this->skelAnime, sAnimations, 16); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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; - func_8013BC6C(&this->skelAnime, sAnimations, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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; - func_8013BC6C(&this->skelAnime, sAnimations, 18); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 18); } } } @@ -277,7 +288,7 @@ void func_80BCB230(EnScopenuts* this, GlobalContext* globalCtx) { void func_80BCB4DC(EnScopenuts* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { this->actionFunc = func_80BCB52C; - func_8013BC6C(&this->skelAnime, sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0); } } @@ -295,7 +306,7 @@ void func_80BCB52C(EnScopenuts* this, GlobalContext* globalCtx) { } 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; - func_8013BC6C(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); this->actionFunc = func_80BCB230; } } @@ -312,7 +323,7 @@ void func_80BCB6D0(EnScopenuts* this, GlobalContext* globalCtx) { this->actor.flags &= ~ACTOR_FLAG_1; this->unk_328 &= ~4; this->unk_348 = 8; - func_8013BC6C(&this->skelAnime, sAnimations, 8); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 8); this->actionFunc = func_80BCBA00; } else { this->unk_33C = func_80BCAF0C(this); @@ -377,7 +388,7 @@ void func_80BCB980(EnScopenuts* this, GlobalContext* globalCtx) { void func_80BCBA00(EnScopenuts* this, GlobalContext* globalCtx) { s16 sp26 = this->skelAnime.curFrame; - s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animationSeg); + s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animation); switch (sp26) { case 10: @@ -452,7 +463,7 @@ void func_80BCBA00(EnScopenuts* this, GlobalContext* globalCtx) { if (sp26 == sp24) { this->unk_35A = 3; this->unk_348 = 19; - func_8013BC6C(&this->skelAnime, sAnimations, 19); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 19); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_328 &= ~2; this->unk_34E = 50; @@ -487,7 +498,7 @@ void func_80BCBC60(EnScopenuts* this, GlobalContext* globalCtx) { void func_80BCBD28(EnScopenuts* this, GlobalContext* globalCtx) { Vec3f sp44; s16 sp42 = this->skelAnime.curFrame; - s16 sp40 = Animation_GetLastFrame(sAnimations[this->unk_348].animationSeg); + s16 sp40 = Animation_GetLastFrame(sAnimations[this->unk_348].animation); Vec3s sp38; func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38); @@ -516,7 +527,7 @@ void func_80BCBD28(EnScopenuts* this, GlobalContext* globalCtx) { if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { this->unk_368 = 0.3f; this->unk_348 = 9; - func_8013BC6C(&this->skelAnime, sAnimations, 9); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 9); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); func_80BCAC40(this, globalCtx); this->actionFunc = func_80BCBF0C; @@ -536,7 +547,7 @@ void func_80BCBF0C(EnScopenuts* this, GlobalContext* globalCtx) { 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; - func_8013BC6C(&this->skelAnime, sAnimations, 10); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 10); this->unk_328 |= 2; this->unk_36E = 0; this->actionFunc = func_80BCBFFC; @@ -716,7 +727,7 @@ void EnScopenuts_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_358 = 150; this->unk_348 = 4; this->unk_35A = 0; - func_8013BC6C(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 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 0c2483ac9c..588aedf3d6 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -35,11 +35,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx); s32 func_80ADCE4C(EnSellnuts* this, Path* path, s32 arg2); f32 func_80ADCFE8(Path* path, s32 arg1, Vec3f* pos, Vec3s* arg3); -static u16 D_80ADD910[] = { - 0x0614, - 0x060E, - 0x0628, -}; +static u16 D_80ADD910[] = { 0x0614, 0x060E, 0x0628 }; static u16 D_80ADD918[] = { 0x0616, 0x0610, 0x0629 }; @@ -84,19 +80,30 @@ static ColliderCylinderInitType1 sCylinderInit = { { 27, 32, 0, { 0, 0, 0 } }, }; -static ActorAnimationEntryS D_80ADD990[] = { - { &object_dnt_Anim_005488, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_004AA0, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004E38, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_005CA8, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_0038CC, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003CC0, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_0012F4, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004700, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003438, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001E2C, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_000994, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_002268, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_002F08, 1.0f, 0, -1, 0, 0 }, - { &object_dnt_Anim_00577C, 1.0f, 0, -1, 0, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 8, -1, 2, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 4, -1, 2, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_0012F4, -1.0f, 0, -1, 2, 0 }, - { &object_dnt_Anim_002670, 1.0f, 0, -1, 2, 0 }, +static AnimationInfoS D_80ADD990[] = { + { &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 }, + { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, + { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; static InitChainEntry sInitChain[] = { @@ -228,25 +235,25 @@ f32 func_80ADB08C(GlobalContext* globalCtx) { void func_80ADB0D8(EnSellnuts* this, GlobalContext* globalCtx) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); + s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); if (currentFrame == frameCount) { switch (this->unk_340) { case 0x611: case 0x62A: this->unk_34C = 0; - func_8013BC6C(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); this->actionFunc = func_80ADBFA0; break; case 0x618: if (this->unk_34C == 1) { this->unk_34C = 0; - func_8013BC6C(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); this->actionFunc = func_80ADB544; } else { this->unk_34C = 1; - func_8013BC6C(&this->skelAnime, D_80ADD990, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 1); this->actionFunc = func_80ADBFA0; } break; @@ -257,7 +264,7 @@ void func_80ADB0D8(EnSellnuts* this, GlobalContext* globalCtx) { case 0x614: case 0x628: this->unk_34C = 0; - func_8013BC6C(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); this->actionFunc = func_80ADB924; break; @@ -266,14 +273,14 @@ void func_80ADB0D8(EnSellnuts* this, GlobalContext* globalCtx) { case 0x616: case 0x629: this->unk_34C = 1; - func_8013BC6C(&this->skelAnime, D_80ADD990, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 1); this->actionFunc = func_80ADB924; break; case 0x613: case 0x619: this->unk_34C = 7; - func_8013BC6C(&this->skelAnime, D_80ADD990, 7); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 7); this->actionFunc = func_80ADBD64; break; } @@ -282,7 +289,7 @@ void func_80ADB0D8(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADB254(EnSellnuts* this, GlobalContext* globalCtx) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); + s16 frameCount = Animation_GetLastFrame(D_80ADD990[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) && @@ -291,31 +298,31 @@ void func_80ADB254(EnSellnuts* this, GlobalContext* globalCtx) { this->actionFunc = func_80ADB4F4; this->unk_34C = 3; this->collider.dim.height = 64; - func_8013BC6C(&this->skelAnime, D_80ADD990, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 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); - func_8013BC6C(&this->skelAnime, D_80ADD990, 17); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 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); - func_8013BC6C(&this->skelAnime, D_80ADD990, 16); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 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; - func_8013BC6C(&this->skelAnime, D_80ADD990, 2); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 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; - func_8013BC6C(&this->skelAnime, D_80ADD990, 18); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 18); } } } @@ -324,7 +331,7 @@ void func_80ADB254(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADB4F4(EnSellnuts* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame == this->skelAnime.endFrame) { this->actionFunc = func_80ADB544; - func_8013BC6C(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); } } @@ -402,7 +409,7 @@ void func_80ADB544(EnSellnuts* this, GlobalContext* globalCtx) { if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) || !((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { this->unk_34C = 4; - func_8013BC6C(&this->skelAnime, D_80ADD990, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 4); this->actionFunc = func_80ADB254; } } @@ -447,18 +454,18 @@ void func_80ADB924(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADBAB8(EnSellnuts* this, GlobalContext* globalCtx) { u8 sp27 = Message_GetState(&globalCtx->msgCtx); s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); + s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); if (this->unk_368 == 0x28) { this->unk_34C = 5; - func_8013BC6C(&this->skelAnime, D_80ADD990, 5); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 5); } this->unk_368++; if ((currentFrame == frameCount) && (this->unk_34C == 5)) { this->unk_34C = 6; - func_8013BC6C(&this->skelAnime, D_80ADD990, 6); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 6); } if ((sp27 == 5) && func_80147624(globalCtx)) { @@ -500,11 +507,11 @@ void func_80ADBCE4(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADBD64(EnSellnuts* this, GlobalContext* globalCtx) { u8 sp27 = Message_GetState(&globalCtx->msgCtx); s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); + s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); if ((currentFrame == frameCount) && (this->unk_34C == 7)) { this->unk_34C = 0; - func_8013BC6C(&this->skelAnime, D_80ADD990, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0); } if ((sp27 == 5) && func_80147624(globalCtx)) { @@ -513,14 +520,14 @@ void func_80ADBD64(EnSellnuts* this, GlobalContext* globalCtx) { this->unk_338 &= ~2; this->actor.flags &= ~1; this->unk_34C = 8; - func_8013BC6C(&this->skelAnime, D_80ADD990, 8); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 8); this->actionFunc = func_80ADBE80; } } void func_80ADBE80(EnSellnuts* this, GlobalContext* globalCtx) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); + s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); func_80ADAE64(this); if (this->unk_366 == 0) { @@ -539,7 +546,7 @@ void func_80ADBE80(EnSellnuts* this, GlobalContext* globalCtx) { if (currentFrame == frameCount) { this->unk_350 = 4; this->unk_34C = 19; - func_8013BC6C(&this->skelAnime, D_80ADD990, 19); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 19); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_338 &= ~1; this->unk_338 |= 8; @@ -573,7 +580,7 @@ void func_80ADC034(EnSellnuts* this, GlobalContext* globalCtx) { 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; - func_8013BC6C(&this->skelAnime, D_80ADD990, 10); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 10); this->unk_368 = 0; this->actionFunc = func_80ADC37C; } @@ -582,7 +589,7 @@ void func_80ADC034(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADC118(EnSellnuts* this, GlobalContext* globalCtx) { Vec3f sp34; s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); + s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); if (currentFrame == frameCount) { Math_SmoothStepToS(&this->unk_364, 0x1C71, 3, 0x100, 0); @@ -608,7 +615,7 @@ void func_80ADC118(EnSellnuts* this, GlobalContext* globalCtx) { if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { this->unk_34C = 9; this->unk_360 = 0.3f; - func_8013BC6C(&this->skelAnime, D_80ADD990, 9); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 9); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80ADC034; } @@ -786,7 +793,7 @@ void func_80ADC8C4(EnSellnuts* this, GlobalContext* globalCtx) { this->actor.gravity = -1.0f; this->actor.velocity.y = -1.0f; this->actor.speedXZ = 0.0f; - func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); this->unk_338 &= ~1; this->unk_338 &= ~2; this->actionFunc = func_80ADCA64; @@ -801,7 +808,7 @@ void func_80ADC8C4(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); + s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); if (this->unk_34C == 22) { Math_SmoothStepToS(&this->unk_364, 0, 3, 0x100, 0); @@ -814,7 +821,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) { this->unk_350 = 4; this->unk_34C = 19; this->actor.velocity.y = 0.0f; - func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); } return; @@ -825,7 +832,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) { if (this->unk_34C == 19) { this->unk_34C = 17; this->collider.dim.height = 0; - func_8013BC6C(&this->skelAnime, D_80ADD990, 17); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 17); } else if (this->unk_34C == 17) { ActorCutscene_Stop(this->cutscene); gSaveContext.weekEventReg[73] |= 4; @@ -836,7 +843,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADCC04(EnSellnuts* this, GlobalContext* globalCtx) { s16 currentFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); + s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation); if (this->unk_34C == 3) { if (currentFrame == frameCount) { @@ -845,7 +852,7 @@ void func_80ADCC04(EnSellnuts* this, GlobalContext* globalCtx) { this->unk_354 = 1.0f; this->unk_358 = 1.0f; this->unk_35C = 1.0f; - func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); } } else if (this->unk_34C == 21) { func_80ADAFC0(this); @@ -856,7 +863,7 @@ void func_80ADCC04(EnSellnuts* this, GlobalContext* globalCtx) { } this->unk_340 = 0x626; this->unk_34C = 0; - func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); this->actionFunc = func_80ADC5A4; } } @@ -877,7 +884,7 @@ void func_80ADCD3C(EnSellnuts* this, GlobalContext* globalCtx) { this->unk_34C = 3; this->unk_350 = 4; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); - func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); this->actionFunc = func_80ADCC04; } else if (D_80ADD940 != 0) { this->collider.dim.height = 64; @@ -982,7 +989,7 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -1.0f; this->unk_34A = 50; this->unk_34C = 4; - func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); this->actionFunc = func_80ADB254; return; } @@ -1000,7 +1007,7 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_358 = 1.0f; this->unk_354 = 1.0f; this->unk_360 = 1.0f; - func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); this->actionFunc = func_80ADC5A4; } else { this->unk_338 |= 2; @@ -1011,7 +1018,7 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_34C = 4; this->unk_34E = 20; this->collider.dim.height = 64; - func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); + SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C); this->actionFunc = func_80ADCD3C; } } 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 fb0f3d28c0..bfa9cf7821 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -49,14 +49,20 @@ void func_809964A0(EnSkb* this, GlobalContext* globalCtx); s32 func_80996594(EnSkb* this, GlobalContext* globalCtx); void func_80996BEC(EnSkb* this, GlobalContext* globalCtx); -static ActorAnimationEntry sAnimations[] = { - { &object_skb_Anim_0064E0, 1.0f, 0.0f, 0.0f, 0, -4.0 }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -1.0f }, - { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, 3, 4.0f }, { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -4.0 }, - { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, 2, -4.0 }, { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, 0, -4.0 }, - { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, 0, -4.0 }, { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, 0, -4.0 }, - { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -16.0f }, - { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, 2, -4.0 }, - { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, 0, -4.0 }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, + { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, + { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, + { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, + { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, + { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -16.0f }, + { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 }, + { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 }, }; static Vec3f D_80997468[] = { @@ -281,7 +287,7 @@ void func_80994DA8(EnSkb* this, GlobalContext* globalCtx) { } void func_80994E2C(EnSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); this->actor.flags &= ~1; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR); this->unk_3D0 = 0; @@ -336,7 +342,7 @@ void func_80995068(EnSkb* this, GlobalContext* globalCtx) { if (this->unk_3E0 == 1) { func_801518B0(globalCtx, 0x13F8, &this->actor); if (this->unk_3DE == 2) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); } } else { func_801518B0(globalCtx, 0x13F6, &this->actor); @@ -368,7 +374,7 @@ void func_80995190(EnSkb* this, GlobalContext* globalCtx) { if (func_80147624(globalCtx)) { func_801518B0(globalCtx, 0x13F7, &this->actor); if (this->unk_3DE == 2) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); } } break; @@ -406,7 +412,7 @@ void func_80995244(EnSkb* this, GlobalContext* globalCtx) { } void func_809952D8(EnSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 9; this->actionFunc = func_8099533C; @@ -428,7 +434,7 @@ void func_8099533C(EnSkb* this, GlobalContext* globalCtx) { } void func_809953E8(EnSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 10; this->actionFunc = func_8099544C; @@ -450,7 +456,7 @@ void func_8099544C(EnSkb* this, GlobalContext* globalCtx) { } void func_809954F8(EnSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 11; this->actionFunc = func_8099556C; @@ -493,14 +499,14 @@ void func_8099571C(EnSkb* this) { this->unk_3DC = 0; this->actor.shape.shadowScale = 0.0f; if (this->unk_3DE == 9) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); this->actor.speedXZ = 2.4f; this->actor.gravity = -1.0f; this->actor.velocity.y = 3.0f; } else if (this->unk_3DE == 0xA) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); } else if (this->unk_3DE == 0xB) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9); this->actor.speedXZ = 3.2f; this->actor.gravity = -1.0f; this->actor.velocity.y = 2.0f; @@ -554,7 +560,7 @@ void func_8099599C(EnSkb* this, GlobalContext* globalCtx) { } void func_80995A30(EnSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); this->actor.speedXZ = 1.6f; this->unk_3DA = 0; this->unk_3DE = 2; @@ -567,7 +573,7 @@ void func_80995A8C(EnSkb* this, GlobalContext* globalCtx) { this->actor.flags |= (0x8 | 0x1); this->actor.hintId = 0xFF; this->actor.colChkInfo.mass = MASS_HEAVY; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); func_8099504C(this); return; } @@ -590,7 +596,7 @@ void func_80995A8C(EnSkb* this, GlobalContext* globalCtx) { } void func_80995C24(EnSkb* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); this->collider.base.atFlags &= ~AT_BOUNCED; this->actor.speedXZ = 0.0f; this->unk_3DE = 3; @@ -675,17 +681,17 @@ void func_80995E64(EnSkb* this, GlobalContext* globalCtx) { void func_80995F98(EnSkb* this) { if ((this->unk_3DE == 9) || (this->unk_3DE == 0xA)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8); this->actor.gravity = -1.0f; this->actor.speedXZ = 1.0f; } else if (this->unk_3DE == 0xB) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 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_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -4.0f; } @@ -721,7 +727,7 @@ void func_809960AC(EnSkb* this, GlobalContext* globalCtx) { } void func_809961E4(EnSkb* this, GlobalContext* globalCtx) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4); this->unk_3D8 |= 0x40; if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -6.0f; @@ -753,7 +759,7 @@ void func_8099630C(EnSkb* this, GlobalContext* globalCtx) { this->unk_22C = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); this->unk_3D8 |= 1; func_80995F98(this); } else { @@ -775,7 +781,7 @@ void func_809963D8(EnSkb* this, GlobalContext* globalCtx) { this->unk_22C = 0.0f; if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); this->unk_3D8 |= 1; func_80995F98(this); } else { @@ -946,7 +952,7 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) { this->unk_230 = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); func_809963C4(this); break; @@ -962,7 +968,7 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) { case 13: Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 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 22c2557b41..7ddbbf06b4 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -54,10 +54,10 @@ s32 EnSob1_TakeItemOffShelf(EnSob1* this); s32 EnSob1_ReturnItemToShelf(EnSob1* this); s16 EnSob1_GetXZAngleAndDistanceSqToPoint(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq); -static ActorAnimationEntryS sAnimationsBombShopkeeper[] = { - { &object_rs_Anim_009120, 2.0f, 0, -1, 0, 20 }, - { &object_rs_Anim_008268, 1.0f, 0, -1, 2, 0 }, - { &object_rs_Anim_0087BC, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimationsBombShopkeeper[] = { + { &object_rs_Anim_009120, 2.0f, 0, -1, ANIMMODE_LOOP, 20 }, + { &object_rs_Anim_008268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_rs_Anim_0087BC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; const ActorInit En_Sob1_InitVars = { @@ -152,17 +152,17 @@ static Vec3f sPosOffset[] = { { 0.0f, -4.0f, 0.0f }, }; -void EnSob1_ChangeAnim(SkelAnime* skelAnime, ActorAnimationEntryS* animations, s32 idx) { +void EnSob1_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animations, s32 idx) { f32 frameCount; animations += idx; if (animations->frameCount < 0) { - frameCount = Animation_GetLastFrame(animations->animationSeg); + frameCount = Animation_GetLastFrame(animations->animation); } else { frameCount = animations->frameCount; } - Animation_Change(skelAnime, animations->animationSeg, animations->playbackSpeed, animations->frame, frameCount, - animations->mode, animations->transitionRate); + Animation_Change(skelAnime, animations->animation, animations->playSpeed, animations->startFrame, frameCount, + animations->mode, animations->morphFrames); } void EnSob1_SetupAction(EnSob1* this, EnSob1ActionFunc action) { 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 e3116fb3c2..adeae463a3 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -152,11 +152,15 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &object_st_Anim_000304, 1.0f, 0, -1, 0, 0 }, { &object_st_Anim_005B98, 1.0f, 0, -1, 2, -4 }, - { &object_st_Anim_000304, 4.0f, 0, -1, 2, -4 }, { &object_st_Anim_000304, 1.0f, 0, -1, 0, -4 }, - { &object_st_Anim_0055A8, 1.0f, 0, -1, 2, -4 }, { &object_st_Anim_000304, 8.0f, 0, -1, 0, -4 }, - { &object_st_Anim_000304, 6.0f, 0, -1, 2, -4 }, { &object_st_Anim_005B98, 2.0f, 0, -1, 0, -4 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_st_Anim_0055A8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_st_Anim_000304, 8.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_st_Anim_000304, 6.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_st_Anim_005B98, 2.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; void func_808A5050(EnSt* this, GlobalContext* globalCtx) { @@ -452,7 +456,7 @@ void func_808A60E0(EnSt* this) { sp1C = this->skelAnime.curFrame / (this->skelAnime.animLength - 1.0f); if (sp1C == 1.0f) { - func_8013BC6C(&this->skelAnime, sAnimations, idx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, idx); Actor_PlaySfxAtPos(&this->actor, sfxId); } @@ -504,7 +508,7 @@ void func_808A6220(EnSt* this, GlobalContext* globalCtx) { } void func_808A63E8(EnSt* this) { - func_8013BC6C(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); this->unk_2C8 = 1.0f; func_808A5D7C(this); this->unk_30C = 0; @@ -517,7 +521,7 @@ void func_808A63E8(EnSt* this) { void func_808A6468(EnSt* this, GlobalContext* globalCtx) { func_808A5050(this, globalCtx); - func_8013BC6C(&this->skelAnime, sAnimations, 4); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4); this->unk_18C |= (0x8 | 0x4); this->unk_18C &= ~(0x10 | 0x2); this->unk_2C8 = -1.0f; @@ -534,7 +538,7 @@ void func_808A6468(EnSt* this, GlobalContext* globalCtx) { void func_808A650C(EnSt* this) { s32 idx = (this->unk_2C8 > 0.0f) ? 2 : 6; - func_8013BC6C(&this->skelAnime, sAnimations, idx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, idx); this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; this->unk_2D8 = 0.0f; @@ -601,7 +605,7 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) { this->unk_314 = 20; this->unk_312 = 0; Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_314); - func_8013BC6C(&this->skelAnime, sAnimations, 1); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 1); this->unk_18C |= 8; this->actionFunc = func_808A6D84; this->unk_2C8 = -1.0f; @@ -642,7 +646,7 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) { } if (this->unk_18E != 10) { - func_8013BC6C(&this->skelAnime, sAnimations, 7); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 7); this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; this->actor.gravity = -1.0f; @@ -688,7 +692,7 @@ void func_808A6A78(EnSt* this, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 8.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); - func_8013BC6C(&this->skelAnime, sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0); Collider_InitAndSetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit1); Collider_InitAndSetCylinder(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); @@ -719,7 +723,7 @@ void func_808A6C04(EnSt* this, GlobalContext* globalCtx) { Actor_MoveWithGravity(&this->actor); if ((this->unk_18C & 8) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_8013BC6C(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); this->unk_18C &= ~8; } else if ((this->unk_310 == 0) && func_808A5F28(this, globalCtx) && !func_808A6064(this)) { func_808A650C(this); @@ -761,7 +765,7 @@ void func_808A6E24(EnSt* this, GlobalContext* globalCtx) { } if (count == ARRAY_COUNT(this->unk_31C)) { - func_8013BC6C(&this->skelAnime, sAnimations, 7); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 7); this->unk_18E = 1; 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 efebc9430a..e737660594 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -49,12 +49,16 @@ const ActorInit En_Suttari_InitVars = { (ActorFunc)EnSuttari_Draw, }; -static ActorAnimationEntry sAnimations[] = { - { &object_boj_Anim_00071C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_boj_Anim_0128F4, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_boj_Anim_011F84, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_boj_Anim_012E84, 1.0f, 0.0f, 0.0f, 0, -6.0f }, - { &object_boj_Anim_01139C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_boj_Anim_00071C, 2.0f, 0.0f, 0.0f, 0, 0.0f }, - { &object_boj_Anim_011F84, 2.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_boj_Anim_011C38, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &object_boj_Anim_010BDC, 1.0f, 0.0f, 0.0f, 0, 0.0f }, +static AnimationInfo sAnimations[] = { + { &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 }, + { &object_boj_Anim_012E84, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f }, + { &object_boj_Anim_01139C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_boj_Anim_00071C, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_boj_Anim_011F84, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &object_boj_Anim_011C38, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &object_boj_Anim_010BDC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -219,13 +223,13 @@ void func_80BAA9B4(EnSuttari* this) { case 0x145B: if ((this->animationIdx != 8) && (curFrame == frameCount)) { this->animationIdx = 8; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } break; default: if ((this->animationIdx != 1) && (curFrame == frameCount)) { this->animationIdx = 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } } } @@ -234,7 +238,7 @@ void func_80BAAA94(EnSuttari* this) { switch (this->textId) { case 0x29E5: this->animationIdx = 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); break; case 0x29E9: this->enFsn->flags |= ENFSN_ANGRY; @@ -247,11 +251,11 @@ void func_80BAAA94(EnSuttari* this) { break; case 0x29EC: this->animationIdx = 7; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); break; case 0x29ED: this->animationIdx = 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); break; } } @@ -377,10 +381,10 @@ void func_80BAAF1C(EnSuttari* this) { if (this->animationIdx == 5) { this->animationIdx = 3; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } else if ((this->animationIdx == 3) && (curFrame == frameCount)) { this->animationIdx = 6; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); this->flags1 &= ~0x100; } } @@ -497,7 +501,7 @@ void func_80BAB4F0(EnSuttari* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->unk2E2.y, 0, 4, 0x3E8, 1); } } - func_8013D9C8(globalCtx, this->unk2FA, this->unk31A, 16); + SubS_FillLimbRotTables(globalCtx, this->unk2FA, this->unk31A, ARRAY_COUNT(this->unk2FA)); } s16 func_80BAB698(Path* path, s32 idx, Vec3f* pos, f32* distSQ) { @@ -813,7 +817,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { case 15: if ((this->animationIdx == 1) && (curFrame == frameCount)) { this->animationIdx = 2; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } if (!(gSaveContext.weekEventReg[0x53] & 4) && !(this->flags1 & 0x1000)) { if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { @@ -846,7 +850,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { this->enFsn->flags &= ~ENFSN_HAGGLE; if (this->animationIdx != 2) { this->animationIdx = 2; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } func_80BAC220(this, globalCtx); break; @@ -877,7 +881,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { if (!(gSaveContext.weekEventReg[0x21] & 8)) { if (this->animationIdx == 2 || this->animationIdx == 1) { this->animationIdx = 5; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } this->flags1 |= 0x10; if (this->flags2 & 2) { @@ -906,7 +910,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { this->flags1 |= 1; if (gSaveContext.day == 1 || gSaveContext.day == 2) { this->animationIdx = 2; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); this->flags1 |= 0x80; this->actionFunc = func_80BACA14; return; @@ -914,7 +918,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { !(gSaveContext.weekEventReg[0x3D] & 8) && !(gSaveContext.weekEventReg[0x21] & 8) && (gSaveContext.weekEventReg[0x33] & 8)) { this->animationIdx = 2; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); this->actionFunc = func_80BACEE0; return; } @@ -930,7 +934,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { this->flags1 |= 0x80; this->flags1 |= 8; this->animationIdx = 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); this->actionFunc = func_80BAD004; return; } else if (globalCtx->sceneNum == SCENE_ICHIBA) { @@ -939,7 +943,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { return; } this->animationIdx = 0; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); this->flags1 |= 2; this->actionFunc = func_80BAD5F8; return; @@ -949,7 +953,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { return; } this->animationIdx = 0; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); this->cutscenes[0] = this->actor.cutscene; this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); this->flags1 |= 4; @@ -969,7 +973,7 @@ void func_80BACA14(EnSuttari* this, GlobalContext* globalCtx) { if (this->animationIdx == 1 || this->animationIdx == 8) { this->animationIdx = 2; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } func_80BABA90(this, 0, 0); func_80BAB434(this); @@ -1211,7 +1215,7 @@ void func_80BAD5F8(EnSuttari* this, GlobalContext* globalCtx) { if ((curFrame == frameCount) && (this->animationIdx == 0) && (this->flags1 & 0x20)) { this->animationIdx = 2; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } this->unk42A = REG(15) + *unk_14; if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) || @@ -1250,7 +1254,7 @@ void func_80BAD7F8(EnSuttari* this, GlobalContext* globalCtx) { } else { if ((this->flags1 & 0x2000) && (this->animationIdx == 1) && (curFrame == frameCount)) { this->animationIdx = 2; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } this->unk42A = REG(15) + *unk_14; if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) || @@ -1299,7 +1303,7 @@ void func_80BADA9C(EnSuttari* this, GlobalContext* globalCtx) { func_80BAA9B4(this); } else if ((this->animationIdx == 7) && (curFrame == frameCount)) { this->animationIdx = 1; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); } if (talkstate == 5) { if (func_80147624(globalCtx)) { 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 bc863b9d0d..f187562e2d 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -134,11 +134,11 @@ static DamageTable sDamageTable2 = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -static ActorAnimationEntryS sAnimations[] = { - { &object_st_Anim_000304, 1.0f, 0, -1, 3, 0 }, - { &object_st_Anim_000304, 1.0f, 0, -1, 3, -4 }, - { &object_st_Anim_0055A8, 1.0f, 0, -1, 1, -4 }, - { &object_st_Anim_005B98, 1.0f, 0, -1, 1, -4 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_st_Anim_005B98, 1.0f, 0, -1, ANIMMODE_LOOP_INTERP, -4 }, }; void func_808D8940(EnSw* this, GlobalContext* globalCtx) { @@ -676,7 +676,7 @@ s32 func_808DA08C(EnSw* this, GlobalContext* globalCtx) { Enemy_StartFinishingBlow(globalCtx, &this->actor); this->actor.flags &= ~1; if (!ENSW_GET_3(&this->actor)) { - func_8013BC6C(&this->skelAnime, sAnimations, 3); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3); } switch (this->actor.colChkInfo.damageEffect) { @@ -1159,7 +1159,7 @@ void EnSw_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); - func_8013BC6C(&this->skelAnime, sAnimations, 0); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0); this->skelAnime.playSpeed = 4.0f; Collider_InitAndSetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit); 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 493aae9d71..a097c354a2 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 @@ -47,10 +47,10 @@ const ActorInit En_Syateki_Man_InitVars = { (ActorFunc)EnSyatekiMan_Draw, }; -static ActorAnimationEntry sAnimations[] = { - { &object_shn_Anim_00D9D0, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_shn_Anim_00DFEC, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_shn_Anim_00D2F8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, +static AnimationInfo sAnimations[] = { + { &object_shn_Anim_00D9D0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_shn_Anim_00DFEC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_shn_Anim_00D2F8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, }; static s16 D_809C91C8[] = { @@ -207,7 +207,7 @@ void func_809C6848(EnSyatekiMan* this, GlobalContext* globalCtx) { if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { u16 sp22; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); sp22 = Text_GetFaceReaction(globalCtx, 0x31); if (sp22 != 0) { func_801518B0(globalCtx, sp22, &this->actor); @@ -410,7 +410,7 @@ void func_809C6E30(EnSyatekiMan* this, GlobalContext* globalCtx) { if (this->skelAnime.animation == &object_shn_Anim_00D2F8) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); } } } 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 ae8bfa48a0..9d19c68bf3 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 @@ -103,14 +103,21 @@ const ActorInit En_Talk_Gibud_InitVars = { (ActorFunc)EnTalkGibud_Draw, }; -static ActorAnimationEntry sAnimations[] = { - { &object_rd_Anim_006678, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_006B08, 0.5f, 0.0f, 0.0f, 3, 0.0f }, - { &object_rd_Anim_006EEC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_0073A4, 0.0f, 0.0f, 0.0f, 2, -8.0f }, - { &object_rd_Anim_007BBC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_0081A8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_rd_Anim_009298, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_009900, 1.0f, 0.0f, 0.0f, 2, -8.0f }, - { &object_rd_Anim_00A450, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_00ABE0, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_rd_Anim_0113EC, 0.4f, 0.0f, 0.0f, 1, -8.0f }, { &object_rd_Anim_01216C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &object_rd_Anim_0118D8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_011DB8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, +static AnimationInfo sAnimations[] = { + { &object_rd_Anim_006678, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_006B08, 0.5f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 0.0f }, + { &object_rd_Anim_006EEC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_0073A4, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_007BBC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_0081A8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_009298, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_009900, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_00A450, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, + { &object_rd_Anim_00ABE0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_0113EC, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -8.0f }, + { &object_rd_Anim_01216C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_0118D8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &object_rd_Anim_011DB8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -260,7 +267,7 @@ void EnTalkGibud_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnTalkGibud_SetupIdle(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); this->actionFunc = EnTalkGibud_Idle; } @@ -277,7 +284,7 @@ void EnTalkGibud_Idle(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupAttemptPlayerStun(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); this->actionFunc = EnTalkGibud_AttemptPlayerStun; } @@ -297,7 +304,7 @@ void EnTalkGibud_AttemptPlayerStun(EnTalkGibud* this, GlobalContext* globalCtx) } void EnTalkGibud_SetupWalkToPlayer(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); this->actor.speedXZ = 0.4f; if (this->actionFunc == EnTalkGibud_AttemptPlayerStun) { this->playerStunWaitTimer = 80; @@ -353,7 +360,7 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupGrab(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_START); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_START); this->grabDamageTimer = 0; this->actor.flags &= ~1; this->grabState = EN_TALK_GIBUD_GRAB_START; @@ -375,7 +382,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) { inPositionToAttack = EnTalkGibud_MoveToIdealGrabPositionAndRotation(this, globalCtx); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && inPositionToAttack == true) { this->grabState = EN_TALK_GIBUD_GRAB_ATTACK; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK); } break; @@ -401,7 +408,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->unk_AE8 = 100; } - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_END); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_END); this->actor.flags |= 1; this->grabState = EN_TALK_GIBUD_GRAB_RELEASE; this->grabDamageTimer = 0; @@ -421,7 +428,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupGrabFail(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->actionFunc = EnTalkGibud_GrabFail; this->actor.speedXZ = -2.0f; @@ -442,7 +449,7 @@ void EnTalkGibud_GrabFail(EnTalkGibud* this, GlobalContext* globalCtx) { void EnTalkGibud_SetupTurnAwayAndShakeHead(EnTalkGibud* this) { this->headShakeTimer = 0; - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); this->actionFunc = EnTalkGibud_TurnAwayAndShakeHead; } @@ -460,7 +467,7 @@ void EnTalkGibud_TurnAwayAndShakeHead(EnTalkGibud* this, GlobalContext* globalCt } void EnTalkGibud_SetupWalkToHome(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); this->actor.speedXZ = 0.4f; this->actionFunc = EnTalkGibud_WalkToHome; } @@ -517,7 +524,7 @@ void EnTalkGibud_Stunned(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupDamage(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->stunTimer = 0; this->grabWaitTimer = 0; @@ -550,7 +557,7 @@ void EnTalkGibud_Damage(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupDead(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DEATH); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DEATH); this->actor.flags &= ~1; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); this->deathTimer = 0; @@ -714,7 +721,7 @@ void EnTalkGibud_CheckPresentedItem(EnTalkGibud* this, GlobalContext* globalCtx) void EnTalkGibud_SetupPassiveIdle(EnTalkGibud* this) { this->isTalking = false; if (this->actionFunc != EnTalkGibud_Talk) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); } this->actionFunc = EnTalkGibud_PassiveIdle; } @@ -792,7 +799,7 @@ void EnTalkGibud_Talk(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupDisappear(EnTalkGibud* this) { - Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); this->actor.flags &= ~1; this->disappearanceTimer = 40; this->actionFunc = EnTalkGibud_Disappear; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index df59b09e4f..6ccb2b5d2b 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -108,11 +108,11 @@ static u32 D_80AEF85C[] = { 0xFF000000, }; -static struct_80B8E1A8 D_80AEF868[] = { - { &object_tk_Anim_001FA8, 1.0f, 0, -10.0f }, { &object_tk_Anim_001FA8, 2.0f, 0, -10.0f }, - { &object_tk_Anim_0030A4, 1.0f, 0, -10.0f }, { &object_tk_Anim_001144, 1.0f, 2, -10.0f }, - { &object_tk_Anim_003724, 1.0f, 2, -10.0f }, { &object_tk_Anim_003FB8, 1.0f, 0, -10.0f }, - { &object_tk_Anim_0020C8, 1.0f, 0, -10.0f }, { &object_tk_Anim_003B10, 1.0f, 0, -10.0f }, +static AnimationSpeedInfo D_80AEF868[] = { + { &object_tk_Anim_001FA8, 1.0f, ANIMMODE_LOOP, -10.0f }, { &object_tk_Anim_001FA8, 2.0f, ANIMMODE_LOOP, -10.0f }, + { &object_tk_Anim_0030A4, 1.0f, ANIMMODE_LOOP, -10.0f }, { &object_tk_Anim_001144, 1.0f, ANIMMODE_ONCE, -10.0f }, + { &object_tk_Anim_003724, 1.0f, ANIMMODE_ONCE, -10.0f }, { &object_tk_Anim_003FB8, 1.0f, ANIMMODE_LOOP, -10.0f }, + { &object_tk_Anim_0020C8, 1.0f, ANIMMODE_LOOP, -10.0f }, { &object_tk_Anim_003B10, 1.0f, ANIMMODE_LOOP, -10.0f }, }; static s32 D_80AEF8E8[2] = { 0, 0 }; @@ -247,7 +247,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -1.0f; this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.flags |= 0x10; - func_8013E1C8(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); func_8013E3B8(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); switch (this->unk_2B0) { @@ -285,7 +285,7 @@ void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80AECA3C(EnTk* this, GlobalContext* globalCtx) { this->unk_316 = 0; - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->actionFunc = func_80AECA90; } @@ -303,7 +303,7 @@ void func_80AECB0C(EnTk* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->unk_3CC = 0xFF; this->unk_2DC = 0.0f; - func_8013E1C8(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); this->actionFunc = func_80AECB6C; } @@ -331,7 +331,7 @@ void func_80AECB6C(EnTk* this, GlobalContext* globalCtx) { } if (this->unk_2CA & 0x10) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4); sp48 = 1.0f; sp44 = 22.0f; } else { @@ -529,7 +529,7 @@ s32 func_80AED38C(EnTk* this, GlobalContext* globalCtx, struct_80133038_arg2* ar } void func_80AED4F8(EnTk* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->actionFunc = func_80AED610; } @@ -550,14 +550,14 @@ void func_80AED544(EnTk* this, GlobalContext* globalCtx) { void func_80AED610(EnTk* this, GlobalContext* globalCtx) { if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); } switch (Message_GetState(&globalCtx->msgCtx)) { case 0: if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - 0x1555, 0x71C)) { if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 4, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 4, &this->unk_2D4); func_801518B0(globalCtx, 0x13FD, &this->actor); } else if (CURRENT_DAY != 2) { func_80AED544(this, globalCtx); @@ -583,7 +583,7 @@ void func_80AED610(EnTk* this, GlobalContext* globalCtx) { switch (globalCtx->msgCtx.unk11F04) { case 0x13FD: this->unk_2CA |= 0x10; - func_8013E1C8(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); this->skelAnime.playSpeed = 10.0f; this->actionFunc = func_80AECB6C; break; @@ -619,7 +619,7 @@ void func_80AED610(EnTk* this, GlobalContext* globalCtx) { case 0x1411: case 0x1412: default: - func_8013E1C8(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); this->actionFunc = func_80AECB6C; break; } @@ -633,10 +633,10 @@ void func_80AED898(EnTk* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; if (this->unk_2CA & 0x1000) { if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); } } else { - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); } this->actionFunc = func_80AED940; } @@ -666,7 +666,7 @@ void func_80AED940(EnTk* this, GlobalContext* globalCtx) { } if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); } if (!(this->unk_2CA & 0x40)) { @@ -706,7 +706,7 @@ void func_80AEDBEC(EnTk* this, GlobalContext* globalCtx) { this->actor.params = -1; this->unk_2E8 = 0; this->actor.speedXZ = 0.0f; - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->actionFunc = func_80AEDC4C; } @@ -720,7 +720,7 @@ void func_80AEDC4C(EnTk* this, GlobalContext* globalCtx) { void func_80AEDCBC(EnTk* this, GlobalContext* globalCtx) { this->actor.speedXZ = 10.0f; - func_8013E1C8(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4); Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_2EC); Math_Vec3f_Copy(&this->actor.prevPos, &this->unk_2EC); Math_Vec3s_Copy(&this->actor.world.rot, &this->unk_2F8); @@ -739,7 +739,7 @@ void func_80AEDD4C(EnTk* this, GlobalContext* globalCtx) { void func_80AEDDA0(EnTk* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->actor.flags |= 0x10000; this->unk_2CA |= 0x80; this->actionFunc = func_80AED940; @@ -769,12 +769,12 @@ void func_80AEDE10(EnTk* this, GlobalContext* globalCtx) { case 4: func_801518B0(globalCtx, 0x140F, &this->actor); - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); break; case 3: func_801518B0(globalCtx, 0x1410, &this->actor); - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); break; } break; @@ -789,7 +789,7 @@ void func_80AEDE10(EnTk* this, GlobalContext* globalCtx) { void func_80AEDF5C(EnTk* this, GlobalContext* globalCtx) { if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); } switch (Message_GetState(&globalCtx->msgCtx)) { @@ -805,9 +805,9 @@ void func_80AEDF5C(EnTk* this, GlobalContext* globalCtx) { !Math_SmoothStepToS(&this->unk_31C, 0, 3, 0x71C, 10) && (this->actor.shape.rot.y == (s16)(this->actor.yawTowardsPlayer - 0x1555))) { if (this->unk_2E6 == 0x1404) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 4, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 4, &this->unk_2D4); } else { - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); } func_801518B0(globalCtx, this->unk_2E6, &this->actor); } @@ -943,7 +943,7 @@ void func_80AEE414(EnTk* this, GlobalContext* globalCtx) { void func_80AEE478(EnTk* this, GlobalContext* globalCtx) { this->unk_310 = 2; - func_8013E1C8(&this->skelAnime, D_80AEF868, 3, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 3, &this->unk_2D4); this->actionFunc = func_80AEE4D0; } @@ -1136,7 +1136,7 @@ void func_80AEEB88(EnTk* this, GlobalContext* globalCtx) { } this->unk_2C6 = 100; - func_8013E1C8(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); this->unk_30C = func_80AEED38; } @@ -1177,9 +1177,9 @@ void func_80AEED38(EnTk* this, GlobalContext* globalCtx) { } if (this->unk_2CA & 0x200) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); } else { - func_8013E1C8(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &this->actor.speedXZ, &sp64); } @@ -1196,7 +1196,7 @@ void func_80AEED38(EnTk* this, GlobalContext* globalCtx) { } void func_80AEF048(EnTk* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); this->unk_30C = func_80AEF094; } @@ -1204,9 +1204,9 @@ void func_80AEF094(EnTk* this, GlobalContext* globalCtx) { f32 sp2C; if (this->unk_2CA & 0x200) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); } else { - func_8013E1C8(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &this->actor.speedXZ, &sp2C); } @@ -1218,7 +1218,7 @@ void func_80AEF094(EnTk* this, GlobalContext* globalCtx) { void func_80AEF15C(EnTk* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->unk_30C = func_80AEF1B4; } @@ -1226,7 +1226,7 @@ void func_80AEF1B4(EnTk* this, GlobalContext* globalCtx) { } void func_80AEF1C4(EnTk* this, GlobalContext* globalCtx) { - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->unk_30C = func_80AEF210; } @@ -1235,7 +1235,7 @@ void func_80AEF210(EnTk* this, GlobalContext* globalCtx) { void func_80AEF220(EnTk* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; - func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); + SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->unk_30C = func_80AEF278; } 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 06529d03a1..1372be93db 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -64,12 +64,17 @@ void EnTrt_Blink(EnTrt* this); void EnTrt_OpenEyes2(EnTrt* this); void EnTrt_NodOff(EnTrt* this); -static ActorAnimationEntryS sAnimations[] = { - { &object_trt_Anim_00DE68, 1.0f, 0, -1, 2, 0 }, { &object_trt_Anim_00EE98, 1.0f, 0, -1, 2, 0 }, - { &object_trt_Anim_00FD34, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_0030EC, 1.0f, 0, -1, 2, 0 }, - { &object_trt_Anim_003D78, 1.0f, 0, -1, 2, 0 }, { &object_trt_Anim_00D52C, 1.0f, 0, -1, 0, 0 }, - { &object_trt_Anim_000A44, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_001EF4, 1.0f, 0, -1, 0, 0 }, - { &object_trt_Anim_002224, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_002CB0, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_trt_Anim_0030EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_trt_Anim_003D78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_trt_Anim_00D52C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_trt_Anim_000A44, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_trt_Anim_001EF4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_trt_Anim_002224, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_trt_Anim_002CB0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; const ActorInit En_Trt_InitVars = { @@ -92,17 +97,17 @@ static ShopItem sShop[] = { { SI_POTION_BLUE, { -12, 32, -36 } }, }; -void EnTrt_ChangeAnim(SkelAnime* skelAnime, ActorAnimationEntryS* animations, s32 idx) { +void EnTrt_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animations, s32 idx) { f32 frameCount; animations += idx; if (animations->frameCount < 0) { - frameCount = Animation_GetLastFrame(animations->animationSeg); + frameCount = Animation_GetLastFrame(animations->animation); } else { frameCount = animations->frameCount; } - Animation_Change(skelAnime, animations->animationSeg, animations->playbackSpeed, animations->frame, frameCount, - animations->mode, animations->transitionRate); + Animation_Change(skelAnime, animations->animation, animations->playSpeed, animations->startFrame, frameCount, + animations->mode, animations->morphFrames); } s32 EnTrt_TestItemSelected(GlobalContext* globalCtx) { 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 03b7d31c45..cef309815c 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -26,12 +26,17 @@ void func_80AD4FE4(EnTrt2* this, GlobalContext* globalCtx); void func_80AD5234(EnTrt2* this, GlobalContext* globalCtx); void func_80AD56E8(Actor* thisx, GlobalContext* globalCtx); -static ActorAnimationEntryS sAnimations[] = { - { &object_trt_Anim_00DE68, 1.0f, 0, -1, 2, 0 }, { &object_trt_Anim_00EE98, 1.0f, 0, -1, 2, 0 }, - { &object_trt_Anim_00FD34, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_0030EC, 1.0f, 0, -1, 2, 0 }, - { &object_trt_Anim_003D78, 1.0f, 0, -1, 2, 0 }, { &object_trt_Anim_00D52C, 1.0f, 0, -1, 0, 0 }, - { &object_trt_Anim_000A44, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_001EF4, 1.0f, 0, -1, 0, 0 }, - { &object_trt_Anim_002224, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_002CB0, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS sAnimations[] = { + { &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 }, + { &object_trt_Anim_0030EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_trt_Anim_003D78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_trt_Anim_00D52C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_trt_Anim_000A44, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_trt_Anim_001EF4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_trt_Anim_002224, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_trt_Anim_002CB0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; const ActorInit En_Trt2_InitVars = { @@ -103,18 +108,18 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -void func_80AD3380(SkelAnime* skelAnime, ActorAnimationEntryS* animation, s32 arg2) { +void func_80AD3380(SkelAnime* skelAnime, AnimationInfoS* animation, s32 arg2) { f32 phi_f0; animation += arg2; if (animation->frameCount < 0) { - phi_f0 = Animation_GetLastFrame(animation->animationSeg); + phi_f0 = Animation_GetLastFrame(animation->animation); } else { phi_f0 = animation->frameCount; } - Animation_Change(skelAnime, animation->animationSeg, animation->playbackSpeed, animation->frame, phi_f0, - animation->mode, animation->transitionRate); + Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, phi_f0, + animation->mode, animation->morphFrames); } void func_80AD341C(EnTrt2* this, GlobalContext* globalCtx) { 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 56d570e5b2..767bfdae29 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -106,15 +106,23 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 20, 0, 0, MASS_IMMOVABLE }; -static ActorAnimationEntryS D_80A8B2D8[] = { - { &object_tru_Anim_00F9A0, 1.0f, 0, -1, 0, 0 }, { &object_tru_Anim_00F9A0, 1.0f, 0, -1, 0, -4 }, - { &object_tru_Anim_0108AC, 1.0f, 0, -1, 2, -4 }, { &object_tru_Anim_009348, 1.0f, 0, -1, 2, 0 }, - { &object_tru_Anim_00EEDC, 1.0f, 0, -1, 0, -4 }, { &object_tru_Anim_015CA0, 1.0f, 0, -1, 0, 0 }, - { &object_tru_Anim_015CA0, 1.0f, 0, -1, 0, -4 }, { &object_tru_Anim_014728, 1.0f, 0, -1, 2, 0 }, - { &object_tru_Anim_01B5C4, 1.0f, 0, -1, 2, 0 }, { &object_tru_Anim_007FA0, 1.0f, 0, -1, 2, -4 }, - { &object_tru_Anim_016B4C, 1.0f, 0, -1, 0, -4 }, { &object_tru_Anim_011F88, 1.0f, 0, -1, 2, -4 }, - { &object_tru_Anim_00446C, 1.0f, 0, -1, 0, 0 }, { &object_tru_Anim_003698, 1.0f, 0, -1, 2, -4 }, - { &object_tru_Anim_002BD8, 1.0f, 0, -1, 0, 0 }, { &object_tru_Anim_00446C, 1.0f, 0, -1, 0, 0 }, +static AnimationInfoS D_80A8B2D8[] = { + { &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 }, + { &object_tru_Anim_009348, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_tru_Anim_00EEDC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_tru_Anim_015CA0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_tru_Anim_015CA0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_tru_Anim_014728, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_tru_Anim_01B5C4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &object_tru_Anim_007FA0, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_tru_Anim_016B4C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &object_tru_Anim_011F88, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_tru_Anim_00446C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_tru_Anim_003698, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &object_tru_Anim_002BD8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &object_tru_Anim_00446C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; static Vec3f D_80A8B3D8 = { 0.0f, 24.0f, 16.0f }; @@ -418,7 +426,7 @@ s32 func_80A86924(EnTru* this, s32 arg1) { if (arg1 != this->unk_37C) { this->unk_37C = arg1; - ret = func_8013BC6C(&this->skelAnime, D_80A8B2D8, arg1); + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80A8B2D8, arg1); this->unk_358 = this->skelAnime.playSpeed; } 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 432fbec9d9..b547f5a8c6 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -91,11 +91,14 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), }; -static ActorAnimationEntryS sAnimations[] = { - { &gZoraIdleAnim, 1.0f, 0, -1, 0, 0 }, { &gZoraIdleAnim, 1.0f, 0, -1, 0, -4 }, - { &gZoraSurfacingAnim, 1.0f, 0, -1, 0, -4 }, { &gZoraHandsOnHipsTappingFootAnim, 1.0f, 0, -1, 0, -4 }, - { &gZoraArmsOpenAnim, 1.0f, 0, -1, 0, -4 }, { &gZoraThrowRupeeAnim, 1.0f, 0, -1, 0, -4 }, - { &gZoraWalkAnim, 1.0f, 0, -1, 0, -4 }, +static AnimationInfoS sAnimations[] = { + { &gZoraIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gZoraIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gZoraSurfacingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gZoraHandsOnHipsTappingFootAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gZoraArmsOpenAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gZoraThrowRupeeAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gZoraWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; s8 D_8099F578[] = { -1, 1, 12, 13, 14, 9, 10, 11, 0, 6, 7, 8, 3, 4, 5, 2, -1, -1, -1, -1 }; @@ -110,11 +113,11 @@ s32 EnZo_SetAnimation(SkelAnime* skelAnime, s16 index) { didChange = true; frameCount = sAnimations[index].frameCount; if (frameCount < 0) { - frameCount = Animation_GetLastFrame(sAnimations[index].animationSeg); + frameCount = Animation_GetLastFrame(sAnimations[index].animation); } - Animation_Change(skelAnime, sAnimations[index].animationSeg, sAnimations[index].playbackSpeed, - sAnimations[index].frame, frameCount, sAnimations[index].mode, - sAnimations[index].transitionRate); + Animation_Change(skelAnime, sAnimations[index].animation, sAnimations[index].playSpeed, + sAnimations[index].startFrame, frameCount, sAnimations[index].mode, + sAnimations[index].morphFrames); } return didChange; } @@ -196,7 +199,7 @@ void EnZo_LookAtPlayer(EnZo* this, GlobalContext* globalCtx) { } EnZo_Blink(this, 3); - func_8013D9C8(globalCtx, this->limbRotY, this->limbRotZ, 20); + SubS_FillLimbRotTables(globalCtx, this->limbRotY, this->limbRotZ, 20); } void EnZo_Walk(EnZo* this, GlobalContext* globalCtx) { diff --git a/tools/actorfixer.py b/tools/actorfixer.py index 990d672511..d81c578baf 100755 --- a/tools/actorfixer.py +++ b/tools/actorfixer.py @@ -213,7 +213,8 @@ animdict = { "func_800BE2B8": "Actor_SetDropFlagJntSph", "Actor_TitleCardCreate": "TitleCard_InitBossName", "func_800B867C": "Actor_TextboxIsClosing", - "func_800BDC5C": "Actor_ChangeAnimation", + "func_800BDC5C": "Actor_ChangeAnimationByInfo", + "Actor_ChangeAnimation(": "Actor_ChangeAnimationByInfo(", "func_80152498": "Message_GetState", "func_800B8898": "Actor_GetScreenPos", "Audio_PlayActorSound2": "Actor_PlaySfxAtPos", @@ -389,7 +390,9 @@ animdict = { "func_80134148": "SkelAnime_DrawTransformFlexLimbOpa", "func_8013AB00": "SubS_DrawTransformFlex", "func_8013A860": "SubS_DrawTransformFlexLimb", - + "func_8013BC6C": "SubS_ChangeAnimationByInfoS", + "func_8013E1C8": "SubS_ChangeAnimationBySpeedInfo", + "func_8013D9C8": "SubS_FillLimbRotTables", # Structs members "skelAnime.unk03": "skelAnime.taper", @@ -430,6 +433,11 @@ animdict = { "D_801D1DE0": "gIdentityMtx", "D_801D1E20": "gIdentityMtxF", + # Structs + "ActorAnimationEntry": "AnimationInfo", + "ActorAnimationEntryS": "AnimationInfoS", + "struct_80B8E1A8": "AnimationSpeedInfo", + "ICHAIN_F32_DIV1000(minVelocityY,": "ICHAIN_F32_DIV1000(terminalVelocity,", "ICHAIN_F32(minVelocityY,": "ICHAIN_F32(terminalVelocity,", } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index b008d3340a..3f1a4541c8 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -877,7 +877,7 @@ 0x800BD9E0:("func_800BD9E0",), 0x800BDAA0:("func_800BDAA0",), 0x800BDB6C:("func_800BDB6C",), - 0x800BDC5C:("Actor_ChangeAnimation",), + 0x800BDC5C:("Actor_ChangeAnimationByInfo",), 0x800BDCF4:("func_800BDCF4",), 0x800BDFB0:("Actor_Noop",), 0x800BDFC0:("Gfx_DrawDListOpa",), @@ -2669,7 +2669,7 @@ 0x8013B878:("func_8013B878",), 0x8013BB34:("func_8013BB34",), 0x8013BB7C:("SubS_FindNearestActor",), - 0x8013BC6C:("func_8013BC6C",), + 0x8013BC6C:("SubS_ChangeAnimationByInfoS",), 0x8013BD40:("func_8013BD40",), 0x8013BEDC:("func_8013BEDC",), 0x8013C068:("func_8013C068",), @@ -2690,7 +2690,7 @@ 0x8013D8DC:("func_8013D8DC",), 0x8013D924:("func_8013D924",), 0x8013D960:("SubS_FindActor",), - 0x8013D9C8:("func_8013D9C8",), + 0x8013D9C8:("SubS_FillLimbRotTables",), 0x8013DB90:("func_8013DB90",), 0x8013DC40:("func_8013DC40",), 0x8013DCCC:("func_8013DCCC",), @@ -2700,7 +2700,7 @@ 0x8013E054:("func_8013E054",), 0x8013E07C:("func_8013E07C",), 0x8013E0A4:("func_8013E0A4",), - 0x8013E1C8:("func_8013E1C8",), + 0x8013E1C8:("SubS_ChangeAnimationBySpeedInfo",), 0x8013E2D4:("func_8013E2D4",), 0x8013E3B8:("func_8013E3B8",), 0x8013E4B0:("func_8013E4B0",), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index da2ea51f54..aeea6d9aee 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -391,7 +391,7 @@ asm/non_matchings/code/z_actor/func_800BD9A0.s,func_800BD9A0,0x800BD9A0,0x10 asm/non_matchings/code/z_actor/func_800BD9E0.s,func_800BD9E0,0x800BD9E0,0x30 asm/non_matchings/code/z_actor/func_800BDAA0.s,func_800BDAA0,0x800BDAA0,0x33 asm/non_matchings/code/z_actor/func_800BDB6C.s,func_800BDB6C,0x800BDB6C,0x3C -asm/non_matchings/code/z_actor/Actor_ChangeAnimation.s,Actor_ChangeAnimation,0x800BDC5C,0x26 +asm/non_matchings/code/z_actor/Actor_ChangeAnimationByInfo.s,Actor_ChangeAnimationByInfo,0x800BDC5C,0x26 asm/non_matchings/code/z_actor/func_800BDCF4.s,func_800BDCF4,0x800BDCF4,0xAF asm/non_matchings/code/z_actor/Actor_Noop.s,Actor_Noop,0x800BDFB0,0x4 asm/non_matchings/code/z_actor/Gfx_DrawDListOpa.s,Gfx_DrawDListOpa,0x800BDFC0,0x1F @@ -2183,7 +2183,7 @@ asm/non_matchings/code/z_sub_s/func_8013B6B0.s,func_8013B6B0,0x8013B6B0,0x72 asm/non_matchings/code/z_sub_s/func_8013B878.s,func_8013B878,0x8013B878,0xAF asm/non_matchings/code/z_sub_s/func_8013BB34.s,func_8013BB34,0x8013BB34,0x12 asm/non_matchings/code/z_sub_s/SubS_FindNearestActor.s,SubS_FindNearestActor,0x8013BB7C,0x3C -asm/non_matchings/code/z_sub_s/func_8013BC6C.s,func_8013BC6C,0x8013BC6C,0x35 +asm/non_matchings/code/z_sub_s/SubS_ChangeAnimationByInfoS.s,SubS_ChangeAnimationByInfoS,0x8013BC6C,0x35 asm/non_matchings/code/z_sub_s/func_8013BD40.s,func_8013BD40,0x8013BD40,0x67 asm/non_matchings/code/z_sub_s/func_8013BEDC.s,func_8013BEDC,0x8013BEDC,0x63 asm/non_matchings/code/z_sub_s/func_8013C068.s,func_8013C068,0x8013C068,0x16F @@ -2204,7 +2204,7 @@ asm/non_matchings/code/z_sub_s/func_8013D83C.s,func_8013D83C,0x8013D83C,0x28 asm/non_matchings/code/z_sub_s/func_8013D8DC.s,func_8013D8DC,0x8013D8DC,0x12 asm/non_matchings/code/z_sub_s/func_8013D924.s,func_8013D924,0x8013D924,0xF asm/non_matchings/code/z_sub_s/SubS_FindActor.s,SubS_FindActor,0x8013D960,0x1A -asm/non_matchings/code/z_sub_s/func_8013D9C8.s,func_8013D9C8,0x8013D9C8,0x72 +asm/non_matchings/code/z_sub_s/SubS_FillLimbRotTables.s,SubS_FillLimbRotTables,0x8013D9C8,0x72 asm/non_matchings/code/z_sub_s/func_8013DB90.s,func_8013DB90,0x8013DB90,0x2C asm/non_matchings/code/z_sub_s/func_8013DC40.s,func_8013DC40,0x8013DC40,0x23 asm/non_matchings/code/z_sub_s/func_8013DCCC.s,func_8013DCCC,0x8013DCCC,0x5 @@ -2214,7 +2214,7 @@ asm/non_matchings/code/z_sub_s/func_8013DF3C.s,func_8013DF3C,0x8013DF3C,0x46 asm/non_matchings/code/z_sub_s/func_8013E054.s,func_8013E054,0x8013E054,0xA asm/non_matchings/code/z_sub_s/func_8013E07C.s,func_8013E07C,0x8013E07C,0xA asm/non_matchings/code/z_sub_s/func_8013E0A4.s,func_8013E0A4,0x8013E0A4,0x49 -asm/non_matchings/code/z_sub_s/func_8013E1C8.s,func_8013E1C8,0x8013E1C8,0x43 +asm/non_matchings/code/z_sub_s/SubS_ChangeAnimationBySpeedInfo.s,SubS_ChangeAnimationBySpeedInfo,0x8013E1C8,0x43 asm/non_matchings/code/z_sub_s/func_8013E2D4.s,func_8013E2D4,0x8013E2D4,0x39 asm/non_matchings/code/z_sub_s/func_8013E3B8.s,func_8013E3B8,0x8013E3B8,0x3E asm/non_matchings/code/z_sub_s/func_8013E4B0.s,func_8013E4B0,0x8013E4B0,0x47