From 28e4a675b0e6c11c14b2476a5d55a6a08a85ddd8 Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Sun, 15 Nov 2020 02:53:06 -0800 Subject: [PATCH] Flash state --- .../actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c | 12 ++++++------ .../actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index 848823096c..beaf787017 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -173,7 +173,7 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) { this->actionFunc = BgGanonOtyuka_Fall; this->isFalling = true; this->dropTimer = 20; - this->unk_16E = 1; + this->flashState = FLASH_GROW; this->flashTimer = 0; this->flashPrimColorR = 255.0f; this->flashPrimColorG = 255.0f; @@ -192,20 +192,20 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) { Vec3f accel; osSyncPrintf("MODE DOWN\n"); - if (this->unk_16E == 1) { + if (this->flashState == FLASH_GROW) { Math_SmoothScaleMaxF(&this->flashPrimColorB, 170.0f, 1.0f, 8.5f); Math_SmoothScaleMaxF(&this->flashEnvColorR, 120.0f, 1.0f, 13.5f); Math_SmoothScaleMaxF(&this->flashYScale, 2.5f, 1.0f, 0.25f); if (this->flashYScale == 2.5f) { - this->unk_16E = 2; + this->flashState = FLASH_SHRINK; } - } else if (this->unk_16E == 2) { + } else if (this->flashState == FLASH_SHRINK) { Math_SmoothScaleMaxF(&this->flashPrimColorG, 0.0f, 1.0f, 25.5f); Math_SmoothScaleMaxF(&this->flashEnvColorR, 0.0f, 1.0f, 12.0f); Math_SmoothScaleMaxF(&this->flashEnvColorG, 0.0f, 1.0f, 25.5f); Math_SmoothDownscaleMaxF(&this->flashYScale, 1.0f, 0.25f); if (this->flashYScale == 0.0f) { - this->unk_16E = 0; + this->flashState = FLASH_NONE; } } if (this->dropTimer == 0) { @@ -356,7 +356,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { if (actor->id == ACTOR_BG_GANON_OTYUKA) { platform = (BgGanonOtyuka*)actor; - if ((platform->dyna.actor.projectedPos.z > -30.0f) && (platform->unk_16E != 0)) { + if ((platform->dyna.actor.projectedPos.z > -30.0f) && (platform->flashState != FLASH_NONE)) { gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, platform->flashTimer * 4, 0, 32, 64, 1, platform->flashTimer * 4, 0, 32, 64)); diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h index fa8a0a9655..f72e77c1f7 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h @@ -10,6 +10,8 @@ #define SIDE_SOUTH 8 #define SIDE_ALL (SIDE_WEST | SIDE_EAST | SIDE_NORTH | SIDE_SOUTH) +typedef enum { FLASH_NONE, FLASH_GROW, FLASH_SHRINK } FlashState; + struct BgGanonOtyuka; typedef void (*BgGanonOtyukaActionFunc)(struct BgGanonOtyuka*, GlobalContext*); @@ -22,7 +24,7 @@ typedef struct BgGanonOtyuka { /* 0x016B */ u8 tiltSides; /* 0x016C */ u8 visibleSides; /* 0x016D */ u8 flashTimer; - /* 0x016E */ u8 unk_16E; + /* 0x016E */ u8 flashState; /* 0x0170 */ f32 flashYScale; /* 0x0174 */ f32 flashPrimColorR; /* 0x0178 */ f32 flashPrimColorG;