Child Ruto Part 13: Animation change function

This commit is contained in:
JordanLongstaff 2025-06-02 10:34:24 -04:00
parent d2ef102802
commit 899d5a96b2
1 changed files with 19 additions and 19 deletions

View File

@ -381,25 +381,25 @@ void func_80AEB220(EnRu1* this, PlayState* play) {
} }
#endif #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]; s32 pad[2];
AnimationHeader* animHeader = SEGMENTED_TO_VIRTUAL(animation); AnimationHeader* animHeader = SEGMENTED_TO_VIRTUAL(animation);
f32 frameCount = Animation_GetLastFrame(animHeader); f32 frameCount = Animation_GetLastFrame(animHeader);
f32 playbackSpeed; f32 playbackSpeed;
f32 unk0; f32 startFrame;
f32 fc; f32 endFrame;
if (arg4 == 0) { if (direction == 0) {
unk0 = 0.0f; startFrame = 0.0f;
fc = frameCount; endFrame = frameCount;
playbackSpeed = 1.0f; playbackSpeed = 1.0f;
} else { } else {
unk0 = frameCount; startFrame = frameCount;
fc = 0.0f; endFrame = 0.0f;
playbackSpeed = -1.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) { s32 EnRu1_UpdateSkelAnime(EnRu1* this) {
@ -426,7 +426,7 @@ void func_80AEB3CC(EnRu1* this) {
} }
void func_80AEB3DC(EnRu1* this, PlayState* play) { 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->action = 0;
this->drawConfig = 1; this->drawConfig = 1;
EnRu1_SetEyeIndex(this, 4); EnRu1_SetEyeIndex(this, 4);
@ -784,14 +784,14 @@ void func_80AEC2C0(EnRu1* this, PlayState* play) {
void func_80AEC320(EnRu1* this, PlayState* play) { void func_80AEC320(EnRu1* this, PlayState* play) {
if (!GET_INFTABLE(INFTABLE_141)) { if (!GET_INFTABLE(INFTABLE_141)) {
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0);
this->action = 7; this->action = 7;
EnRu1_SetMouthIndex(this, 1); EnRu1_SetMouthIndex(this, 1);
} else if (GET_INFTABLE(INFTABLE_147) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145)) { } else if (GET_INFTABLE(INFTABLE_147) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145)) {
if (!func_80AEB020(this, play)) { if (!func_80AEB020(this, play)) {
s8 actorRoom; s8 actorRoom;
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0);
actorRoom = this->actor.room; actorRoom = this->actor.room;
this->action = 22; this->action = 22;
this->actor.room = -1; this->actor.room = -1;
@ -1028,7 +1028,7 @@ void func_80AECCB0(EnRu1* this, PlayState* play) {
} }
void func_80AECDA0(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->action = 15;
this->actor.shape.yOffset = -10000.0f; this->actor.shape.yOffset = -10000.0f;
EnRu1_SetEyeIndex(this, 5); EnRu1_SetEyeIndex(this, 5);
@ -1199,7 +1199,7 @@ void func_80AED44C(EnRu1* this, PlayState* play) {
if (!func_80AEB020(this, play)) { if (!func_80AEB020(this, play)) {
s8 actorRoom; s8 actorRoom;
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0);
actorRoom = this->actor.room; actorRoom = this->actor.room;
this->action = 22; this->action = 22;
this->actor.room = -1; this->actor.room = -1;
@ -1962,7 +1962,7 @@ void func_80AEF540(EnRu1* this) {
EnRu1_SetEyeIndex(this, 3); EnRu1_SetEyeIndex(this, 3);
EnRu1_SetMouthIndex(this, 2); EnRu1_SetMouthIndex(this, 2);
if (this->skelAnime.mode != 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); func_80AEF51C(this);
} }
} }
@ -2153,7 +2153,7 @@ void func_80AEFC54(EnRu1* this, PlayState* play) {
if (GET_INFTABLE(INFTABLE_145) && !GET_INFTABLE(INFTABLE_146)) { if (GET_INFTABLE(INFTABLE_145) && !GET_INFTABLE(INFTABLE_146)) {
s32 pad; s32 pad;
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0);
this->action = 41; this->action = 41;
this->unk_28C = EnRu1_FindSwitch(play); this->unk_28C = EnRu1_FindSwitch(play);
func_80AEB0EC(this, 1); func_80AEB0EC(this, 1);
@ -2174,7 +2174,7 @@ void func_80AEFCE8(EnRu1* this, PlayState* play) {
void func_80AEFD38(EnRu1* this, PlayState* play) { void func_80AEFD38(EnRu1* this, PlayState* play) {
if (GET_EVENTCHKINF(EVENTCHKINF_37) && LINK_IS_CHILD) { 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->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED;
this->action = 44; this->action = 44;
this->drawConfig = 1; 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) && if (GET_INFTABLE(INFTABLE_141) && GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145) &&
(!(func_80AEB020(this, play)))) { (!(func_80AEB020(this, play)))) {
func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); EnRu1_AnimationChange(this, &gRutoChildWait2Anim, 0, 0, 0);
actorRoom = this->actor.room; actorRoom = this->actor.room;
this->action = 22; this->action = 22;
this->actor.room = -1; this->actor.room = -1;
@ -2255,7 +2255,7 @@ void func_80AEFF94(EnRu1* this, PlayState* play) {
#if DEBUG_FEATURES #if DEBUG_FEATURES
void func_80AF0050(EnRu1* this, PlayState* play) { 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->action = 36;
this->roomNum1 = this->actor.room; this->roomNum1 = this->actor.room;
this->unk_28C = EnRu1_FindSwitch(play); this->unk_28C = EnRu1_FindSwitch(play);