From 318126a1b714a02bc0ffeb5e2dac55b013702668 Mon Sep 17 00:00:00 2001 From: feacur Date: Tue, 12 Nov 2024 01:12:59 +0100 Subject: [PATCH] `func_80034DD4` -> `Actor_FadeInOut` https://github.com/zeldaret/oot/pull/2289#discussion_r1837267267 --- include/z64actor.h | 2 +- src/code/z_actor.c | 4 ++-- src/overlays/actors/ovl_En_Md/z_en_md.c | 16 ++++++++-------- src/overlays/actors/ovl_En_Sa/z_en_sa.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index bc81567d01..ab58a16f86 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -916,7 +916,7 @@ void func_80034BA0(struct PlayState* play, SkelAnime* skelAnime, OverrideLimbDra PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); void func_80034CC4(struct PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); -s16 Actor_SmoothStep_Attention(Actor* actor, struct PlayState* play, s16 alpha, f32 threshold); +s16 Actor_FadeInOut(Actor* actor, struct PlayState* play, s16 alpha, f32 radius); void func_80034F54(struct PlayState* play, s16* arg1, s16* arg2, s32 arg3); void Actor_Noop(Actor* actor, struct PlayState* play); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 7c9eecd4d4..0ac8b2ac2f 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4396,7 +4396,7 @@ void func_80034CC4(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overr CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8904); } -s16 Actor_SmoothStep_Attention(Actor* actor, PlayState* play, s16 alpha, f32 threshold) { +s16 Actor_FadeInOut(Actor* actor, PlayState* play, s16 alpha, f32 radius) { Player* player = GET_PLAYER(play); f32 distance; @@ -4406,7 +4406,7 @@ s16 Actor_SmoothStep_Attention(Actor* actor, PlayState* play, s16 alpha, f32 thr distance = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos); } - if (threshold < distance) { + if (radius < distance) { actor->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Math_SmoothStepToS(&alpha, 0, 6, 0x14, 1); } else { diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 5769d7c5e1..4a3f282822 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -650,15 +650,15 @@ u8 EnMd_SetMovedPos(EnMd* this, PlayState* play) { return 1; } -void EnMd_SmoothStep_Attention(EnMd* this, PlayState* play) { - f32 threshold; +void EnMd_FadeInOut(EnMd* this, PlayState* play) { + f32 radius; if (play->sceneId != SCENE_MIDOS_HOUSE) { - threshold = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !GET_EVENTCHKINF(EVENTCHKINF_1C) && - (play->sceneId == SCENE_KOKIRI_FOREST)) - ? 100.0f - : 400.0f; - this->alpha = Actor_SmoothStep_Attention(&this->actor, play, this->alpha, threshold); + radius = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !GET_EVENTCHKINF(EVENTCHKINF_1C) && + (play->sceneId == SCENE_KOKIRI_FOREST)) + ? 100.0f + : 400.0f; + this->alpha = Actor_FadeInOut(&this->actor, play, this->alpha, radius); this->actor.shape.shadowAlpha = this->alpha; } else { this->alpha = 255; @@ -844,7 +844,7 @@ void EnMd_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); EnMd_UpdateEyes(this); - EnMd_SmoothStep_Attention(this, play); + EnMd_FadeInOut(this, play); Actor_MoveXZGravity(&this->actor); EnMd_UpdateTalking(this, play); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 2952755558..9fd6d1e41a 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -738,7 +738,7 @@ void EnSa_Update(Actor* thisx, PlayState* play) { } if (this->actionFunc != func_80AF68E4) { - this->alpha = Actor_SmoothStep_Attention(&this->actor, play, this->alpha, 400.0f); + this->alpha = Actor_FadeInOut(&this->actor, play, this->alpha, 400.0f); } else { this->alpha = 255; }