From 8784c81a3d2f144674939a7793856c3be0470ef5 Mon Sep 17 00:00:00 2001 From: feacur Date: Sun, 10 Nov 2024 11:37:08 +0100 Subject: [PATCH] Document `func_80A3F0E4` as `EnGo_UpdateBlinking` reason: `EnGo2_EyeMouthTexState` code analogy --- src/overlays/actors/ovl_En_Go/z_en_go.c | 17 ++++++++++------- src/overlays/actors/ovl_En_Go/z_en_go.h | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) 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 fbe15fb6f6..c472efd493 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -426,12 +426,15 @@ void func_80A3F060(EnGo* this, PlayState* play) { Npc_TrackPoint(&this->actor, &this->interactInfo, 4, trackingMode); } -void func_80A3F0E4(EnGo* this) { - if (DECR(this->unk_214) == 0) { - this->unk_216++; - if (this->unk_216 >= 3) { - this->unk_214 = Rand_S16Offset(30, 30); - this->unk_216 = 0; +void EnGo_UpdateBlinking(EnGo* this) { + // @unused + // although this function runs a similar logic as `EnGo2_EyeMouthTexState` + // its results are never used: this Goron always sets `gGoronCsEyeOpenTex` + if (DECR(this->blinkTimer) == 0) { + this->eyeTexIndex++; + if (this->eyeTexIndex >= 3) { + this->blinkTimer = Rand_S16Offset(30, 30); + this->eyeTexIndex = 0; } } } @@ -1054,7 +1057,7 @@ void EnGo_Update(Actor* thisx, PlayState* play) { } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); - func_80A3F0E4(this); + EnGo_UpdateBlinking(this); func_80A3F908(this, play); this->actionFunc(this, play); func_80A3F060(this, play); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h index 894b457d14..7b695a969b 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -56,8 +56,8 @@ typedef struct EnGo { /* 0x020E */ s16 unk_20E; /* 0x0210 */ s16 unk_210; /* 0x0212 */ s16 unk_212; - /* 0x0214 */ s16 unk_214; - /* 0x0216 */ s16 unk_216; + /* 0x0214 */ s16 blinkTimer; // unused + /* 0x0216 */ s16 eyeTexIndex; // unused /* 0x0218 */ s16 unk_218; /* 0x021A */ s16 unk_21A; /* 0x021C */ s16 unk_21C;