From 91732239dada36737a3afb0cc0e7422246debe3a Mon Sep 17 00:00:00 2001 From: feacur Date: Sun, 10 Nov 2024 13:03:01 +0100 Subject: [PATCH] Document eye textures as an enum to clarify for `EnMd_UpdateEyes` --- src/overlays/actors/ovl_En_Md/z_en_md.c | 4 ++-- src/overlays/actors/ovl_En_Md/z_en_md.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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 9352846d24..74f9988cd8 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -545,9 +545,9 @@ u8 EnMd_ShouldSpawn(EnMd* this, PlayState* play) { void EnMd_UpdateEyes(EnMd* this) { if (DECR(this->blinkTimer) == 0) { this->eyeIdx++; - if (this->eyeIdx > 2) { + if (this->eyeIdx > ENMD_EYE_CLOSED) { this->blinkTimer = Rand_S16Offset(30, 30); - this->eyeIdx = 0; + this->eyeIdx = ENMD_EYE_OPEN; } } } diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.h b/src/overlays/actors/ovl_En_Md/z_en_md.h index 6589f002e2..2f4139142f 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.h +++ b/src/overlays/actors/ovl_En_Md/z_en_md.h @@ -27,6 +27,15 @@ typedef enum EnMdLimb { ENMD_LIMB_MAX } EnMdLimb; +typedef enum EnMdEye { + ENMD_EYE_OPEN, + ENMD_EYE_HALF, + ENMD_EYE_CLOSED, + ENMD_EYE_ANGRY, + ENMD_EYE_LOOKING_UP, + ENMD_EYE_MAX +} EnMdEye; + typedef void (*EnMdActionFunc)(struct EnMd*, PlayState*); typedef struct EnMd {