From 899d5a96b2bc1f699a0a34fbab86d7a9f32b49f8 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Mon, 2 Jun 2025 10:34:24 -0400 Subject: [PATCH] Child Ruto Part 13: Animation change function --- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 0e4573f90d..27700c389d 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -381,25 +381,25 @@ void func_80AEB220(EnRu1* this, PlayState* play) { } #endif -void func_80AEB264(EnRu1* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) { +void EnRu1_AnimationChange(EnRu1* this, AnimationHeader* animation, u8 mode, f32 morphFrames, s32 direction) { s32 pad[2]; AnimationHeader* animHeader = SEGMENTED_TO_VIRTUAL(animation); f32 frameCount = Animation_GetLastFrame(animHeader); f32 playbackSpeed; - f32 unk0; - f32 fc; + f32 startFrame; + f32 endFrame; - if (arg4 == 0) { - unk0 = 0.0f; - fc = frameCount; + if (direction == 0) { + startFrame = 0.0f; + endFrame = frameCount; playbackSpeed = 1.0f; } else { - unk0 = frameCount; - fc = 0.0f; + startFrame = frameCount; + endFrame = 0.0f; playbackSpeed = -1.0f; } - Animation_Change(&this->skelAnime, animHeader, playbackSpeed, unk0, fc, arg2, morphFrames); + Animation_Change(&this->skelAnime, animHeader, playbackSpeed, startFrame, endFrame, mode, morphFrames); } s32 EnRu1_UpdateSkelAnime(EnRu1* this) { @@ -426,7 +426,7 @@ void func_80AEB3CC(EnRu1* this) { } void func_80AEB3DC(EnRu1* this, PlayState* play) { - func_80AEB264(this, &gRutoChildWaitHandsBehindBackAnim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWaitHandsBehindBackAnim, 0, 0, 0); this->action = 0; this->drawConfig = 1; EnRu1_SetEyeIndex(this, 4); @@ -784,14 +784,14 @@ void func_80AEC2C0(EnRu1* this, PlayState* play) { void func_80AEC320(EnRu1* this, PlayState* play) { if (!GET_INFTABLE(INFTABLE_141)) { - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 7; EnRu1_SetMouthIndex(this, 1); } else if (GET_INFTABLE(INFTABLE_147) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145)) { if (!func_80AEB020(this, play)) { s8 actorRoom; - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; this->action = 22; this->actor.room = -1; @@ -1028,7 +1028,7 @@ void func_80AECCB0(EnRu1* this, PlayState* play) { } void func_80AECDA0(EnRu1* this, PlayState* play) { - func_80AEB264(this, &gRutoChildWaitHandsOnHipsAnim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWaitHandsOnHipsAnim, 0, 0, 0); this->action = 15; this->actor.shape.yOffset = -10000.0f; EnRu1_SetEyeIndex(this, 5); @@ -1199,7 +1199,7 @@ void func_80AED44C(EnRu1* this, PlayState* play) { if (!func_80AEB020(this, play)) { s8 actorRoom; - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; this->action = 22; this->actor.room = -1; @@ -1962,7 +1962,7 @@ void func_80AEF540(EnRu1* this) { EnRu1_SetEyeIndex(this, 3); EnRu1_SetMouthIndex(this, 2); if (this->skelAnime.mode != 2) { - func_80AEB264(this, &gRutoChildShutterAnim, 2, -8.0f, 0); + EnRu1_AnimationChange(this, &gRutoChildShutterAnim, 2, -8.0f, 0); func_80AEF51C(this); } } @@ -2153,7 +2153,7 @@ void func_80AEFC54(EnRu1* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_145) && !GET_INFTABLE(INFTABLE_146)) { s32 pad; - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 41; this->unk_28C = EnRu1_FindSwitch(play); func_80AEB0EC(this, 1); @@ -2174,7 +2174,7 @@ void func_80AEFCE8(EnRu1* this, PlayState* play) { void func_80AEFD38(EnRu1* this, PlayState* play) { if (GET_EVENTCHKINF(EVENTCHKINF_37) && LINK_IS_CHILD) { - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0); this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; this->action = 44; this->drawConfig = 1; @@ -2238,7 +2238,7 @@ void func_80AEFF94(EnRu1* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_141) && GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145) && (!(func_80AEB020(this, play)))) { - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; this->action = 22; this->actor.room = -1; @@ -2255,7 +2255,7 @@ void func_80AEFF94(EnRu1* this, PlayState* play) { #if DEBUG_FEATURES void func_80AF0050(EnRu1* this, PlayState* play) { - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 36; this->roomNum1 = this->actor.room; this->unk_28C = EnRu1_FindSwitch(play);