diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2021-08-15 07:56:20 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-15 10:56:20 -0400 |
| commit | f90e3ee739689ffa404e0e45eddf2e08dc5569dd (patch) | |
| tree | af6ee237d196e4a550fc3b6d34f36db0ce6e2b88 /src | |
| parent | 5dc98392e034a3f4ba1dafbf69883d657db4817d (diff) | |
Color_RGBAu32 (#253)
* Renamed deprecated RGB5A1 to RGBA16
* Cleanup shopkeeper structs with Color_RGBAu32 and Vec3f
* Rename functions with RGB5A1 in them
* BSS fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/code/PreRender.c | 4 | ||||
| -rw-r--r-- | src/code/sys_initial_check.c | 4 | ||||
| -rw-r--r-- | src/code/z_scene_proc.c | 7 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 98 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Fsn/z_en_fsn.h | 9 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_GirlA/z_en_girla.h | 10 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 96 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Ossan/z_en_ossan.h | 9 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 100 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Sob1/z_en_sob1.h | 9 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Trt/z_en_trt.c | 96 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_En_Trt/z_en_trt.h | 9 |
12 files changed, 213 insertions, 238 deletions
diff --git a/src/code/PreRender.c b/src/code/PreRender.c index f3ce934bf..bdf4d326c 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -283,8 +283,8 @@ void PreRender_AntiAliasAlgorithm(PreRender* this, s32 x, s32 y) { s32 pxR2; s32 pxG2; s32 pxB2; - Color_RGB5A1 pxIn; - Color_RGB5A1 pxOut; + Color_RGBA16 pxIn; + Color_RGBA16 pxOut; u32 pxR3; u32 pxG3; u32 pxB3; diff --git a/src/code/sys_initial_check.c b/src/code/sys_initial_check.c index d435abae0..7b0a26cc8 100644 --- a/src/code/sys_initial_check.c +++ b/src/code/sys_initial_check.c @@ -1,12 +1,12 @@ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/sys_initial_check/Check_WriteRGB5A1Pixel.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/sys_initial_check/Check_WriteRGBA16Pixel.s") #pragma GLOBAL_ASM("asm/non_matchings/code/sys_initial_check/Check_WriteI4Pixel.s") #pragma GLOBAL_ASM("asm/non_matchings/code/sys_initial_check/Check_DrawI4Texture.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/sys_initial_check/Check_ClearRGB5A1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/sys_initial_check/Check_ClearRGBA16.s") #pragma GLOBAL_ASM("asm/non_matchings/code/sys_initial_check/Check_DrawExpansionPakErrorMessage.s") diff --git a/src/code/z_scene_proc.c b/src/code/z_scene_proc.c index 7c77d6cd5..bdd3ea1ad 100644 --- a/src/code/z_scene_proc.c +++ b/src/code/z_scene_proc.c @@ -1,8 +1,9 @@ +#include "prevent_bss_reordering.h" #include "global.h" -static s32 sMatAnimStep; -static u32 sMatAnimFlags; -static f32 sMatAnimAlphaRatio; +s32 sMatAnimStep; +u32 sMatAnimFlags; +f32 sMatAnimAlphaRatio; // Default displaylist that sets a valid displaylist into all of the segments. static Gfx sSceneDrawDefaultDL[] = { diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index e9de781c5..44a3d1ecc 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -416,9 +416,9 @@ void EnFsn_UpdateCursorPos(EnFsn* this, GlobalContext* globalCtx) { f32 yOffset = 17.0f; func_800B8898(globalCtx, &this->items[this->cursorIdx]->actor, &sp2E, &sp2C); - this->cursorX = sp2E + xOffset; - this->cursorY = sp2C + yOffset; - this->cursorZ = 1.2f; + this->cursorPos.x = sp2E + xOffset; + this->cursorPos.y = sp2C + yOffset; + this->cursorPos.z = 1.2f; } s32 EnFsn_FacingShopkeeperDialogResult(EnFsn* this, GlobalContext* globalCtx) { @@ -579,10 +579,10 @@ void EnFsn_UpdateCursorAnim(EnFsn* this) { this->cursorAnimState = 0; } } - this->cursorColorR = COL_CHAN_MIX(0, 0.0f, t); - this->cursorColorG = COL_CHAN_MIX(80, 80.0f, t); - this->cursorColorB = COL_CHAN_MIX(255, 0.0f, t); - this->cursorColorA = COL_CHAN_MIX(255, 0.0f, t); + this->cursorColor.r = COL_CHAN_MIX(0, 0.0f, t); + this->cursorColor.g = COL_CHAN_MIX(80, 80.0f, t); + this->cursorColor.b = COL_CHAN_MIX(255, 0.0f, t); + this->cursorColor.a = COL_CHAN_MIX(255, 0.0f, t); this->cursorAnimTween = t; } @@ -622,15 +622,15 @@ void EnFsn_UpdateStickDirectionPromptAnim(EnFsn* this) { this->stickAnimTween = stickAnimTween; - this->stickLeftPrompt.arrowColorR = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); - this->stickLeftPrompt.arrowColorG = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); - this->stickLeftPrompt.arrowColorB = COL_CHAN_MIX(0, -100, arrowAnimTween); - this->stickLeftPrompt.arrowColorA = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.r = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.g = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.b = COL_CHAN_MIX(0, -100, arrowAnimTween); + this->stickLeftPrompt.arrowColor.a = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); - this->stickRightPrompt.arrowColorR = (maxColor - ((s32)tmp)) & 0xFF; - this->stickRightPrompt.arrowColorG = (255 - ((s32)tmp)) & 0xFF; - this->stickRightPrompt.arrowColorB = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); - this->stickRightPrompt.arrowColorA = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.r = (maxColor - ((s32)tmp)) & 0xFF; + this->stickRightPrompt.arrowColor.g = (255 - ((s32)tmp)) & 0xFF; + this->stickRightPrompt.arrowColor.b = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.a = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); this->stickRightPrompt.arrowTexX = 290.0f; this->stickLeftPrompt.arrowTexX = 33.0f; @@ -652,45 +652,45 @@ void EnFsn_InitShop(EnFsn* this, GlobalContext* globalCtx) { EnFsn_SpawnShopItems(this, globalCtx); this2 = this; - this2->cursorX = 100.0f; - this2->cursorY = 100.0f; + this2->cursorPos.x = 100.0f; + this2->cursorPos.y = 100.0f; this2->stickAccumY = 0; this2->stickAccumX = 0; - this->cursorZ = 1.2f; - this->cursorColorR = 0; - this->cursorColorG = 80; - this->cursorColorB = maxColor; - this->cursorColorA = maxColor; + this->cursorPos.z = 1.2f; + this->cursorColor.r = 0; + this->cursorColor.g = 80; + this->cursorColor.b = maxColor; + this->cursorColor.a = maxColor; this->cursorAnimState = 0; this->drawCursor = 0; this->cursorAnimTween = 0.0f; - this->stickLeftPrompt.stickColorR = 200; - this->stickLeftPrompt.stickColorG = 200; - this->stickLeftPrompt.stickColorB = 200; - this->stickLeftPrompt.stickColorA = 180; + this->stickLeftPrompt.stickColor.r = 200; + this->stickLeftPrompt.stickColor.g = 200; + this->stickLeftPrompt.stickColor.b = 200; + this->stickLeftPrompt.stickColor.a = 180; this->stickLeftPrompt.stickTexX = 49.0f; this->stickLeftPrompt.stickTexY = 95.0f; - this->stickLeftPrompt.arrowColorR = maxColor; - this->stickLeftPrompt.arrowColorG = maxColor; - this->stickLeftPrompt.arrowColorB = 0; - this->stickLeftPrompt.arrowColorA = 200; + this->stickLeftPrompt.arrowColor.r = maxColor; + this->stickLeftPrompt.arrowColor.g = maxColor; + this->stickLeftPrompt.arrowColor.b = 0; + this->stickLeftPrompt.arrowColor.a = 200; this->stickLeftPrompt.arrowTexX = 33.0f; this->stickLeftPrompt.arrowTexY = 91.0f; this->stickLeftPrompt.texZ = 1.0f; this->stickLeftPrompt.isEnabled = 0; - this->stickRightPrompt.stickColorR = 200; - this->stickRightPrompt.stickColorG = 200; - this->stickRightPrompt.stickColorB = 200; - this->stickRightPrompt.stickColorA = 180; + this->stickRightPrompt.stickColor.r = 200; + this->stickRightPrompt.stickColor.g = 200; + this->stickRightPrompt.stickColor.b = 200; + this->stickRightPrompt.stickColor.a = 180; this->stickRightPrompt.stickTexX = 274.0f; this->stickRightPrompt.stickTexY = 95.0f; - this->stickRightPrompt.arrowColorR = maxColor; - this->stickRightPrompt.arrowColorG = 0; - this->stickRightPrompt.arrowColorB = 0; - this->stickRightPrompt.arrowColorA = 200; + this->stickRightPrompt.arrowColor.r = maxColor; + this->stickRightPrompt.arrowColor.g = 0; + this->stickRightPrompt.arrowColor.b = 0; + this->stickRightPrompt.arrowColor.a = 200; this->stickRightPrompt.arrowTexX = 290.0f; this->stickRightPrompt.arrowTexY = 91.0f; this->stickRightPrompt.texZ = 1.0f; @@ -1460,8 +1460,8 @@ void EnFsn_DrawCursor(EnFsn* this, GlobalContext* globalCtx, f32 x, f32 y, f32 z OPEN_DISPS(globalCtx->state.gfxCtx); if (drawCursor != 0) { func_8012C654(globalCtx->state.gfxCtx); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColorR, this->cursorColorG, this->cursorColorB, - this->cursorColorA); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, + this->cursorColor.a); gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); w = 16.0f * z; @@ -1520,14 +1520,14 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) { G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPSetTileSize(OVERLAY_DISP++, G_TX_RENDERTILE, 0, 0, 15 * 4, 23 * 4); if (drawStickRightPrompt) { - EnFsn_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColorR, this->stickLeftPrompt.arrowColorG, - this->stickLeftPrompt.arrowColorB, this->stickLeftPrompt.arrowColorA, + EnFsn_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColor.r, this->stickLeftPrompt.arrowColor.g, + this->stickLeftPrompt.arrowColor.b, this->stickLeftPrompt.arrowColor.a, this->stickLeftPrompt.arrowTexX, this->stickLeftPrompt.arrowTexY, this->stickLeftPrompt.texZ, 0, 0, -1.0f, 1.0f); } if (drawStickLeftPrompt) { - EnFsn_DrawTextRec(globalCtx, this->stickRightPrompt.arrowColorR, this->stickRightPrompt.arrowColorG, - this->stickRightPrompt.arrowColorB, this->stickRightPrompt.arrowColorA, + EnFsn_DrawTextRec(globalCtx, this->stickRightPrompt.arrowColor.r, this->stickRightPrompt.arrowColor.g, + this->stickRightPrompt.arrowColor.b, this->stickRightPrompt.arrowColor.a, this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } @@ -1541,14 +1541,14 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) { G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPSetTileSize(OVERLAY_DISP++, G_TX_RENDERTILE, 0, 0, 15 * 4, 15 * 4); if (drawStickRightPrompt) { - EnFsn_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColorR, this->stickLeftPrompt.stickColorG, - this->stickLeftPrompt.stickColorB, this->stickLeftPrompt.stickColorA, + EnFsn_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColor.r, this->stickLeftPrompt.stickColor.g, + this->stickLeftPrompt.stickColor.b, this->stickLeftPrompt.stickColor.a, this->stickLeftPrompt.stickTexX, this->stickLeftPrompt.stickTexY, this->stickLeftPrompt.texZ, 0, 0, -1.0f, 1.0f); } if (drawStickLeftPrompt) { - EnFsn_DrawTextRec(globalCtx, this->stickRightPrompt.stickColorR, this->stickRightPrompt.stickColorG, - this->stickRightPrompt.stickColorB, this->stickRightPrompt.stickColorA, + EnFsn_DrawTextRec(globalCtx, this->stickRightPrompt.stickColor.r, this->stickRightPrompt.stickColor.g, + this->stickRightPrompt.stickColor.b, this->stickRightPrompt.stickColor.a, this->stickRightPrompt.stickTexX, this->stickRightPrompt.stickTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } @@ -1626,7 +1626,7 @@ void EnFsn_Draw(Actor* thisx, GlobalContext* globalCtx) { this->items[i]->actor.scale.z = 0.2f; } - EnFsn_DrawCursor(this, globalCtx, this->cursorX, this->cursorY, this->cursorZ, this->drawCursor); + EnFsn_DrawCursor(this, globalCtx, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnFsn_DrawStickDirectionPrompts(this, globalCtx); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h index 94d1eed03..945bb0d76 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h @@ -51,13 +51,8 @@ typedef struct EnFsn { /* 0x39C */ s16 delayTimer; /* 0x3A0 */ s32 stickAccumX; /* 0x3A4 */ s32 stickAccumY; - /* 0x3A8 */ f32 cursorX; - /* 0x3AC */ f32 cursorY; - /* 0x3B0 */ f32 cursorZ; - /* 0x3B4 */ s32 cursorColorR; - /* 0x3B8 */ s32 cursorColorG; - /* 0x3BC */ s32 cursorColorB; - /* 0x3C0 */ s32 cursorColorA; + /* 0x3A8 */ Vec3f cursorPos; + /* 0x3B4 */ Color_RGBAu32 cursorColor; /* 0x3C4 */ f32 cursorAnimTween; /* 0x3C8 */ u8 cursorAnimState; /* 0x3C9 */ u8 drawCursor; diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index 6c362b372..5e3d1b136 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -115,16 +115,10 @@ extern const ActorInit En_GirlA_InitVars; #define COL_CHAN_MIX(c1, c2, m) (c1 - (s32)(c2 * m)) & 0xFF typedef struct { - /* 0x00 */ u32 stickColorR; - /* 0x04 */ u32 stickColorG; - /* 0x08 */ u32 stickColorB; - /* 0x0C */ u32 stickColorA; + /* 0x00 */ Color_RGBAu32 stickColor; /* 0x10 */ f32 stickTexX; /* 0x14 */ f32 stickTexY; - /* 0x18 */ u32 arrowColorR; - /* 0x1C */ u32 arrowColorG; - /* 0x20 */ u32 arrowColorB; - /* 0x24 */ u32 arrowColorA; + /* 0x18 */ Color_RGBAu32 arrowColor; /* 0x28 */ f32 arrowTexX; /* 0x2C */ f32 arrowTexY; /* 0x30 */ f32 texZ; // Used for both stickTexZ and arrowTexZ diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 9dc8c0bd3..d7f9e18bc 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -257,8 +257,8 @@ void EnOssan_UpdateCursorPos(GlobalContext* globalCtx, EnOssan* this) { s16 y; func_800B8898(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); - this->cursorX = x; - this->cursorY = y; + this->cursorPos.x = x; + this->cursorPos.y = y; } void EnOssan_EndInteraction(GlobalContext* globalCtx, EnOssan* this) { @@ -1232,10 +1232,10 @@ void EnOssan_UpdateCursorAnim(EnOssan* this) { this->cursorAnimState = 0; } } - this->cursorColorR = COL_CHAN_MIX(0, 0.0f, t); - this->cursorColorG = COL_CHAN_MIX(80, 80.0f, t); - this->cursorColorB = COL_CHAN_MIX(255, 0.0f, t); - this->cursorColorA = COL_CHAN_MIX(255, 0.0f, t); + this->cursorColor.r = COL_CHAN_MIX(0, 0.0f, t); + this->cursorColor.g = COL_CHAN_MIX(80, 80.0f, t); + this->cursorColor.b = COL_CHAN_MIX(255, 0.0f, t); + this->cursorColor.a = COL_CHAN_MIX(255, 0.0f, t); this->cursorAnimTween = t; } @@ -1277,15 +1277,15 @@ void EnOssan_UpdateStickDirectionPromptAnim(EnOssan* this) { this->stickAnimTween = stickAnimTween; - this->stickLeftPrompt.arrowColorR = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); - this->stickLeftPrompt.arrowColorG = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); - this->stickLeftPrompt.arrowColorB = COL_CHAN_MIX(0, -100, arrowAnimTween); - this->stickLeftPrompt.arrowColorA = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.r = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.g = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.b = COL_CHAN_MIX(0, -100, arrowAnimTween); + this->stickLeftPrompt.arrowColor.a = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); - this->stickRightPrompt.arrowColorR = (maxColor - ((s32)tmp)) & 0xFF; - this->stickRightPrompt.arrowColorG = (255 - ((s32)tmp)) & 0xFF; - this->stickRightPrompt.arrowColorB = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); - this->stickRightPrompt.arrowColorA = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.r = (maxColor - ((s32)tmp)) & 0xFF; + this->stickRightPrompt.arrowColor.g = (255 - ((s32)tmp)) & 0xFF; + this->stickRightPrompt.arrowColor.b = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.a = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); this->stickRightPrompt.arrowTexX = 290.0f; this->stickLeftPrompt.arrowTexX = 33.0f; @@ -1438,7 +1438,7 @@ void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx) { this->textId = sWelcomeHumanTextIds[this->actor.params]; EnOssan_GetCutscenes(this, globalCtx); - this->cursorY = this->cursorX = 100.0f; + this->cursorPos.y = this->cursorPos.x = 100.0f; this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED; this->cutscene = this->lookToShopkeeperCutscene; this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -1446,40 +1446,40 @@ void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx) { this->stickAccumX = this->stickAccumY = 0; this->cursorIdx = 0; - this->cursorZ = 1.5f; - this->cursorColorR = 0; - this->cursorColorG = 80; - this->cursorColorB = 255; - this->cursorColorA = 255; + this->cursorPos.z = 1.5f; + this->cursorColor.r = 0; + this->cursorColor.g = 80; + this->cursorColor.b = 255; + this->cursorColor.a = 255; this->cursorAnimTween = 0.0f; this->cursorAnimState = 0; this->drawCursor = 0; - this->stickLeftPrompt.stickColorR = 200; - this->stickLeftPrompt.stickColorG = 200; - this->stickLeftPrompt.stickColorB = 200; - this->stickLeftPrompt.stickColorA = 180; + this->stickLeftPrompt.stickColor.r = 200; + this->stickLeftPrompt.stickColor.g = 200; + this->stickLeftPrompt.stickColor.b = 200; + this->stickLeftPrompt.stickColor.a = 180; this->stickLeftPrompt.stickTexX = 49.0f; this->stickLeftPrompt.stickTexY = 95.0f; - this->stickLeftPrompt.arrowColorR = 255; - this->stickLeftPrompt.arrowColorG = 255; - this->stickLeftPrompt.arrowColorB = 0; - this->stickLeftPrompt.arrowColorA = 200; + this->stickLeftPrompt.arrowColor.r = 255; + this->stickLeftPrompt.arrowColor.g = 255; + this->stickLeftPrompt.arrowColor.b = 0; + this->stickLeftPrompt.arrowColor.a = 200; this->stickLeftPrompt.arrowTexX = 33.0f; this->stickLeftPrompt.arrowTexY = 91.0f; this->stickLeftPrompt.texZ = 1.0f; this->stickLeftPrompt.isEnabled = false; - this->stickRightPrompt.stickColorR = 200; - this->stickRightPrompt.stickColorG = 200; - this->stickRightPrompt.stickColorB = 200; - this->stickRightPrompt.stickColorA = 180; + this->stickRightPrompt.stickColor.r = 200; + this->stickRightPrompt.stickColor.g = 200; + this->stickRightPrompt.stickColor.b = 200; + this->stickRightPrompt.stickColor.a = 180; this->stickRightPrompt.stickTexX = 274.0f; this->stickRightPrompt.stickTexY = 95.0f; - this->stickRightPrompt.arrowColorR = 255; - this->stickRightPrompt.arrowColorG = 255; - this->stickRightPrompt.arrowColorB = 0; - this->stickRightPrompt.arrowColorA = 200; + this->stickRightPrompt.arrowColor.r = 255; + this->stickRightPrompt.arrowColor.g = 255; + this->stickRightPrompt.arrowColor.b = 0; + this->stickRightPrompt.arrowColor.a = 200; this->stickRightPrompt.arrowTexX = 290.0f; this->stickRightPrompt.arrowTexY = 91.0f; this->stickRightPrompt.texZ = 1.0f; @@ -1537,8 +1537,8 @@ void EnOssan_DrawCursor(GlobalContext* globalCtx, EnOssan* this, f32 x, f32 y, f OPEN_DISPS(globalCtx->state.gfxCtx); if (drawCursor != 0) { func_8012C654(globalCtx->state.gfxCtx); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColorR, this->cursorColorG, this->cursorColorB, - this->cursorColorA); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, + this->cursorColor.a); gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); w = 16.0f * z; @@ -1601,14 +1601,14 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this) G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPSetTileSize(OVERLAY_DISP++, G_TX_RENDERTILE, 0, 0, 15 * 4, 23 * 4); if (drawStickRightPrompt) { - EnOssan_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColorR, this->stickLeftPrompt.arrowColorG, - this->stickLeftPrompt.arrowColorB, this->stickLeftPrompt.arrowColorA, + EnOssan_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColor.r, this->stickLeftPrompt.arrowColor.g, + this->stickLeftPrompt.arrowColor.b, this->stickLeftPrompt.arrowColor.a, this->stickLeftPrompt.arrowTexX, this->stickLeftPrompt.arrowTexY, this->stickLeftPrompt.texZ, 0, 0, -1.0f, 1.0f); } if (drawStickLeftPrompt) { - EnOssan_DrawTextRec(globalCtx, this->stickRightPrompt.arrowColorR, this->stickRightPrompt.arrowColorG, - this->stickRightPrompt.arrowColorB, this->stickRightPrompt.arrowColorA, + EnOssan_DrawTextRec(globalCtx, this->stickRightPrompt.arrowColor.r, this->stickRightPrompt.arrowColor.g, + this->stickRightPrompt.arrowColor.b, this->stickRightPrompt.arrowColor.a, this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } @@ -1622,14 +1622,14 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this) G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPSetTileSize(OVERLAY_DISP++, G_TX_RENDERTILE, 0, 0, 15 * 4, 15 * 4); if (drawStickRightPrompt) { - EnOssan_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColorR, this->stickLeftPrompt.stickColorG, - this->stickLeftPrompt.stickColorB, this->stickLeftPrompt.stickColorA, + EnOssan_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColor.r, this->stickLeftPrompt.stickColor.g, + this->stickLeftPrompt.stickColor.b, this->stickLeftPrompt.stickColor.a, this->stickLeftPrompt.stickTexX, this->stickLeftPrompt.stickTexY, this->stickLeftPrompt.texZ, 0, 0, -1.0f, 1.0f); } if (drawStickLeftPrompt) { - EnOssan_DrawTextRec(globalCtx, this->stickRightPrompt.stickColorR, this->stickRightPrompt.stickColorG, - this->stickRightPrompt.stickColorB, this->stickRightPrompt.stickColorA, + EnOssan_DrawTextRec(globalCtx, this->stickRightPrompt.stickColor.r, this->stickRightPrompt.stickColor.g, + this->stickRightPrompt.stickColor.b, this->stickRightPrompt.stickColor.a, this->stickRightPrompt.stickTexX, this->stickRightPrompt.stickTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } @@ -1688,7 +1688,7 @@ void EnOssan_DrawCuriosityShopMan(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex])); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, EnOssan_OverrideLimbDrawCuriosityShopMan, EnOssan_PostLimbDrawCuriosityShopMan, &this->actor); - EnOssan_DrawCursor(globalCtx, this, this->cursorX, this->cursorY, this->cursorZ, this->drawCursor); + EnOssan_DrawCursor(globalCtx, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnOssan_DrawStickDirectionPrompts(globalCtx, this); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -1703,7 +1703,7 @@ void EnOssan_DrawPartTimeWorker(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex])); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, EnOssan_OverrideLimbDrawPartTimeWorker, EnOssan_PostLimbDrawPartTimeWorker, &this->actor); - EnOssan_DrawCursor(globalCtx, this, this->cursorX, this->cursorY, this->cursorZ, this->drawCursor); + EnOssan_DrawCursor(globalCtx, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnOssan_DrawStickDirectionPrompts(globalCtx, this); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 3893e63f0..689d352cf 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -26,13 +26,8 @@ typedef struct EnOssan { /* 0x20C */ s32 stickAccumY; /* 0x210 */ u8 moveHorizontal; /* 0x211 */ u8 moveVertical; - /* 0x214 */ f32 cursorX; - /* 0x218 */ f32 cursorY; - /* 0x21C */ f32 cursorZ; - /* 0x220 */ u32 cursorColorR; - /* 0x224 */ u32 cursorColorG; - /* 0x228 */ u32 cursorColorB; - /* 0x22C */ u32 cursorColorA; + /* 0x214 */ Vec3f cursorPos; + /* 0x220 */ Color_RGBAu32 cursorColor; /* 0x230 */ f32 cursorAnimTween; /* 0x234 */ u8 cursorAnimState; /* 0x235 */ u8 drawCursor; diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index 51b80b96b..6473c327a 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -437,9 +437,9 @@ void EnSob1_UpdateCursorPos(GlobalContext* globalCtx, EnSob1* this) { f32 yOffset = 17.0f; func_800B8898(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); - this->cursorX = x + xOffset; - this->cursorY = y + yOffset; - this->cursorZ = 1.2f; + this->cursorPos.x = x + xOffset; + this->cursorPos.y = y + yOffset; + this->cursorPos.z = 1.2f; } void EnSob1_EndInteraction(GlobalContext* globalCtx, EnSob1* this) { @@ -1196,10 +1196,10 @@ void EnSob1_UpdateCursorAnim(EnSob1* this) { this->cursorAnimState = 0; } } - this->cursorColorR = COL_CHAN_MIX(0, 0.0f, t); - this->cursorColorG = COL_CHAN_MIX(80, 80.0f, t); - this->cursorColorB = COL_CHAN_MIX(255, 0.0f, t); - this->cursorColorA = COL_CHAN_MIX(255, 0.0f, t); + this->cursorColor.r = COL_CHAN_MIX(0, 0.0f, t); + this->cursorColor.g = COL_CHAN_MIX(80, 80.0f, t); + this->cursorColor.b = COL_CHAN_MIX(255, 0.0f, t); + this->cursorColor.a = COL_CHAN_MIX(255, 0.0f, t); this->cursorAnimTween = t; } @@ -1241,15 +1241,15 @@ void EnSob1_UpdateStickDirectionPromptAnim(EnSob1* this) { this->stickAnimTween = stickAnimTween; - this->stickLeftPrompt.arrowColorR = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); - this->stickLeftPrompt.arrowColorG = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); - this->stickLeftPrompt.arrowColorB = COL_CHAN_MIX(0, -100, arrowAnimTween); - this->stickLeftPrompt.arrowColorA = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.r = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.g = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.b = COL_CHAN_MIX(0, -100, arrowAnimTween); + this->stickLeftPrompt.arrowColor.a = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); - this->stickRightPrompt.arrowColorR = (maxColor - ((s32)tmp)) & 0xFF; - this->stickRightPrompt.arrowColorG = (255 - ((s32)tmp)) & 0xFF; - this->stickRightPrompt.arrowColorB = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); - this->stickRightPrompt.arrowColorA = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.r = (maxColor - ((s32)tmp)) & 0xFF; + this->stickRightPrompt.arrowColor.g = (255 - ((s32)tmp)) & 0xFF; + this->stickRightPrompt.arrowColor.b = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.a = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); this->stickRightPrompt.arrowTexX = 290.0f; this->stickLeftPrompt.arrowTexX = 33.0f; @@ -1402,30 +1402,30 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) { EnSob1_SetupAction(this, EnSob1_Idle); } - this->cursorY = (this->cursorX = 100.0f); + this->cursorPos.y = (this->cursorPos.x = 100.0f); this->stickAccumX = (this->stickAccumY = 0); this->cursorIdx = 0; - this->cursorZ = 1.2f; - this->cursorColorR = 0; - this->cursorColorG = 80; - this->cursorColorB = maxColor; - this->cursorColorA = maxColor; + this->cursorPos.z = 1.2f; + this->cursorColor.r = 0; + this->cursorColor.g = 80; + this->cursorColor.b = maxColor; + this->cursorColor.a = maxColor; this->cursorAnimTween = 0.0f; this->cursorAnimState = 0; this->drawCursor = 0; this2 = this; - this2->stickLeftPrompt.stickColorR = 200; - this2->stickLeftPrompt.stickColorG = 200; - this2->stickLeftPrompt.stickColorB = 200; - this2->stickLeftPrompt.stickColorA = 180; + this2->stickLeftPrompt.stickColor.r = 200; + this2->stickLeftPrompt.stickColor.g = 200; + this2->stickLeftPrompt.stickColor.b = 200; + this2->stickLeftPrompt.stickColor.a = 180; this2->stickLeftPrompt.stickTexX = 49.0f; this2->stickLeftPrompt.stickTexY = 95.0f; - this2->stickLeftPrompt.arrowColorR = maxColor; - this2->stickLeftPrompt.arrowColorG = maxColor; - this2->stickLeftPrompt.arrowColorB = 0; - this2->stickLeftPrompt.arrowColorA = 200; + this2->stickLeftPrompt.arrowColor.r = maxColor; + this2->stickLeftPrompt.arrowColor.g = maxColor; + this2->stickLeftPrompt.arrowColor.b = 0; + this2->stickLeftPrompt.arrowColor.a = 200; this2->stickLeftPrompt.arrowTexX = 33.0f; this2->stickLeftPrompt.arrowTexY = 91.0f; this2->stickLeftPrompt.texZ = 1.0f; @@ -1433,16 +1433,16 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) { if (1) {} - this2->stickRightPrompt.stickColorR = 200; - this2->stickRightPrompt.stickColorG = 200; - this2->stickRightPrompt.stickColorB = 200; - this2->stickRightPrompt.stickColorA = 180; + this2->stickRightPrompt.stickColor.r = 200; + this2->stickRightPrompt.stickColor.g = 200; + this2->stickRightPrompt.stickColor.b = 200; + this2->stickRightPrompt.stickColor.a = 180; this2->stickRightPrompt.stickTexX = 274.0f; this2->stickRightPrompt.stickTexY = 95.0f; - this2->stickRightPrompt.arrowColorR = maxColor; - this2->stickRightPrompt.arrowColorG = 0; - this2->stickRightPrompt.arrowColorB = 0; - this2->stickRightPrompt.arrowColorA = 200; + this2->stickRightPrompt.arrowColor.r = maxColor; + this2->stickRightPrompt.arrowColor.g = 0; + this2->stickRightPrompt.arrowColor.b = 0; + this2->stickRightPrompt.arrowColor.a = 200; this2->stickRightPrompt.arrowTexX = 290.0f; this2->stickRightPrompt.arrowTexY = 91.0f; this2->stickRightPrompt.texZ = 1.0f; @@ -1498,8 +1498,8 @@ void EnSob1_DrawCursor(GlobalContext* globalCtx, EnSob1* this, f32 x, f32 y, f32 OPEN_DISPS(globalCtx->state.gfxCtx); if (drawCursor != 0) { func_8012C654(globalCtx->state.gfxCtx); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColorR, this->cursorColorG, this->cursorColorB, - this->cursorColorA); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, + this->cursorColor.a); gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); w = 16.0f * z; @@ -1562,14 +1562,14 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) { G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPSetTileSize(OVERLAY_DISP++, G_TX_RENDERTILE, 0, 0, 15 * 4, 23 * 4); if (drawStickRightPrompt) { - EnSob1_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColorR, this->stickLeftPrompt.arrowColorG, - this->stickLeftPrompt.arrowColorB, this->stickLeftPrompt.arrowColorA, + EnSob1_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColor.r, this->stickLeftPrompt.arrowColor.g, + this->stickLeftPrompt.arrowColor.b, this->stickLeftPrompt.arrowColor.a, this->stickLeftPrompt.arrowTexX, this->stickLeftPrompt.arrowTexY, this->stickLeftPrompt.texZ, 0, 0, -1.0f, 1.0f); } if (drawStickLeftPrompt) { - EnSob1_DrawTextRec(globalCtx, this->stickRightPrompt.arrowColorR, this->stickRightPrompt.arrowColorG, - this->stickRightPrompt.arrowColorB, this->stickRightPrompt.arrowColorA, + EnSob1_DrawTextRec(globalCtx, this->stickRightPrompt.arrowColor.r, this->stickRightPrompt.arrowColor.g, + this->stickRightPrompt.arrowColor.b, this->stickRightPrompt.arrowColor.a, this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } @@ -1583,14 +1583,14 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) { G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPSetTileSize(OVERLAY_DISP++, G_TX_RENDERTILE, 0, 0, 15 * 4, 15 * 4); if (drawStickRightPrompt) { - EnSob1_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColorR, this->stickLeftPrompt.stickColorG, - this->stickLeftPrompt.stickColorB, this->stickLeftPrompt.stickColorA, + EnSob1_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColor.r, this->stickLeftPrompt.stickColor.g, + this->stickLeftPrompt.stickColor.b, this->stickLeftPrompt.stickColor.a, this->stickLeftPrompt.stickTexX, this->stickLeftPrompt.stickTexY, this->stickLeftPrompt.texZ, 0, 0, -1.0f, 1.0f); } if (drawStickLeftPrompt) { - EnSob1_DrawTextRec(globalCtx, this->stickRightPrompt.stickColorR, this->stickRightPrompt.stickColorG, - this->stickRightPrompt.stickColorB, this->stickRightPrompt.stickColorA, + EnSob1_DrawTextRec(globalCtx, this->stickRightPrompt.stickColor.r, this->stickRightPrompt.stickColor.g, + this->stickRightPrompt.stickColor.b, this->stickRightPrompt.stickColor.a, this->stickRightPrompt.stickTexX, this->stickRightPrompt.stickTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } @@ -1654,7 +1654,7 @@ void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx) { this->items[i]->actor.scale.y = 0.2f; this->items[i]->actor.scale.z = 0.2f; } - EnSob1_DrawCursor(globalCtx, this, this->cursorX, this->cursorY, this->cursorZ, this->drawCursor); + EnSob1_DrawCursor(globalCtx, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnSob1_DrawStickDirectionPrompt(globalCtx, this); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -1675,7 +1675,7 @@ void EnSob1_DrawGoronShopkeeper(Actor* thisx, GlobalContext* globalCtx) { this->items[i]->actor.scale.y = 0.2f; this->items[i]->actor.scale.z = 0.2f; } - EnSob1_DrawCursor(globalCtx, this, this->cursorX, this->cursorY, this->cursorZ, this->drawCursor); + EnSob1_DrawCursor(globalCtx, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnSob1_DrawStickDirectionPrompt(globalCtx, this); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -1696,7 +1696,7 @@ void EnSob1_DrawBombShopkeeper(Actor* thisx, GlobalContext* globalCtx) { this->items[i]->actor.scale.y = 0.2f; this->items[i]->actor.scale.z = 0.2f; } - EnSob1_DrawCursor(globalCtx, this, this->cursorX, this->cursorY, this->cursorZ, this->drawCursor); + EnSob1_DrawCursor(globalCtx, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnSob1_DrawStickDirectionPrompt(globalCtx, this); frames = globalCtx->gameplayFrames; func_8012C2DC(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h index 4476cad95..a7f8262fe 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h @@ -40,13 +40,8 @@ typedef struct EnSob1 { /* 0x2EC */ EnGirlA* items[3]; // Items on shelf are indexed as: /* 2 1 0 */ /* 0x2F8 */ s32 stickAccumX; /* 0x2FC */ s32 stickAccumY; - /* 0x300 */ f32 cursorX; - /* 0x304 */ f32 cursorY; - /* 0x308 */ f32 cursorZ; - /* 0x30C */ s32 cursorColorR; - /* 0x310 */ s32 cursorColorG; - /* 0x314 */ s32 cursorColorB; - /* 0x318 */ s32 cursorColorA; + /* 0x300 */ Vec3f cursorPos; + /* 0x30C */ Color_RGBAu32 cursorColor; /* 0x31C */ f32 cursorAnimTween; /* 0x320 */ u8 cursorAnimState; /* 0x321 */ u8 drawCursor; diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index 215455fdc..dde048caf 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -160,9 +160,9 @@ void EnTrt_UpdateCursorPos(GlobalContext* globalCtx, EnTrt* this) { f32 yOffset = 17.0f; func_800B8898(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); - this->cursorX = x + xOffset; - this->cursorY = y + yOffset; - this->cursorZ = 1.2f; + this->cursorPos.x = x + xOffset; + this->cursorPos.y = y + yOffset; + this->cursorPos.z = 1.2f; } void EnTrt_SetupGetMushroomCutscene(EnTrt* this) { @@ -1221,10 +1221,10 @@ void EnTrt_UpdateCursorAnim(EnTrt* this) { this->cursorAnimState = 0; } } - this->cursorColorR = COL_CHAN_MIX(0, 0.0f, t); - this->cursorColorG = COL_CHAN_MIX(80, 80.0f, t); - this->cursorColorB = COL_CHAN_MIX(255, 0.0f, t); - this->cursorColorA = COL_CHAN_MIX(255, 0.0f, t); + this->cursorColor.r = COL_CHAN_MIX(0, 0.0f, t); + this->cursorColor.g = COL_CHAN_MIX(80, 80.0f, t); + this->cursorColor.b = COL_CHAN_MIX(255, 0.0f, t); + this->cursorColor.a = COL_CHAN_MIX(255, 0.0f, t); this->cursorAnimTween = t; } @@ -1266,15 +1266,15 @@ void EnTrt_UpdateStickDirectionPromptAnim(EnTrt* this) { this->stickAnimTween = stickAnimTween; - this->stickLeftPrompt.arrowColorR = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); - this->stickLeftPrompt.arrowColorG = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); - this->stickLeftPrompt.arrowColorB = COL_CHAN_MIX(0, -100, arrowAnimTween); - this->stickLeftPrompt.arrowColorA = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.r = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.g = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); + this->stickLeftPrompt.arrowColor.b = COL_CHAN_MIX(0, -100, arrowAnimTween); + this->stickLeftPrompt.arrowColor.a = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); - this->stickRightPrompt.arrowColorR = (maxColor - ((s32)tmp)) & 0xFF; - this->stickRightPrompt.arrowColorG = (255 - ((s32)tmp)) & 0xFF; - this->stickRightPrompt.arrowColorB = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); - this->stickRightPrompt.arrowColorA = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.r = (maxColor - ((s32)tmp)) & 0xFF; + this->stickRightPrompt.arrowColor.g = (255 - ((s32)tmp)) & 0xFF; + this->stickRightPrompt.arrowColor.b = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.a = COL_CHAN_MIX(200, 50.0f, arrowAnimTween); this->stickRightPrompt.arrowTexX = 290.0f; this->stickLeftPrompt.arrowTexX = 33.0f; @@ -1483,28 +1483,28 @@ void EnTrt_InitShop(EnTrt* this, GlobalContext* globalCtx) { this->stickAccumY = 0; this->stickAccumX = 0; this->cursorIdx = 0; - this->cursorY = this->cursorX = 100.0f; - this->cursorZ = 1.2f; - this->cursorColorR = 0; - this->cursorColorG = 80; - this->cursorColorB = maxcolor; - this->cursorColorA = maxcolor; + this->cursorPos.y = this->cursorPos.x = 100.0f; + this->cursorPos.z = 1.2f; + this->cursorColor.r = 0; + this->cursorColor.g = 80; + this->cursorColor.b = maxcolor; + this->cursorColor.a = maxcolor; this->cursorAnimTween = 0.0f; this->cursorAnimState = 0; this->drawCursor = 0; this2 = this; - this->stickLeftPrompt.stickColorR = 200; - this2->stickLeftPrompt.stickColorG = 200; - this2->stickLeftPrompt.stickColorB = 200; - this2->stickLeftPrompt.stickColorA = 180; + this->stickLeftPrompt.stickColor.r = 200; + this2->stickLeftPrompt.stickColor.g = 200; + this2->stickLeftPrompt.stickColor.b = 200; + this2->stickLeftPrompt.stickColor.a = 180; this2->stickLeftPrompt.stickTexX = 49.0f; this2->stickLeftPrompt.stickTexY = 95.0f; - this2->stickLeftPrompt.arrowColorR = maxcolor; - this2->stickLeftPrompt.arrowColorG = maxcolor; - this2->stickLeftPrompt.arrowColorB = 0; - this2->stickLeftPrompt.arrowColorA = 200; + this2->stickLeftPrompt.arrowColor.r = maxcolor; + this2->stickLeftPrompt.arrowColor.g = maxcolor; + this2->stickLeftPrompt.arrowColor.b = 0; + this2->stickLeftPrompt.arrowColor.a = 200; this2->stickLeftPrompt.arrowTexX = 33.0f; this2->stickLeftPrompt.arrowTexY = 91.0f; this2->stickLeftPrompt.texZ = 1.0f; @@ -1512,16 +1512,16 @@ void EnTrt_InitShop(EnTrt* this, GlobalContext* globalCtx) { if (1) {} - this2->stickRightPrompt.stickColorR = 200; - this2->stickRightPrompt.stickColorG = 200; - this2->stickRightPrompt.stickColorB = 200; - this2->stickRightPrompt.stickColorA = 180; + this2->stickRightPrompt.stickColor.r = 200; + this2->stickRightPrompt.stickColor.g = 200; + this2->stickRightPrompt.stickColor.b = 200; + this2->stickRightPrompt.stickColor.a = 180; this2->stickRightPrompt.stickTexX = 274.0f; this2->stickRightPrompt.stickTexY = 95.0f; - this2->stickRightPrompt.arrowColorR = maxcolor; - this2->stickRightPrompt.arrowColorG = 0; - this2->stickRightPrompt.arrowColorB = 0; - this2->stickRightPrompt.arrowColorA = 200; + this2->stickRightPrompt.arrowColor.r = maxcolor; + this2->stickRightPrompt.arrowColor.g = 0; + this2->stickRightPrompt.arrowColor.b = 0; + this2->stickRightPrompt.arrowColor.a = 200; this2->stickRightPrompt.arrowTexX = 290.0f; this2->stickRightPrompt.arrowTexY = 91.0f; this2->stickRightPrompt.texZ = 1.0f; @@ -1562,8 +1562,8 @@ void EnTrt_DrawCursor(GlobalContext* globalCtx, EnTrt* this, f32 x, f32 y, f32 z OPEN_DISPS(globalCtx->state.gfxCtx); if (drawCursor != 0) { func_8012C654(globalCtx->state.gfxCtx); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColorR, this->cursorColorG, this->cursorColorB, - this->cursorColorA); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, + this->cursorColor.a); gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); w = 16.0f * z; @@ -1626,14 +1626,14 @@ void EnTrt_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnTrt* this) { G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPSetTileSize(OVERLAY_DISP++, G_TX_RENDERTILE, 0, 0, 15 * 4, 23 * 4); if (drawStickRightPrompt) { - EnTrt_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColorR, this->stickLeftPrompt.arrowColorG, - this->stickLeftPrompt.arrowColorB, this->stickLeftPrompt.arrowColorA, + EnTrt_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColor.r, this->stickLeftPrompt.arrowColor.g, + this->stickLeftPrompt.arrowColor.b, this->stickLeftPrompt.arrowColor.a, this->stickLeftPrompt.arrowTexX, this->stickLeftPrompt.arrowTexY, this->stickLeftPrompt.texZ, 0, 0, -1.0f, 1.0f); } if (drawStickLeftPrompt) { - EnTrt_DrawTextRec(globalCtx, this->stickRightPrompt.arrowColorR, this->stickRightPrompt.arrowColorG, - this->stickRightPrompt.arrowColorB, this->stickRightPrompt.arrowColorA, + EnTrt_DrawTextRec(globalCtx, this->stickRightPrompt.arrowColor.r, this->stickRightPrompt.arrowColor.g, + this->stickRightPrompt.arrowColor.b, this->stickRightPrompt.arrowColor.a, this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } @@ -1647,14 +1647,14 @@ void EnTrt_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnTrt* this) { G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPSetTileSize(OVERLAY_DISP++, G_TX_RENDERTILE, 0, 0, 15 * 4, 15 * 4); if (drawStickRightPrompt) { - EnTrt_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColorR, this->stickLeftPrompt.stickColorG, - this->stickLeftPrompt.stickColorB, this->stickLeftPrompt.stickColorA, + EnTrt_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColor.r, this->stickLeftPrompt.stickColor.g, + this->stickLeftPrompt.stickColor.b, this->stickLeftPrompt.stickColor.a, this->stickLeftPrompt.stickTexX, this->stickLeftPrompt.stickTexY, this->stickLeftPrompt.texZ, 0, 0, -1.0f, 1.0f); } if (drawStickLeftPrompt) { - EnTrt_DrawTextRec(globalCtx, this->stickRightPrompt.stickColorR, this->stickRightPrompt.stickColorG, - this->stickRightPrompt.stickColorB, this->stickRightPrompt.stickColorA, + EnTrt_DrawTextRec(globalCtx, this->stickRightPrompt.stickColor.r, this->stickRightPrompt.stickColor.g, + this->stickRightPrompt.stickColor.b, this->stickRightPrompt.stickColor.a, this->stickRightPrompt.stickTexX, this->stickRightPrompt.stickTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } @@ -1791,7 +1791,7 @@ void EnTrt_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTextureIdx])); func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, EnTrt_OverrideLimbDraw, EnTrt_PostLimbDraw, EnTrt_UnkActorDraw, &this->actor); - EnTrt_DrawCursor(globalCtx, this, this->cursorX, this->cursorY, this->cursorZ, this->drawCursor); + EnTrt_DrawCursor(globalCtx, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnTrt_DrawStickDirectionPrompt(globalCtx, this); CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.h b/src/overlays/actors/ovl_En_Trt/z_en_trt.h index a83d841ef..2df343dfc 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.h +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.h @@ -37,13 +37,8 @@ typedef struct EnTrt { /* 0x3DC */ EnTrtBlinkFunc blinkFunc; /* 0x3E0 */ s16 cutscene; /* 0x3E2 */ s16 tmpGetMushroomCutscene; - /* 0x3E4 */ f32 cursorX; - /* 0x3E8 */ f32 cursorY; - /* 0x3EC */ f32 cursorZ; - /* 0x3F0 */ s32 cursorColorR; - /* 0x3F4 */ s32 cursorColorG; - /* 0x3F8 */ s32 cursorColorB; - /* 0x3FC */ s32 cursorColorA; + /* 0x3E4 */ Vec3f cursorPos; + /* 0x3F0 */ Color_RGBAu32 cursorColor; /* 0x400 */ u8 drawCursor; /* 0x402 */ s16 timer; /* 0x404 */ s16 animationIdx; |
