From 984a5061c2df123296e649a0fc34874c845e7e29 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Thu, 24 Mar 2022 19:14:14 -0700 Subject: [PATCH] ObjectFsn documented (#680) * Cleanup some shopkeepers * More cleanup * Document animations * General cleanup * Animation enums * Limb maxes * More Cleanup * Some more minor stuff * fsn cutscene state * Parens and postlimbdraw * Ossan Limbs * Remove ENFSN_LIMB_MAX * SI_MAX * Compound macro * Document gameplayKeep textures used by shopkeepers * Ani Limbs in Ossan * Format * PR suggestion * Remove trueTmp from EnFsn --- assets/xml/objects/gameplay_keep.xml | 6 +- assets/xml/objects/object_fsn.xml | 164 ++++++---- src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 289 +++++++++-------- src/overlays/actors/ovl_En_Fsn/z_en_fsn.h | 7 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 28 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.h | 7 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 302 ++++++++++-------- src/overlays/actors/ovl_En_Ossan/z_en_ossan.h | 17 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 231 +++++++------- .../actors/ovl_En_Suttari/z_en_suttari.c | 114 +++---- .../actors/ovl_En_Suttari/z_en_suttari.h | 2 +- src/overlays/actors/ovl_En_Trt/z_en_trt.c | 169 +++++----- src/overlays/actors/ovl_En_Trt/z_en_trt.h | 2 +- tools/disasm/functions.txt | 40 +-- 14 files changed, 726 insertions(+), 652 deletions(-) diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml index ef31ca7b76..856e3d92bd 100644 --- a/assets/xml/objects/gameplay_keep.xml +++ b/assets/xml/objects/gameplay_keep.xml @@ -873,9 +873,9 @@ - - - + + + diff --git a/assets/xml/objects/object_fsn.xml b/assets/xml/objects/object_fsn.xml index 7c3d0beb2a..f90bf4e4d0 100644 --- a/assets/xml/objects/object_fsn.xml +++ b/assets/xml/objects/object_fsn.xml @@ -1,63 +1,111 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 31a7046cbb..cd4b3884f7 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -5,7 +5,6 @@ */ #include "z_en_fsn.h" -#include "objects/object_fsn/object_fsn.h" #include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10) @@ -47,6 +46,29 @@ void EnFsn_SelectItem(EnFsn* this, GlobalContext* globalCtx); void EnFsn_LookToShopkeeperFromShelf(EnFsn* this, GlobalContext* globalCtx); void EnFsn_PlayerCannotBuy(EnFsn* this, GlobalContext* globalCtx); +typedef enum { + /* 0 */ ENFSN_CUTSCENESTATE_STOPPED, + /* 1 */ ENFSN_CUTSCENESTATE_WAITING, + /* 2 */ ENFSN_CUTSCENESTATE_PLAYING +} EnFsnCutsceneState; + +typedef enum { + /* 00 */ FSN_ANIMATION_IDLE, + /* 01 */ FSN_ANIMATION_SCRATCH_BACK, + /* 02 */ FSN_ANIMATION_TURN_AROUND_FORWARD, + /* 03 */ FSN_ANIMATION_TURN_AROUND_REVERSE, + /* 04 */ FSN_ANIMATION_HANDS_ON_COUNTER_START, + /* 05 */ FSN_ANIMATION_HANDS_ON_COUNTER_LOOP, + /* 06 */ FSN_ANIMATION_HAND_ON_FACE_START, + /* 07 */ FSN_ANIMATION_HAND_ON_FACE_LOOP, + /* 08 */ FSN_ANIMATION_LEAN_FORWARD_START, + /* 09 */ FSN_ANIMATION_LEAN_FORWARD_LOOP, + /* 10 */ FSN_ANIMATION_SLAM_COUNTER_START, + /* 11 */ FSN_ANIMATION_SLAM_COUNTER_LOOP, + /* 12 */ FSN_ANIMATION_MAKE_OFFER, + /* 13 */ FSN_ANIMATION_MAX +} FsnAnimation; + const ActorInit En_Fsn_InitVars = { ACTOR_EN_FSN, ACTORCAT_NPC, @@ -60,19 +82,19 @@ const ActorInit En_Fsn_InitVars = { }; static AnimationInfoS sAnimations[] = { - { &object_fsn_Anim_012C34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_0131FC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_00C58C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00C58C, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00F00C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00D354, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_0138B0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_01430C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00C26C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_00DE34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnScratchBackAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnTurnAroundAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnHandsOnCounterStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnHandsOnCounterLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnHandOnFaceStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnHandOnFaceLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnLeanForwardStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnLeanForwardLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnSlamCounterStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnSlamCounterLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnMakeOfferAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; static ColliderCylinderInit sCylinderInit = { @@ -187,7 +209,8 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_HandleSetupResumeInteraction(EnFsn* this, GlobalContext* globalCtx) { - if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx) && this->cutsceneState == 0) { + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx) && + this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); if (ENFSN_IS_SHOP(&this->actor)) { @@ -205,19 +228,19 @@ void EnFsn_UpdateCollider(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_HandleLookToShopkeeperBuyingCutscene(EnFsn* this) { - if (this->cutsceneState == 2 && this->lookToShopkeeperBuyingCutscene != this->cutscene && - this->actor.textId == 0x29CE) { + if ((this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) && + (this->lookToShopkeeperBuyingCutscene != this->cutscene) && (this->actor.textId == 0x29CE)) { ActorCutscene_Stop(this->cutscene); if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); } this->cutscene = this->lookToShopkeeperBuyingCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); - this->cutsceneState = 1; - } else if (this->cutsceneState == 1) { + this->cutsceneState = ENFSN_CUTSCENESTATE_WAITING; + } else if (this->cutsceneState == ENFSN_CUTSCENESTATE_WAITING) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_Start(this->cutscene, &this->actor); - this->cutsceneState = 2; + this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; } else { ActorCutscene_SetIntentToPlay(this->cutscene); } @@ -362,9 +385,9 @@ void EnFsn_SpawnShopItems(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_EndInteraction(EnFsn* this, GlobalContext* globalCtx) { - if (this->cutsceneState == 2) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { ActorCutscene_Stop(this->cutscene); - this->cutsceneState = 0; + this->cutsceneState = ENFSN_CUTSCENESTATE_STOPPED; } Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); globalCtx->msgCtx.msgMode = 0x43; @@ -400,14 +423,14 @@ s32 EnFsn_TestCancelOption(EnFsn* this, GlobalContext* globalCtx, Input* input) } void EnFsn_UpdateCursorPos(EnFsn* this, GlobalContext* globalCtx) { - s16 sp2E; - s16 sp2C; + s16 x; + s16 y; f32 xOffset = 0.0f; f32 yOffset = 17.0f; - Actor_GetScreenPos(globalCtx, &this->items[this->cursorIdx]->actor, &sp2E, &sp2C); - this->cursorPos.x = sp2E + xOffset; - this->cursorPos.y = sp2C + yOffset; + Actor_GetScreenPos(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); + this->cursorPos.x = x + xOffset; + this->cursorPos.y = y + yOffset; this->cursorPos.z = 1.2f; } @@ -579,8 +602,7 @@ void EnFsn_UpdateCursorAnim(EnFsn* this) { void EnFsn_UpdateStickDirectionPromptAnim(EnFsn* this) { f32 arrowAnimTween = this->arrowAnimTween; f32 stickAnimTween = this->stickAnimTween; - s32 maxColor = 255; - f32 tmp; + s32 maxColor = 255; // POSSIBLY FAKE if (this->arrowAnimState == 0) { arrowAnimTween += 0.05f; @@ -607,54 +629,51 @@ void EnFsn_UpdateStickDirectionPromptAnim(EnFsn* this) { stickAnimTween = 0.0f; this->stickAnimState = 0; } - - tmp = 155.0f * arrowAnimTween; - this->stickAnimTween = stickAnimTween; 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.b = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); this->stickLeftPrompt.arrowColor.a = 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.arrowTexX = 290.0f; + + this->stickRightPrompt.arrowColor.r = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.g = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); 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; this->stickRightPrompt.stickTexX = 274.0f; this->stickRightPrompt.stickTexX += 8.0f * stickAnimTween; + this->stickLeftPrompt.stickTexX = 49.0f; this->stickLeftPrompt.stickTexX -= 8.0f * stickAnimTween; - this->stickLeftPrompt.arrowTexY = this->stickRightPrompt.arrowTexY = 91.0f; - this->stickLeftPrompt.stickTexY = this->stickRightPrompt.stickTexY = 95.0f; + this->stickRightPrompt.arrowTexY = 91.0f; + this->stickLeftPrompt.arrowTexY = 91.0f; + + this->stickRightPrompt.stickTexY = 95.0f; + this->stickLeftPrompt.stickTexY = 95.0f; } void EnFsn_InitShop(EnFsn* this, GlobalContext* globalCtx) { - EnFsn* this2; - s32 maxColor = 255; - if (EnFsn_HasItemsToSell()) { EnFsn_SpawnShopItems(this, globalCtx); - this2 = this; - this2->cursorPos.x = 100.0f; - this2->cursorPos.y = 100.0f; - this2->stickAccumY = 0; - this2->stickAccumX = 0; + this->cursorPos.y = this->cursorPos.x = 100.0f; + this->stickAccumY = 0; + this->stickAccumX = 0; this->cursorPos.z = 1.2f; this->cursorColor.r = 0; this->cursorColor.g = 80; - this->cursorColor.b = maxColor; - this->cursorColor.a = maxColor; + this->cursorColor.b = 255; + this->cursorColor.a = 255; + this->cursorAnimTween = 0.0f; this->cursorAnimState = 0; this->drawCursor = 0; - this->cursorAnimTween = 0.0f; this->stickLeftPrompt.stickColor.r = 200; this->stickLeftPrompt.stickColor.g = 200; @@ -662,8 +681,8 @@ void EnFsn_InitShop(EnFsn* this, GlobalContext* globalCtx) { this->stickLeftPrompt.stickColor.a = 180; this->stickLeftPrompt.stickTexX = 49.0f; this->stickLeftPrompt.stickTexY = 95.0f; - this->stickLeftPrompt.arrowColor.r = maxColor; - this->stickLeftPrompt.arrowColor.g = maxColor; + 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; @@ -677,7 +696,7 @@ void EnFsn_InitShop(EnFsn* this, GlobalContext* globalCtx) { this->stickRightPrompt.stickColor.a = 180; this->stickRightPrompt.stickTexX = 274.0f; this->stickRightPrompt.stickTexY = 95.0f; - this->stickRightPrompt.arrowColor.r = maxColor; + this->stickRightPrompt.arrowColor.r = 255; this->stickRightPrompt.arrowColor.g = 0; this->stickRightPrompt.arrowColor.b = 0; this->stickRightPrompt.arrowColor.a = 200; @@ -691,21 +710,21 @@ void EnFsn_InitShop(EnFsn* this, GlobalContext* globalCtx) { this->stickAnimTween = this->arrowAnimTween = 0.0f; } this->blinkTimer = 20; - this->animationIdx = 4; + this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_START; this->eyeTextureIdx = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnFsn_Idle; } void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (this->animationIdx == 4) { + if (this->animationIndex == FSN_ANIMATION_HANDS_ON_COUNTER_START) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); if (curFrame == frameCount) { - this->animationIdx = 5; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); } return; } @@ -716,13 +735,13 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) { } if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { - if (this->cutsceneState == 0) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); } this->cutscene = this->lookToShopkeeperCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); - this->cutsceneState = 1; + this->cutsceneState = ENFSN_CUTSCENESTATE_WAITING; } this->actor.textId = EnFsn_GetWelcome(globalCtx); Message_StartTextbox(globalCtx, this->actor.textId, &this->actor); @@ -738,29 +757,29 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) { void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); if (this->flags & ENFSN_ANGRY) { this->flags &= ~ENFSN_ANGRY; - this->animationIdx = 11; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = FSN_ANIMATION_SLAM_COUNTER_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); } else { - if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) { + if (this->animationIndex == FSN_ANIMATION_SLAM_COUNTER_LOOP && Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); } if (this->flags & ENFSN_CALM_DOWN) { this->flags &= ~ENFSN_CALM_DOWN; - this->animationIdx = 5; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); } else if (this->flags & ENFSN_OFFER_FINAL_PRICE) { this->flags &= ~ENFSN_OFFER_FINAL_PRICE; - this->animationIdx = 12; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = FSN_ANIMATION_MAKE_OFFER; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); } else { - if (this->animationIdx == 12) { + if (this->animationIndex == FSN_ANIMATION_MAKE_OFFER) { if (curFrame == frameCount) { - this->animationIdx = 5; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); } else { if (Animation_OnFrame(&this->skelAnime, 28.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); @@ -776,10 +795,10 @@ void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_BeginInteraction(EnFsn* this, GlobalContext* globalCtx) { - if (this->cutsceneState == 1) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_WAITING) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - this->cutsceneState = 2; + this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; if (Player_GetMask(globalCtx) == PLAYER_MASK_NONE) { func_8011552C(globalCtx, 16); if (EnFsn_HasItemsToSell()) { @@ -862,13 +881,12 @@ void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) { } else if (talkState == 4) { func_8011552C(globalCtx, 6); if (!EnFsn_TestEndInteraction(this, globalCtx, CONTROLLER1(globalCtx)) && func_80147624(globalCtx)) { - u32 trueTmp = true; switch (globalCtx->msgCtx.choiceIndex) { case 0: func_8019F208(); - this->isSelling = trueTmp; + this->isSelling = true; this->stickLeftPrompt.isEnabled = false; - this->stickRightPrompt.isEnabled = trueTmp; + this->stickRightPrompt.isEnabled = true; this->actor.textId = 0x29D6; Message_StartTextbox(globalCtx, this->actor.textId, &this->actor); this->actionFunc = EnFsn_FaceShopkeeperSelling; @@ -941,9 +959,9 @@ void EnFsn_MakeOffer(EnFsn* this, GlobalContext* globalCtx) { func_8019F208(); globalCtx->msgCtx.msgMode = 0x43; globalCtx->msgCtx.unk12023 = 4; - if (this->cutsceneState == 2) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { ActorCutscene_Stop(this->cutscene); - this->cutsceneState = 0; + this->cutsceneState = ENFSN_CUTSCENESTATE_STOPPED; } switch (this->price) { case 5: @@ -975,7 +993,7 @@ void EnFsn_MakeOffer(EnFsn* this, GlobalContext* globalCtx) { void EnFsn_GiveItem(EnFsn* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { - if (this->isSelling == true && this->items[this->cursorIdx]->getItemId == GI_MASK_ALL_NIGHT) { + if ((this->isSelling == true) && (this->items[this->cursorIdx]->getItemId == GI_MASK_ALL_NIGHT)) { func_80151BB4(globalCtx, 45); func_80151BB4(globalCtx, 3); } @@ -1027,10 +1045,10 @@ void EnFsn_ResumeInteraction(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_ResumeShoppingInteraction(EnFsn* this, GlobalContext* globalCtx) { - if (this->cutsceneState == 0) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - this->cutsceneState = 2; + this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; if (!this->isSelling) { this->actionFunc = EnFsn_AskCanBuyMore; } else if (this->actor.textId != 0x29D6) { @@ -1052,18 +1070,18 @@ void EnFsn_ResumeShoppingInteraction(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_LookToShelf(EnFsn* this, GlobalContext* globalCtx) { - if (this->cutsceneState == 2) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { ActorCutscene_Stop(this->cutscene); if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); } this->cutscene = this->lookToShelfCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); - this->cutsceneState = 1; - } else if (this->cutsceneState == 1) { + this->cutsceneState = ENFSN_CUTSCENESTATE_WAITING; + } else if (this->cutsceneState == ENFSN_CUTSCENESTATE_WAITING) { if (ActorCutscene_GetCanPlayNext(this->cutscene) != 0) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - this->cutsceneState = 2; + this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; EnFsn_UpdateCursorPos(this, globalCtx); this->actionFunc = EnFsn_BrowseShelf; func_80151938(globalCtx, this->items[this->cursorIdx]->actor.textId); @@ -1100,18 +1118,18 @@ void EnFsn_BrowseShelf(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_LookToShopkeeperFromShelf(EnFsn* this, GlobalContext* globalCtx) { - if (this->cutsceneState == 2) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { ActorCutscene_Stop(this->cutscene); if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); } this->cutscene = this->lookToShopkeeperFromShelfCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); - this->cutsceneState = 1; - } else if (this->cutsceneState == 1) { + this->cutsceneState = ENFSN_CUTSCENESTATE_WAITING; + } else if (this->cutsceneState == ENFSN_CUTSCENESTATE_WAITING) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - this->cutsceneState = 2; + this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actor.textId = 0x29D6; @@ -1131,9 +1149,9 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, GlobalContext* globalCtx) { func_8019F208(); gSaveContext.weekEventReg[33] |= 4; case CANBUY_RESULT_SUCCESS_1: - if (this->cutsceneState == 2) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { ActorCutscene_Stop(this->cutscene); - this->cutsceneState = 0; + this->cutsceneState = ENFSN_CUTSCENESTATE_STOPPED; } func_8019F208(); item = this->items[this->cursorIdx]; @@ -1214,10 +1232,10 @@ void EnFsn_PlayerCannotBuy(EnFsn* this, GlobalContext* globalCtx) { void EnFsn_AskCanBuyMore(EnFsn* this, GlobalContext* globalCtx) { u8 talkState = Message_GetState(&globalCtx->msgCtx); - if (this->cutsceneState == 0) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - this->cutsceneState = 2; + this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; } else { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); @@ -1260,10 +1278,10 @@ void EnFsn_AskCanBuyMore(EnFsn* this, GlobalContext* globalCtx) { void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, GlobalContext* globalCtx) { u8 talkState = Message_GetState(&globalCtx->msgCtx); - if (this->cutsceneState == 0) { + if (this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - this->cutsceneState = 2; + this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; } else { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); @@ -1386,12 +1404,12 @@ void EnFsn_Blink(EnFsn* this) { } void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) { - EnFsn* this = THIS; s32 pad; + EnFsn* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fsn_Skel_013320, &object_fsn_Anim_012C34, this->jointTable, - this->morphTable, 19); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gFsnSkel, &gFsnIdleAnim, this->jointTable, this->morphTable, + FSN_LIMB_MAX + 1); if (ENFSN_IS_SHOP(&this->actor)) { this->actor.shape.rot.y = BINANG_ROT180(this->actor.shape.rot.y); this->actor.flags &= ~ACTOR_FLAG_1; @@ -1408,8 +1426,8 @@ void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) { this->eyeTextureIdx = 0; this->actor.flags |= ACTOR_FLAG_1; this->actor.targetMode = 0; - this->animationIdx = 0; - SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = FSN_ANIMATION_IDLE; + SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = EnFsn_IdleBackroom; } } @@ -1441,7 +1459,10 @@ void EnFsn_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnFsn_DrawCursor(EnFsn* this, GlobalContext* globalCtx, f32 x, f32 y, f32 z, u8 drawCursor) { - s32 ulx, uly, lrx, lry; + s32 ulx; + s32 uly; + s32 lrx; + s32 lry; f32 w; s32 dsdx; s32 pad; @@ -1451,8 +1472,8 @@ void EnFsn_DrawCursor(EnFsn* this, GlobalContext* globalCtx, f32 x, f32 y, f32 z func_8012C654(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, this->cursorColor.a); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, 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); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, gSelectionCursorTex, 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; ulx = (x - w) * 4.0f; uly = (y - w + -12.0f) * 4.0f; @@ -1467,9 +1488,14 @@ void EnFsn_DrawCursor(EnFsn* this, GlobalContext* globalCtx, f32 x, f32 y, f32 z void EnFsn_DrawTextRec(GlobalContext* globalCtx, s32 r, s32 g, s32 b, s32 a, f32 x, f32 y, f32 z, s32 s, s32 t, f32 dx, f32 dy) { f32 unk; - s32 ulx, uly, lrx, lry; - f32 w, h; - s32 dsdx, dtdy; + s32 ulx; + s32 uly; + s32 lrx; + s32 lry; + f32 w; + f32 h; + s32 dsdx; + s32 dtdy; OPEN_DISPS(globalCtx->state.gfxCtx); gDPPipeSync(OVERLAY_DISP++); @@ -1499,15 +1525,9 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) { if (drawStickRightPrompt || drawStickLeftPrompt) { func_8012C654(globalCtx->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); - gDPLoadSync(OVERLAY_DISP++); - gDPLoadBlock(OVERLAY_DISP++, G_TX_LOADTILE, 0, 0, 191, 1024); - gDPPipeSync(OVERLAY_DISP++); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_8b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - 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); + gDPLoadTextureBlock(OVERLAY_DISP++, gArrowCursorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); if (drawStickRightPrompt) { EnFsn_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColor.r, this->stickLeftPrompt.arrowColor.g, this->stickLeftPrompt.arrowColor.b, this->stickLeftPrompt.arrowColor.a, @@ -1520,15 +1540,9 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) { this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); - gDPLoadSync(OVERLAY_DISP++); - gDPLoadBlock(OVERLAY_DISP++, G_TX_LOADTILE, 0, 0, 127, 1024); - gDPPipeSync(OVERLAY_DISP++); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_8b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - 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); + gDPLoadTextureBlock(OVERLAY_DISP++, gControlStickTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); if (drawStickRightPrompt) { EnFsn_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColor.r, this->stickLeftPrompt.stickColor.g, this->stickLeftPrompt.stickColor.b, this->stickLeftPrompt.stickColor.a, @@ -1547,21 +1561,20 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) { s32 EnFsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnFsn* this = THIS; - s16 tmp; s32 limbRotTableIdx; - if (limbIndex == 16) { + if (limbIndex == FSN_LIMB_HEAD) { Matrix_InsertXRotation_s(this->headRot.y, MTXMODE_APPLY); } if (ENFSN_IS_BACKROOM(&this->actor)) { switch (limbIndex) { - case 8: + case FSN_LIMB_TORSO: limbRotTableIdx = 0; break; - case 11: + case FSN_LIMB_LEFT_HAND: limbRotTableIdx = 1; break; - case 16: + case FSN_LIMB_HEAD: limbRotTableIdx = 2; break; default: @@ -1569,13 +1582,11 @@ s32 EnFsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, break; } if (limbRotTableIdx < 9) { - tmp = (s32)(Math_SinS(this->limbRotYTable[limbRotTableIdx]) * 200.0f); - rot->y += tmp; - tmp = (s32)(Math_CosS(this->limbRotZTable[limbRotTableIdx]) * 200.0f); - rot->z += tmp; + rot->y += (s16)(Math_SinS(this->limbRotYTable[limbRotTableIdx]) * 200.0f); + rot->z += (s16)(Math_CosS(this->limbRotZTable[limbRotTableIdx]) * 200.0f); } } - if (limbIndex == 17) { + if (limbIndex == FSN_LIMB_TOUPEE) { *dList = NULL; } return false; @@ -1584,22 +1595,22 @@ s32 EnFsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, void EnFsn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { EnFsn* this = THIS; - if (limbIndex == 16) { + if (limbIndex == FSN_LIMB_HEAD) { this->actor.focus.pos.x = this->actor.world.pos.x; this->actor.focus.pos.y = this->actor.world.pos.y + 60.0f; this->actor.focus.pos.z = this->actor.world.pos.z; OPEN_DISPS(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, object_fsn_DL_00F180); - gSPDisplayList(POLY_OPA_DISP++, object_fsn_DL_00F218); + gSPDisplayList(POLY_OPA_DISP++, gFsnGlassesFrameDL); + gSPDisplayList(POLY_OPA_DISP++, gFsnGlassesLensesDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } } void EnFsn_Draw(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sEyeTextures[] = { object_fsn_Tex_005BC0, object_fsn_Tex_006D40, object_fsn_Tex_007140 }; - EnFsn* this = THIS; + static TexturePtr sEyeTextures[] = { gFsnEyeOpenTex, gFsnEyeHalfTex, gFsnEyeClosedTex }; s32 pad; + EnFsn* this = THIS; s16 i; OPEN_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 139e145daf..5fabf59ade 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h @@ -3,6 +3,7 @@ #include "global.h" #include "overlays/actors/ovl_En_GirlA/z_en_girla.h" +#include "objects/object_fsn/object_fsn.h" #define ENFSN_IS_BACKROOM(thisx) ((thisx)->params & 1) #define ENFSN_IS_SHOP(thisx) (!((thisx)->params & 1)) @@ -27,8 +28,8 @@ typedef struct EnFsn { /* 0x24E */ s16 limbRotZTable[19]; /* 0x274 */ Vec3s headRot; /* 0x27A */ Vec3s unk27A; // Set but never used - /* 0x280 */ Vec3s jointTable[19]; - /* 0x2F2 */ Vec3s morphTable[19]; + /* 0x280 */ Vec3s jointTable[FSN_LIMB_MAX + 1]; + /* 0x2F2 */ Vec3s morphTable[FSN_LIMB_MAX + 1]; /* 0x364 */ s16 eyeTextureIdx; /* 0x366 */ s16 blinkTimer; /* 0x368 */ s16 cutsceneState; @@ -63,7 +64,7 @@ typedef struct EnFsn { /* 0x444 */ u8 arrowAnimState; /* 0x445 */ u8 stickAnimState; /* 0x448 */ f32 shopItemSelectedTween; - /* 0x44C */ s16 animationIdx; + /* 0x44C */ s16 animationIndex; /* 0x44E */ u16 flags; } EnFsn; // size = 0x450 diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 317c64412c..df22065222 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -159,8 +159,8 @@ void EnGirlA_SetupAction(EnGirlA* this, EnGirlAActionFunc action) { void EnGirlA_InitObjIndex(EnGirlA* this, GlobalContext* globalCtx) { s16 params = this->actor.params; - //! @bug: Condition is impossible - if (params >= 43 && params < 0) { + //! @bug: Condition is impossible, && should be an || + if (params >= SI_MAX && params < SI_POTION_RED_1) { Actor_MarkForDeath(&this->actor); return; } @@ -377,24 +377,24 @@ s32 EnGirlA_CanBuyFairy(GlobalContext* globalCtx, EnGirlA* this) { void EnGirlA_BuyBottleItem(GlobalContext* globalCtx, EnGirlA* this) { switch (this->actor.params) { - case 0: - case 10: - case 18: - case 29: - case 32: - case 35: + case SI_POTION_RED_1: + case SI_POTION_RED_2: + case SI_POTION_RED_3: + case SI_POTION_RED_4: + case SI_POTION_RED_5: + case SI_POTION_RED_6: Item_Give(globalCtx, ITEM_POTION_RED); break; - case 1: - case 5: - case 14: + case SI_POTION_GREEN_1: + case SI_POTION_GREEN_2: + case SI_POTION_GREEN_3: Item_Give(globalCtx, ITEM_POTION_GREEN); break; - case 2: + case SI_POTION_BLUE: Item_Give(globalCtx, ITEM_POTION_BLUE); break; - case 3: - case 11: + case SI_FAIRY_1: + case SI_FAIRY_2: Item_Give(globalCtx, ITEM_FAIRY); break; } 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 fa2711501b..a3d8e02061 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -25,7 +25,7 @@ typedef struct ShopItemEntry { typedef struct EnGirlA { /* 0x000 */ Actor actor; - /* 0x144 */ char unk144[0x44]; + /* 0x144 */ UNK_TYPE1 unk144[0x44]; /* 0x188 */ EnGirlAActionFunc actionFunc; /* 0x18C */ s8 objIndex; /* 0x190 */ EnGirlAActionFunc mainActionFunc; @@ -103,7 +103,8 @@ typedef enum { /* 39 */ SI_SWORD_RAZOR, /* 40 */ SI_SWORD_GILDED, /* 41 */ SI_SHIELD_HERO_4, - /* 42 */ SI_SHIELD_MIRROR + /* 42 */ SI_SHIELD_MIRROR, + /* 43 */ SI_MAX } EnGirlAShopItemId; extern const ActorInit En_GirlA_InitVars; @@ -122,7 +123,7 @@ typedef struct { /* 0x28 */ f32 arrowTexX; /* 0x2C */ f32 arrowTexY; /* 0x30 */ f32 texZ; // Used for both stickTexZ and arrowTexZ - /* 0x34 */ s32 isEnabled; + /* 0x34 */ u32 isEnabled; } StickDirectionPrompt; // size = 0x38 typedef struct ShopItem { 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 7e32762637..13c9ee2760 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -6,8 +6,6 @@ #include "z_en_ossan.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "objects/object_fsn/object_fsn.h" -#include "objects/object_ani/object_ani.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10) @@ -20,17 +18,19 @@ void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx); void EnOssan_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnOssan_Update(Actor* thisx, GlobalContext* globalCtx); -void EnOssan_DrawCuriosityShopMan(Actor* thisx, GlobalContext* globalCtx); -void EnOssan_DrawPartTimeWorker(Actor* thisx, GlobalContext* globalCtx); +void EnOssan_CuriosityShopMan_Draw(Actor* thisx, GlobalContext* globalCtx); +void EnOssan_PartTimeWorker_Draw(Actor* thisx, GlobalContext* globalCtx); + +void EnOssan_CuriosityShopMan_Init(EnOssan* this, GlobalContext* globalCtx); +u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, GlobalContext* globalCtx); + +void EnOssan_PartTimeWorker_Init(EnOssan* this, GlobalContext* globalCtx); +u16 EnOssan_PartTimerWorker_GetWelcome(EnOssan* this, GlobalContext* globalCtx); -void EnOssan_InitCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx); -void EnOssan_InitPartTimeWorker(EnOssan* this, GlobalContext* globalCtx); -u16 EnOssan_GetWelcomeCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx); void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx); void EnOssan_Idle(EnOssan* this, GlobalContext* globalCtx); void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx); void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx); -u16 EnOssan_GetWelcomePartTimeWorker(EnOssan* this, GlobalContext* globalCtx); void EnOssan_SetHaveMet(EnOssan* this); void EnOssan_StartShopping(GlobalContext* globalCtx, EnOssan* this); void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx); @@ -53,6 +53,45 @@ void EnOssan_GetCutscenes(EnOssan* this, GlobalContext* globalCtx); s32 EnOssan_ReturnItemToShelf(EnOssan* this); s32 EnOssan_TakeItemOffShelf(EnOssan* this); +typedef enum { + /* 0 */ ENOSSAN_CUTSCENESTATE_STOPPED, + /* 1 */ ENOSSAN_CUTSCENESTATE_WAITING, + /* 2 */ ENOSSAN_CUTSCENESTATE_PLAYING +} EnOssanCutsceneState; + +typedef enum { + /* 00 */ FSN_ANIMATION_IDLE, + /* 01 */ FSN_ANIMATION_SCRATCH_BACK, + /* 02 */ FSN_ANIMATION_TURN_AROUND_FORWARD, + /* 03 */ FSN_ANIMATION_TURN_AROUND_REVERSE, + /* 04 */ FSN_ANIMATION_HANDS_ON_COUNTER_START, + /* 05 */ FSN_ANIMATION_HANDS_ON_COUNTER_LOOP, + /* 06 */ FSN_ANIMATION_HAND_ON_FACE_START, + /* 07 */ FSN_ANIMATION_HAND_ON_FACE_LOOP, + /* 08 */ FSN_ANIMATION_LEAN_FORWARD_START, + /* 09 */ FSN_ANIMATION_LEAN_FORWARD_LOOP, + /* 10 */ FSN_ANIMATION_SLAM_COUNTER_START, + /* 11 */ FSN_ANIMATION_SLAM_COUNTER_LOOP, + /* 12 */ FSN_ANIMATION_MAKE_OFFER, + /* 13 */ FSN_ANIMATION_MAX +} FsnAnimation; + +typedef enum { + /* 00 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_1, + /* 01 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_2, + /* 02 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_1, + /* 03 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_REVERSE, + /* 04 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_2, + /* 05 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_3, + /* 06 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_3, + /* 07 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_4, + /* 08 */ ANI_ANIMATION_APOLOGY_START, + /* 09 */ ANI_ANIMATION_APOLOGY_LOOP, + /* 10 */ ANI_ANIMATION_STANDING_NORMAL_ONCE_FORWARD_4, + /* 11 */ ANI_ANIMATION_STANDING_NORMAL_LOOP_5, + /* 12 */ ANI_ANIMATION_MAX +} AniAnimation; + const ActorInit En_Ossan_InitVars = { ACTOR_EN_OSSAN, ACTORCAT_NPC, @@ -66,19 +105,19 @@ const ActorInit En_Ossan_InitVars = { }; static AnimationInfoS sAnimationsCuriosityShopMan[] = { - { &object_fsn_Anim_012C34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_0131FC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_00C58C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00C58C, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00F00C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00D354, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_0138B0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_01430C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_fsn_Anim_00C26C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_fsn_Anim_00DE34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnScratchBackAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnTurnAroundAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnHandsOnCounterStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnHandsOnCounterLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnHandOnFaceStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnHandOnFaceLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnLeanForwardStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnLeanForwardLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnSlamCounterStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gFsnSlamCounterLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gFsnMakeOfferAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; static AnimationInfoS sAnimationsPartTimeWorker[] = { @@ -352,9 +391,9 @@ void EnOssan_Idle(EnOssan* this, GlobalContext* globalCtx) { void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) { AnimationInfoS* animations = sAnimations[this->actor.params]; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(animations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(animations[this->animationIndex].animation); - if (this->animationIdx == 3) { + if (this->animationIndex == FSN_ANIMATION_TURN_AROUND_REVERSE) { frameCount = 0; } if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_WAITING) { @@ -367,47 +406,47 @@ void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) { } if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) { if (curFrame == frameCount) { - switch (this->animationIdx) { - case 1: - this->animationIdx = 2; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 2); + switch (this->animationIndex) { + case FSN_ANIMATION_SCRATCH_BACK: + this->animationIndex = FSN_ANIMATION_TURN_AROUND_FORWARD; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_TURN_AROUND_FORWARD); break; - case 2: + case FSN_ANIMATION_TURN_AROUND_FORWARD: EnOssan_SetHaveMet(this); - this->textId = EnOssan_GetWelcomeCuriosityShopMan(this, globalCtx); - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIdx); + this->textId = EnOssan_CuriosityShopMan_GetWelcome(this, globalCtx); + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIndex); break; - case 4: - case 6: - case 8: - case 10: - this->animationIdx++; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIdx); + case FSN_ANIMATION_HANDS_ON_COUNTER_START: + case FSN_ANIMATION_HAND_ON_FACE_START: + case FSN_ANIMATION_LEAN_FORWARD_START: + case FSN_ANIMATION_SLAM_COUNTER_START: + this->animationIndex++; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIndex); Message_StartTextbox(globalCtx, this->textId, &this->actor); EnOssan_SetupStartShopping(globalCtx, this, false); break; - case 5: - case 7: - case 9: - case 11: - this->animationIdx = 3; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 3); + case FSN_ANIMATION_HANDS_ON_COUNTER_LOOP: + case FSN_ANIMATION_HAND_ON_FACE_LOOP: + case FSN_ANIMATION_LEAN_FORWARD_LOOP: + case FSN_ANIMATION_SLAM_COUNTER_LOOP: + this->animationIndex = FSN_ANIMATION_TURN_AROUND_REVERSE; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_TURN_AROUND_REVERSE); break; - case 3: - this->animationIdx = 1; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); + case FSN_ANIMATION_TURN_AROUND_REVERSE: + this->animationIndex = FSN_ANIMATION_SCRATCH_BACK; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_SCRATCH_BACK); EnOssan_SetupAction(this, EnOssan_Idle); break; default: - this->animationIdx = 1; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); + this->animationIndex = FSN_ANIMATION_SCRATCH_BACK; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, FSN_ANIMATION_SCRATCH_BACK); EnOssan_SetupAction(this, EnOssan_Idle); break; } } } else { EnOssan_SetHaveMet(this); - this->textId = EnOssan_GetWelcomePartTimeWorker(this, globalCtx); + this->textId = EnOssan_PartTimerWorker_GetWelcome(this, globalCtx); Message_StartTextbox(globalCtx, this->textId, &this->actor); EnOssan_SetupStartShopping(globalCtx, this, false); } @@ -525,8 +564,8 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) { EnOssan_RotateHead(this, globalCtx); if (talkState == 5 && func_80147624(globalCtx)) { - if (this->animationIdx == 9 && this->actor.params == ENOSSAN_PART_TIME_WORKER) { - this->animationIdx = 1; + if ((this->animationIndex == ANI_ANIMATION_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) { + this->animationIndex = ANI_ANIMATION_STANDING_NORMAL_LOOP_2; SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); } this->flags &= ~LOOKED_AT_PLAYER; @@ -541,12 +580,12 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) { return; } } - if (talkState == 10 && this->actor.params == ENOSSAN_PART_TIME_WORKER && - player->transformation == PLAYER_FORM_ZORA && func_80147624(globalCtx)) { - this->animationIdx = 9; - SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 9); + if ((talkState == 10) && (this->actor.params == ENOSSAN_PART_TIME_WORKER) && + (player->transformation == PLAYER_FORM_ZORA) && func_80147624(globalCtx)) { + this->animationIndex = ANI_ANIMATION_APOLOGY_LOOP; + SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, ANI_ANIMATION_APOLOGY_LOOP); } - if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) { + if ((this->animationIndex == FSN_ANIMATION_SLAM_COUNTER_LOOP) && Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); } } @@ -558,8 +597,8 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, GlobalContext* globalCtx switch (globalCtx->msgCtx.choiceIndex) { case 0: func_8019F208(); - if (this->actor.params == ENOSSAN_PART_TIME_WORKER && player->transformation == PLAYER_FORM_ZORA) { - this->animationIdx = 9; + if ((this->actor.params == ENOSSAN_PART_TIME_WORKER) && (player->transformation == PLAYER_FORM_ZORA)) { + this->animationIndex = ANI_ANIMATION_APOLOGY_LOOP; SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 9); } EnOssan_SetupAction(this, EnOssan_TalkToShopkeeper); @@ -627,8 +666,8 @@ void EnOssan_TalkToShopkeeper(EnOssan* this, GlobalContext* globalCtx) { AnimationInfoS* animations = sAnimations[this->actor.params]; if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { - if (this->animationIdx == 9 && this->actor.params == ENOSSAN_PART_TIME_WORKER) { - this->animationIdx = 1; + if ((this->animationIndex == ANI_ANIMATION_APOLOGY_LOOP) && (this->actor.params == ENOSSAN_PART_TIME_WORKER)) { + this->animationIndex = ANI_ANIMATION_STANDING_NORMAL_LOOP_2; SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1); } EnOssan_StartShopping(globalCtx, this); @@ -1238,10 +1277,7 @@ void EnOssan_UpdateCursorAnim(EnOssan* this) { void EnOssan_UpdateStickDirectionPromptAnim(EnOssan* this) { f32 arrowAnimTween = this->arrowAnimTween; f32 stickAnimTween = this->stickAnimTween; - - // Possibly Fake - s32 maxColor = 255; - f32 tmp; + s32 maxColor = 255; // POSSIBLY FAKE if (this->arrowAnimState == 0) { arrowAnimTween += 0.05f; @@ -1268,31 +1304,33 @@ void EnOssan_UpdateStickDirectionPromptAnim(EnOssan* this) { stickAnimTween = 0.0f; this->stickAnimState = 0; } - - tmp = 155.0f * arrowAnimTween; - this->stickAnimTween = stickAnimTween; 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.b = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); this->stickLeftPrompt.arrowColor.a = 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.arrowTexX = 290.0f; + + this->stickRightPrompt.arrowColor.r = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.g = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); 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; this->stickRightPrompt.stickTexX = 274.0f; this->stickRightPrompt.stickTexX += 8.0f * stickAnimTween; + this->stickLeftPrompt.stickTexX = 49.0f; this->stickLeftPrompt.stickTexX -= 8.0f * stickAnimTween; - this->stickLeftPrompt.arrowTexY = this->stickRightPrompt.arrowTexY = 91.0f; - this->stickLeftPrompt.stickTexY = this->stickRightPrompt.stickTexY = 95.0f; + this->stickRightPrompt.arrowTexY = 91.0f; + this->stickLeftPrompt.arrowTexY = 91.0f; + + this->stickRightPrompt.stickTexY = 95.0f; + this->stickLeftPrompt.stickTexY = 95.0f; } void EnOssan_WaitForBlink(EnOssan* this) { @@ -1324,52 +1362,52 @@ void EnOssan_Blink(EnOssan* this) { } } -void EnOssan_InitCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fsn_Skel_013320, &object_fsn_Anim_012C34, this->jointTable, - this->morphTable, 19); - this->actor.draw = EnOssan_DrawCuriosityShopMan; +void EnOssan_CuriosityShopMan_Init(EnOssan* this, GlobalContext* globalCtx) { + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gFsnSkel, &gFsnIdleAnim, this->jointTable, this->morphTable, + ENOSSAN_LIMB_MAX); + this->actor.draw = EnOssan_CuriosityShopMan_Draw; } -void EnOssan_InitPartTimeWorker(EnOssan* this, GlobalContext* globalCtx) { +void EnOssan_PartTimeWorker_Init(EnOssan* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gAniSkeleton, &gAniStandingNormalAnim, this->jointTable, this->morphTable, 16); - this->actor.draw = EnOssan_DrawPartTimeWorker; + this->actor.draw = EnOssan_PartTimeWorker_Draw; } -u16 EnOssan_GetWelcomeCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx) { +u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); u16 textId = Text_GetFaceReaction(globalCtx, 0x2F); if (textId != 0) { - this->animationIdx = 4; + this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_START; this->flags |= END_INTERACTION; return textId; } switch (player->transformation) { case PLAYER_FORM_DEKU: - this->animationIdx = 10; + this->animationIndex = FSN_ANIMATION_SLAM_COUNTER_START; if (gSaveContext.weekEventReg[18] & 0x10) { return sWelcomeDekuTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } return sWelcomeDekuFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; case PLAYER_FORM_ZORA: - this->animationIdx = 8; + this->animationIndex = FSN_ANIMATION_LEAN_FORWARD_START; if (gSaveContext.weekEventReg[18] & 8) { return sWelcomeZoraTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } return sWelcomeZoraFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; case PLAYER_FORM_GORON: - this->animationIdx = 6; + this->animationIndex = FSN_ANIMATION_HAND_ON_FACE_START; if (gSaveContext.weekEventReg[18] & 4) { return sWelcomeGoronTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } return sWelcomeGoronFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } - this->animationIdx = 4; + this->animationIndex = FSN_ANIMATION_HANDS_ON_COUNTER_START; return sWelcomeHumanTextIds[ENOSSAN_CURIOSITY_SHOP_MAN]; } -u16 EnOssan_GetWelcomePartTimeWorker(EnOssan* this, GlobalContext* globalCtx) { +u16 EnOssan_PartTimerWorker_GetWelcome(EnOssan* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); u16 textId = Text_GetFaceReaction(globalCtx, 0x36); @@ -1421,7 +1459,7 @@ void EnOssan_SetHaveMet(EnOssan* this) { } void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx) { - static EnOssanActionFunc sInitFuncs[] = { EnOssan_InitCuriosityShopMan, EnOssan_InitPartTimeWorker }; + static EnOssanActionFunc sInitFuncs[] = { EnOssan_CuriosityShopMan_Init, EnOssan_PartTimeWorker_Init }; ShopItem* shopItems; if (Object_IsLoaded(&globalCtx->objectCtx, this->objIndex)) { @@ -1486,8 +1524,9 @@ void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx) { this->arrowAnimTween = 0.0f; this->stickAnimTween = 0.0f; this->shopItemSelectedTween = 0.0f; + Actor_SetScale(&this->actor, sActorScales[this->actor.params]); - this->animationIdx = 1; + this->animationIndex = 1; // FSN_ANIMATION_SCRATCH_BACK and ANI_ANIMATION_STANDING_NORMAL_LOOP_2 SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations[this->actor.params], 1); EnOssan_SpawnShopItems(this, globalCtx, shopItems); this->blinkTimer = 20; @@ -1524,19 +1563,22 @@ void EnOssan_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnOssan_DrawCursor(GlobalContext* globalCtx, EnOssan* this, f32 x, f32 y, f32 z, u8 drawCursor) { - s32 ulx, uly, lrx, lry; + s32 ulx; + s32 uly; + s32 lrx; + s32 lry; f32 w; s32 dsdx; - ((void)"../z_en_oB1.c"); // Unreferenced + (void)"../z_en_oB1.c"; OPEN_DISPS(globalCtx->state.gfxCtx); if (drawCursor != 0) { func_8012C654(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, this->cursorColor.a); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, 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); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, gSelectionCursorTex, 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; ulx = (x - w) * 4.0f; uly = (y - w) * 4.0f; @@ -1551,11 +1593,16 @@ void EnOssan_DrawCursor(GlobalContext* globalCtx, EnOssan* this, f32 x, f32 y, f void EnOssan_DrawTextRec(GlobalContext* globalCtx, s32 r, s32 g, s32 b, s32 a, f32 x, f32 y, f32 z, s32 s, s32 t, f32 dx, f32 dy) { f32 unk; - s32 ulx, uly, lrx, lry; - f32 w, h; - s32 dsdx, dtdy; + s32 ulx; + s32 uly; + s32 lrx; + s32 lry; + f32 w; + f32 h; + s32 dsdx; + s32 dtdy; - ((void)"../z_en_oB1.c"); // Unreferenced + (void)"../z_en_oB1.c"; OPEN_DISPS(globalCtx->state.gfxCtx); gDPPipeSync(OVERLAY_DISP++); @@ -1581,21 +1628,15 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this) s32 drawStickRightPrompt = this->stickLeftPrompt.isEnabled; s32 drawStickLeftPrompt = this->stickRightPrompt.isEnabled; - ((void)"../z_en_oB1.c"); // Unreferenced + (void)"../z_en_oB1.c"; OPEN_DISPS(globalCtx->state.gfxCtx); if (drawStickRightPrompt || drawStickLeftPrompt) { func_8012C654(globalCtx->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); - gDPLoadSync(OVERLAY_DISP++); - gDPLoadBlock(OVERLAY_DISP++, G_TX_LOADTILE, 0, 0, 191, 1024); - gDPPipeSync(OVERLAY_DISP++); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_8b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - 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); + gDPLoadTextureBlock(OVERLAY_DISP++, gArrowCursorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); if (drawStickRightPrompt) { EnOssan_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColor.r, this->stickLeftPrompt.arrowColor.g, this->stickLeftPrompt.arrowColor.b, this->stickLeftPrompt.arrowColor.a, @@ -1608,15 +1649,9 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this) this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); - gDPLoadSync(OVERLAY_DISP++); - gDPLoadBlock(OVERLAY_DISP++, G_TX_LOADTILE, 0, 0, 127, 1024); - gDPPipeSync(OVERLAY_DISP++); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_8b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - 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); + gDPLoadTextureBlock(OVERLAY_DISP++, gControlStickTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); if (drawStickRightPrompt) { EnOssan_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColor.r, this->stickLeftPrompt.stickColor.g, this->stickLeftPrompt.stickColor.b, this->stickLeftPrompt.stickColor.a, @@ -1633,72 +1668,73 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this) CLOSE_DISPS(globalCtx->state.gfxCtx); } -s32 EnOssan_OverrideLimbDrawCuriosityShopMan(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, - Vec3s* rot, Actor* thisx) { +s32 EnOssan_CuriosityShopMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, + Vec3s* rot, Actor* thisx) { EnOssan* this = THIS; - if (limbIndex == 16) { + if (limbIndex == FSN_LIMB_HEAD) { Matrix_InsertXRotation_s(this->headRot.y, MTXMODE_APPLY); } return false; } -s32 EnOssan_OverrideLimbDrawPartTimeWorker(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - Actor* thisx) { +s32 EnOssan_PartTimeWorker_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, + Vec3s* rot, Actor* thisx) { EnOssan* this = THIS; - if (limbIndex == 15) { + if (limbIndex == ANI_LIMB_HEAD) { Matrix_InsertXRotation_s(this->headRotPartTimeWorker.y, MTXMODE_APPLY); Matrix_InsertZRotation_s(this->headRotPartTimeWorker.x, MTXMODE_APPLY); } return false; } -void EnOssan_PostLimbDrawCuriosityShopMan(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, - Actor* thisx) { +void EnOssan_CuriosityShopMan_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, + Actor* thisx) { EnOssan* this = THIS; - if (limbIndex == 1 || limbIndex == 9 || limbIndex == 12) { + if (limbIndex == FSN_LIMB_PELVIS || limbIndex == FSN_LIMB_LEFT_UPPER_ARM || limbIndex == FSN_LIMB_RIGHT_UPPER_ARM) { rot->y += (s16)Math_SinS(this->limbRotTableY[limbIndex]) * 200; rot->z += (s16)Math_CosS(this->limbRotTableZ[limbIndex]) * 200; } } -void EnOssan_PostLimbDrawPartTimeWorker(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, - Actor* thisx) { +void EnOssan_PartTimeWorker_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, + Actor* thisx) { static Vec3f sPartTimeWorkerFocusOffset = { 800.0f, 500.0f, 0.0f }; EnOssan* this = THIS; - if (limbIndex == 15) { + if (limbIndex == ANI_LIMB_HEAD) { Matrix_MultiplyVector3fByState(&sPartTimeWorkerFocusOffset, &this->actor.focus.pos); } } -void EnOssan_DrawCuriosityShopMan(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sEyeTextures[] = { object_fsn_Tex_005BC0, object_fsn_Tex_006D40, object_fsn_Tex_007140 }; - EnOssan* this = THIS; +void EnOssan_CuriosityShopMan_Draw(Actor* thisx, GlobalContext* globalCtx) { + static TexturePtr sEyeTextures[] = { gFsnEyeOpenTex, gFsnEyeHalfTex, gFsnEyeClosedTex }; s32 pad; + EnOssan* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex])); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - EnOssan_OverrideLimbDrawCuriosityShopMan, EnOssan_PostLimbDrawCuriosityShopMan, &this->actor); + EnOssan_CuriosityShopMan_OverrideLimbDraw, EnOssan_CuriosityShopMan_PostLimbDraw, + &this->actor); EnOssan_DrawCursor(globalCtx, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor); EnOssan_DrawStickDirectionPrompts(globalCtx, this); CLOSE_DISPS(globalCtx->state.gfxCtx); } -void EnOssan_DrawPartTimeWorker(Actor* thisx, GlobalContext* globalCtx) { +void EnOssan_PartTimeWorker_Draw(Actor* thisx, GlobalContext* globalCtx) { static TexturePtr sEyeTextures[] = { gAniOpenEyeTex, gAniClosingEyeTex, gAniClosedEyeTex }; - EnOssan* this = THIS; s32 pad; + EnOssan* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex])); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - EnOssan_OverrideLimbDrawPartTimeWorker, EnOssan_PostLimbDrawPartTimeWorker, &this->actor); + EnOssan_PartTimeWorker_OverrideLimbDraw, EnOssan_PartTimeWorker_PostLimbDraw, &this->actor); 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 53f8b8f394..58c638d8e3 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -2,8 +2,11 @@ #define Z_EN_OSSAN_H #include "global.h" - #include "overlays/actors/ovl_En_GirlA/z_en_girla.h" +#include "objects/object_ani/object_ani.h" +#include "objects/object_fsn/object_fsn.h" + +#define ENOSSAN_LIMB_MAX MAX(FSN_LIMB_MAX + 1, ANI_LIMB_MAX) struct EnOssan; @@ -50,9 +53,9 @@ typedef struct EnOssan { /* 0x2CC */ Vec3s unk2CC; // Set but never used /* 0x2D2 */ s16 limbRotTableY[19]; /* 0x2F8 */ s16 limbRotTableZ[19]; - /* 0x31E */ Vec3s jointTable[19]; - /* 0x390 */ Vec3s morphTable[19]; - /* 0x402 */ s16 animationIdx; + /* 0x31E */ Vec3s jointTable[ENOSSAN_LIMB_MAX]; + /* 0x390 */ Vec3s morphTable[ENOSSAN_LIMB_MAX]; + /* 0x402 */ s16 animationIndex; /* 0x404 */ Vec3s headRotPartTimeWorker; /* 0x40A */ u16 flags; } EnOssan; // size = 0x40C @@ -68,12 +71,6 @@ typedef enum { /* 1 */ ENOSSAN_PART_TIME_WORKER } EnOssanWorker; -typedef enum { - /* 0 */ ENOSSAN_CUTSCENESTATE_STOPPED, - /* 1 */ ENOSSAN_CUTSCENESTATE_WAITING, - /* 2 */ ENOSSAN_CUTSCENESTATE_PLAYING -} EnOssanCutsceneState; - extern const ActorInit En_Ossan_InitVars; #endif // Z_EN_OSSAN_H 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 ecf1f814be..7d63609c12 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -20,13 +20,14 @@ void EnSob1_Init(Actor* thisx, GlobalContext* globalCtx); void EnSob1_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnSob1_Update(Actor* thisx, GlobalContext* globalCtx); -void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx); -void EnSob1_DrawGoronShopkeeper(Actor* thisx, GlobalContext* globalCtx); -void EnSob1_DrawBombShopkeeper(Actor* thisx, GlobalContext* globalCtx); +void EnSob1_ZoraShopkeeper_Draw(Actor* thisx, GlobalContext* globalCtx); +void EnSob1_GoronShopkeeper_Draw(Actor* thisx, GlobalContext* globalCtx); +void EnSob1_BombShopkeeper_Draw(Actor* thisx, GlobalContext* globalCtx); + +void EnSob1_ZoraShopkeeper_Init(EnSob1* this, GlobalContext* globalCtx); +void EnSob1_GoronShopkeeper_Init(EnSob1* this, GlobalContext* globalCtx); +void EnSob1_BombShopkeeper_Init(EnSob1* this, GlobalContext* globalCtx); -void EnSob1_InitZoraShopkeeper(EnSob1* this, GlobalContext* globalCtx); -void EnSob1_InitGoronShopkeeper(EnSob1* this, GlobalContext* globalCtx); -void EnSob1_InitBombShopkeeper(EnSob1* this, GlobalContext* globalCtx); void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx); void EnSob1_Idle(EnSob1* this, GlobalContext* globalCtx); void EnSob1_Walk(EnSob1* this, GlobalContext* globalCtx); @@ -139,10 +140,10 @@ static InitChainEntry sInitChain[] = { }; static EnSob1ActionFunc sInitFuncs[] = { - EnSob1_InitZoraShopkeeper, - EnSob1_InitGoronShopkeeper, - EnSob1_InitBombShopkeeper, - EnSob1_InitGoronShopkeeper, + EnSob1_ZoraShopkeeper_Init, + EnSob1_GoronShopkeeper_Init, + EnSob1_BombShopkeeper_Init, + EnSob1_GoronShopkeeper_Init, }; static Vec3f sPosOffset[] = { @@ -329,7 +330,7 @@ u16 EnSob1_GetGoodbye(EnSob1* this) { return 0x64C; } -void EnSob1_EndInteractionBombShop(EnSob1* this, GlobalContext* globalCtx) { +void EnSob1_BombShopkeeper_EndInteraction(EnSob1* this, GlobalContext* globalCtx) { this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; @@ -451,7 +452,7 @@ void EnSob1_EndInteraction(GlobalContext* globalCtx, EnSob1* this) { s32 EnSob1_TestEndInteraction(EnSob1* this, GlobalContext* globalCtx, Input* input) { if (CHECK_BTN_ALL(input->press.button, BTN_B)) { if (this->shopType == BOMB_SHOP) { - EnSob1_EndInteractionBombShop(this, globalCtx); + EnSob1_BombShopkeeper_EndInteraction(this, globalCtx); } else { EnSob1_EndInteraction(globalCtx, this); } @@ -625,7 +626,7 @@ s32 EnSob1_FacingShopkeeperDialogResult(EnSob1* this, GlobalContext* globalCtx) case 1: func_8019F230(); if (this->shopType == BOMB_SHOP) { - EnSob1_EndInteractionBombShop(this, globalCtx); + EnSob1_BombShopkeeper_EndInteraction(this, globalCtx); } else { EnSob1_EndInteraction(globalCtx, this); } @@ -1192,10 +1193,7 @@ void EnSob1_UpdateCursorAnim(EnSob1* this) { void EnSob1_UpdateStickDirectionPromptAnim(EnSob1* this) { f32 arrowAnimTween = this->arrowAnimTween; f32 stickAnimTween = this->stickAnimTween; - - // Possbily fake temps - s32 maxColor = 255; - f32 tmp; + s32 maxColor = 255; // POSSIBLY FAKE if (this->arrowAnimState == 0) { arrowAnimTween += 0.05f; @@ -1222,31 +1220,33 @@ void EnSob1_UpdateStickDirectionPromptAnim(EnSob1* this) { stickAnimTween = 0.0f; this->stickAnimState = 0; } - - tmp = 155.0f * arrowAnimTween; - this->stickAnimTween = stickAnimTween; 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.b = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); this->stickLeftPrompt.arrowColor.a = 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.arrowTexX = 290.0f; + + this->stickRightPrompt.arrowColor.r = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.g = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); 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; this->stickRightPrompt.stickTexX = 274.0f; this->stickRightPrompt.stickTexX += 8.0f * stickAnimTween; + this->stickLeftPrompt.stickTexX = 49.0f; this->stickLeftPrompt.stickTexX -= 8.0f * stickAnimTween; - this->stickLeftPrompt.arrowTexY = this->stickRightPrompt.arrowTexY = 91.0f; - this->stickLeftPrompt.stickTexY = this->stickRightPrompt.stickTexY = 95.0f; + this->stickRightPrompt.arrowTexY = 91.0f; + this->stickLeftPrompt.arrowTexY = 91.0f; + + this->stickRightPrompt.stickTexY = 95.0f; + this->stickLeftPrompt.stickTexY = 95.0f; } s16 EnSob1_GetXZAngleAndDistanceSqToPoint(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq) { @@ -1319,42 +1319,38 @@ s32 EnSob1_AreObjectsLoaded(EnSob1* this, GlobalContext* globalCtx) { return false; } -void EnSob1_InitZoraShopkeeper(EnSob1* this, GlobalContext* globalCtx) { +void EnSob1_ZoraShopkeeper_Init(EnSob1* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, 20); gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment); Animation_Change(&this->skelAnime, &object_masterzoora_Anim_00078C, 1.0f, 0.0f, Animation_GetLastFrame(&object_masterzoora_Anim_00078C), 0, 0.0f); - this->actor.draw = EnSob1_DrawZoraShopkeeper; + this->actor.draw = EnSob1_ZoraShopkeeper_Draw; this->changeObjectFunc = EnSob1_ChangeObject; } -void EnSob1_InitGoronShopkeeper(EnSob1* this, GlobalContext* globalCtx) { +void EnSob1_GoronShopkeeper_Init(EnSob1* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_oF1d_map_Skel_011AC8, NULL, this->jointTable, this->morphTable, 18); gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment); Animation_Change(&this->skelAnime, &object_mastergolon_Anim_0000FC, 1.0f, 0.0f, Animation_GetLastFrame(&object_mastergolon_Anim_0000FC), 0, 0.0f); - this->actor.draw = EnSob1_DrawGoronShopkeeper; + this->actor.draw = EnSob1_GoronShopkeeper_Draw; this->changeObjectFunc = EnSob1_ChangeObject; } -void EnSob1_InitBombShopkeeper(EnSob1* this, GlobalContext* globalCtx) { +void EnSob1_BombShopkeeper_Init(EnSob1* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rs_Skel_009220, &object_rs_Anim_009120, this->jointTable, this->morphTable, 16); - this->actor.draw = EnSob1_DrawBombShopkeeper; + this->actor.draw = EnSob1_BombShopkeeper_Draw; this->changeObjectFunc = NULL; this->skelAnime.playSpeed = 2.0f; } void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) { ShopItem* shopItems; - EnSob1XZRange* unkStruct; + EnSob1XZRange* xzRange; Vec3f* posOffset; - // Possibly fake temps - EnSob1* this2; - u32 maxColor = 255; - if (EnSob1_AreObjectsLoaded(this, globalCtx)) { this->actor.flags &= ~ACTOR_FLAG_10; this->actor.objBankIndex = this->objIndices[0]; @@ -1387,65 +1383,63 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) { EnSob1_SetupAction(this, EnSob1_Idle); } - this->cursorPos.y = (this->cursorPos.x = 100.0f); - this->stickAccumX = (this->stickAccumY = 0); + this->cursorPos.y = this->cursorPos.x = 100.0f; + this->stickAccumY = 0; + this->stickAccumX = 0; + this->cursorIdx = 0; this->cursorPos.z = 1.2f; this->cursorColor.r = 0; this->cursorColor.g = 80; - this->cursorColor.b = maxColor; - this->cursorColor.a = maxColor; + this->cursorColor.b = 255; + this->cursorColor.a = 255; this->cursorAnimTween = 0.0f; this->cursorAnimState = 0; this->drawCursor = 0; - this2 = this; + 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.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; - 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.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; - this2->stickLeftPrompt.isEnabled = 0; + 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.arrowColor.r = 255; + 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; + this->stickRightPrompt.isEnabled = false; - if (1) {} + this->arrowAnimState = 0; + this->stickAnimState = 0; + this->arrowAnimTween = 0.0f; + this->stickAnimTween = 0.0f; + this->shopItemSelectedTween = 0.0f; - 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.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; - this2->stickRightPrompt.isEnabled = 0; - - this2->arrowAnimState = 0; - this2->stickAnimState = 0; - this2->arrowAnimTween = 0.0f; - this2->stickAnimTween = 0.0f; - this2->shopItemSelectedTween = 0.0f; - - this2->actor.gravity = 0.0f; - this2->posXZRange = sPosXZRanges[this2->shopType]; - Actor_SetScale(&this2->actor, sActorScales[this2->shopType]); - EnSob1_SpawnShopItems(this2, globalCtx, shopItems); + this->actor.gravity = 0.0f; + this->posXZRange = sPosXZRanges[this->shopType]; + Actor_SetScale(&this->actor, sActorScales[this->shopType]); + EnSob1_SpawnShopItems(this, globalCtx, shopItems); this->headRot = this->headRotTarget = 0; - this2->blinkTimer = 20; - this2->eyeTexIndex = 0; + this->blinkTimer = 20; + this->eyeTexIndex = 0; this->blinkFunc = EnSob1_WaitForBlink; this->actor.flags &= ~ACTOR_FLAG_1; } @@ -1475,7 +1469,10 @@ void EnSob1_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnSob1_DrawCursor(GlobalContext* globalCtx, EnSob1* this, f32 x, f32 y, f32 z, u8 drawCursor) { - s32 ulx, uly, lrx, lry; + s32 ulx; + s32 uly; + s32 lrx; + s32 lry; f32 w; s32 dsdx; s32 pad; @@ -1485,8 +1482,8 @@ void EnSob1_DrawCursor(GlobalContext* globalCtx, EnSob1* this, f32 x, f32 y, f32 func_8012C654(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, this->cursorColor.a); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, 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); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, gSelectionCursorTex, 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; ulx = (x - w) * 4.0f; uly = (y - w + -12.0f) * 4.0f; @@ -1501,11 +1498,16 @@ void EnSob1_DrawCursor(GlobalContext* globalCtx, EnSob1* this, f32 x, f32 y, f32 void EnSob1_DrawTextRec(GlobalContext* globalCtx, s32 r, s32 g, s32 b, s32 a, f32 x, f32 y, f32 z, s32 s, s32 t, f32 dx, f32 dy) { f32 unk; - s32 ulx, uly, lrx, lry; - f32 w, h; - s32 dsdx, dtdy; + s32 ulx; + s32 uly; + s32 lrx; + s32 lry; + f32 w; + f32 h; + s32 dsdx; + s32 dtdy; - ((void)"../z_en_soB1.c"); // Unreferenced + (void)"../z_en_soB1.c"; OPEN_DISPS(globalCtx->state.gfxCtx); gDPPipeSync(OVERLAY_DISP++); @@ -1531,21 +1533,15 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) { s32 drawStickRightPrompt = this->stickLeftPrompt.isEnabled; s32 drawStickLeftPrompt = this->stickRightPrompt.isEnabled; - ((void)"../z_en_soB1.c"); // Unreferenced + (void)"../z_en_soB1.c"; OPEN_DISPS(globalCtx->state.gfxCtx); if (drawStickRightPrompt || drawStickLeftPrompt) { func_8012C654(globalCtx->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); - gDPLoadSync(OVERLAY_DISP++); - gDPLoadBlock(OVERLAY_DISP++, G_TX_LOADTILE, 0, 0, 191, 1024); - gDPPipeSync(OVERLAY_DISP++); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_8b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - 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); + gDPLoadTextureBlock(OVERLAY_DISP++, gArrowCursorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); if (drawStickRightPrompt) { EnSob1_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColor.r, this->stickLeftPrompt.arrowColor.g, this->stickLeftPrompt.arrowColor.b, this->stickLeftPrompt.arrowColor.a, @@ -1558,15 +1554,9 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) { this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); - gDPLoadSync(OVERLAY_DISP++); - gDPLoadBlock(OVERLAY_DISP++, G_TX_LOADTILE, 0, 0, 127, 1024); - gDPPipeSync(OVERLAY_DISP++); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_8b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - 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); + gDPLoadTextureBlock(OVERLAY_DISP++, gControlStickTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); if (drawStickRightPrompt) { EnSob1_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColor.r, this->stickLeftPrompt.stickColor.g, this->stickLeftPrompt.stickColor.b, this->stickLeftPrompt.stickColor.a, @@ -1583,8 +1573,8 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -s32 EnSob1_OverrideLimbDrawZoraShopkeeper(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - Actor* thisx) { +s32 EnSob1_ZoraShopkeeper_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { EnSob1* this = THIS; if (limbIndex == 15) { @@ -1593,8 +1583,8 @@ s32 EnSob1_OverrideLimbDrawZoraShopkeeper(GlobalContext* globalCtx, s32 limbInde return false; } -s32 EnSob1_OverrideLimbDrawBombShopkeeper(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, - Actor* thisx) { +s32 EnSob1_BombShopkeeper_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { EnSob1* this = THIS; if (limbIndex == 15) { @@ -1603,7 +1593,8 @@ s32 EnSob1_OverrideLimbDrawBombShopkeeper(GlobalContext* globalCtx, s32 limbInde return false; } -void EnSob1_PostLimbDrawBombShopkeeper(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { +void EnSob1_BombShopkeeper_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, + Actor* thisx) { OPEN_DISPS(globalCtx->state.gfxCtx); if (limbIndex == 11) { gSPDisplayList(POLY_OPA_DISP++, object_rs_DL_000970); @@ -1621,7 +1612,7 @@ Gfx* EnSob1_EndDList(GraphicsContext* gfxCtx) { return dList; } -void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx) { +void EnSob1_ZoraShopkeeper_Draw(Actor* thisx, GlobalContext* globalCtx) { static TexturePtr sZoraShopkeeperEyeTextures[] = { gZoraEyeOpenTex, gZoraEyeHalfTex, gZoraEyeClosedTex }; EnSob1* this = THIS; s32 pad; @@ -1633,7 +1624,7 @@ void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x0C, EnSob1_EndDList(globalCtx->state.gfxCtx)); gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sZoraShopkeeperEyeTextures[this->eyeTexIndex])); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - EnSob1_OverrideLimbDrawZoraShopkeeper, NULL, &this->actor); + EnSob1_ZoraShopkeeper_OverrideLimbDraw, NULL, &this->actor); for (i = 0; i < ARRAY_COUNT(this->items); i++) { this->items[i]->actor.scale.x = 0.2f; this->items[i]->actor.scale.y = 0.2f; @@ -1644,7 +1635,7 @@ void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -void EnSob1_DrawGoronShopkeeper(Actor* thisx, GlobalContext* globalCtx) { +void EnSob1_GoronShopkeeper_Draw(Actor* thisx, GlobalContext* globalCtx) { static TexturePtr sGoronShopkeeperEyeTextures[] = { object_oF1d_map_Tex_010438, object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_011038 }; EnSob1* this = THIS; @@ -1666,7 +1657,7 @@ void EnSob1_DrawGoronShopkeeper(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -void EnSob1_DrawBombShopkeeper(Actor* thisx, GlobalContext* globalCtx) { +void EnSob1_BombShopkeeper_Draw(Actor* thisx, GlobalContext* globalCtx) { EnSob1* this = THIS; s32 pad; u32 frames; @@ -1676,7 +1667,7 @@ void EnSob1_DrawBombShopkeeper(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_rs_Tex_005458)); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - EnSob1_OverrideLimbDrawBombShopkeeper, EnSob1_PostLimbDrawBombShopkeeper, &this->actor); + EnSob1_BombShopkeeper_OverrideLimbDraw, EnSob1_BombShopkeeper_PostLimbDraw, &this->actor); for (i = 0; i < ARRAY_COUNT(this->items); i++) { this->items[i]->actor.scale.x = 0.2f; this->items[i]->actor.scale.y = 0.2f; diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 733ecb8a66..1ef192571b 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -210,7 +210,7 @@ s32 func_80BAA904(EnSuttari* this, GlobalContext* globalCtx) { void func_80BAA9B4(EnSuttari* this) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); switch (this->textId) { case 0x1454: @@ -221,15 +221,15 @@ void func_80BAA9B4(EnSuttari* this) { case 0x1459: case 0x145A: case 0x145B: - if ((this->animationIdx != 8) && (curFrame == frameCount)) { - this->animationIdx = 8; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if ((this->animationIndex != 8) && (curFrame == frameCount)) { + this->animationIndex = 8; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } break; default: - if ((this->animationIdx != 1) && (curFrame == frameCount)) { - this->animationIdx = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if ((this->animationIndex != 1) && (curFrame == frameCount)) { + this->animationIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } } } @@ -237,8 +237,8 @@ void func_80BAA9B4(EnSuttari* this) { void func_80BAAA94(EnSuttari* this) { switch (this->textId) { case 0x29E5: - this->animationIdx = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); break; case 0x29E9: this->enFsn->flags |= ENFSN_ANGRY; @@ -250,12 +250,12 @@ void func_80BAAA94(EnSuttari* this) { this->enFsn->flags |= ENFSN_OFFER_FINAL_PRICE; break; case 0x29EC: - this->animationIdx = 7; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = 7; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); break; case 0x29ED: - this->animationIdx = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); break; } } @@ -377,14 +377,14 @@ void func_80BAAB78(EnSuttari* this, GlobalContext* globalCtx) { void func_80BAAF1C(EnSuttari* this) { s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); - if (this->animationIdx == 5) { - this->animationIdx = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); - } else if ((this->animationIdx == 3) && (curFrame == frameCount)) { - this->animationIdx = 6; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if (this->animationIndex == 5) { + this->animationIndex = 3; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); + } else if ((this->animationIndex == 3) && (curFrame == frameCount)) { + this->animationIndex = 6; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); this->flags1 &= ~0x100; } } @@ -806,7 +806,7 @@ s32 func_80BAC220(EnSuttari* this, GlobalContext* globalCtx) { void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); switch (this->unk428) { case 12: @@ -815,9 +815,9 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { func_80BABFD4(this, globalCtx); break; case 15: - if ((this->animationIdx == 1) && (curFrame == frameCount)) { - this->animationIdx = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if ((this->animationIndex == 1) && (curFrame == frameCount)) { + this->animationIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } if (!(gSaveContext.weekEventReg[83] & 4) && !(this->flags1 & 0x1000)) { if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { @@ -848,9 +848,9 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { this->flags1 |= 0x80; this->flags1 |= 0x20; this->enFsn->flags &= ~ENFSN_HAGGLE; - if (this->animationIdx != 2) { - this->animationIdx = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if (this->animationIndex != 2) { + this->animationIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } func_80BAC220(this, globalCtx); break; @@ -879,9 +879,9 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { break; case 4: if (!(gSaveContext.weekEventReg[33] & 8)) { - if (this->animationIdx == 2 || this->animationIdx == 1) { - this->animationIdx = 5; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if (this->animationIndex == 2 || this->animationIndex == 1) { + this->animationIndex = 5; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } this->flags1 |= 0x10; if (this->flags2 & 2) { @@ -909,16 +909,16 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { if (globalCtx->sceneNum == SCENE_IKANA) { this->flags1 |= 1; if (gSaveContext.day == 1 || gSaveContext.day == 2) { - this->animationIdx = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); this->flags1 |= 0x80; this->actionFunc = func_80BACA14; return; } else if ((gSaveContext.day == 3) && (gSaveContext.time <= CLOCK_TIME(19, 00)) && !(gSaveContext.weekEventReg[61] & 8) && !(gSaveContext.weekEventReg[33] & 8) && (gSaveContext.weekEventReg[51] & 8)) { - this->animationIdx = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = func_80BACEE0; return; } @@ -933,8 +933,8 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); this->flags1 |= 0x80; this->flags1 |= 8; - this->animationIdx = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); this->actionFunc = func_80BAD004; return; } else if (globalCtx->sceneNum == SCENE_ICHIBA) { @@ -942,8 +942,8 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); return; } - this->animationIdx = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = 0; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); this->flags1 |= 2; this->actionFunc = func_80BAD5F8; return; @@ -952,8 +952,8 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); return; } - this->animationIdx = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + this->animationIndex = 0; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); this->cutscenes[0] = this->actor.cutscene; this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); this->flags1 |= 4; @@ -971,9 +971,9 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { void func_80BACA14(EnSuttari* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (this->animationIdx == 1 || this->animationIdx == 8) { - this->animationIdx = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if (this->animationIndex == 1 || this->animationIndex == 8) { + this->animationIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } func_80BABA90(this, 0, 0); func_80BAB434(this); @@ -1211,11 +1211,11 @@ void func_80BAD5F8(EnSuttari* this, GlobalContext* globalCtx) { u32* unk_14 = &gSaveContext.unk_14; struct_80133038_arg2 unkStruct; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); - if ((curFrame == frameCount) && (this->animationIdx == 0) && (this->flags1 & 0x20)) { - this->animationIdx = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if ((curFrame == frameCount) && (this->animationIndex == 0) && (this->flags1 & 0x20)) { + this->animationIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } this->unk42A = REG(15) + *unk_14; if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) || @@ -1247,14 +1247,14 @@ void func_80BAD7F8(EnSuttari* this, GlobalContext* globalCtx) { u32* unk_14 = &gSaveContext.unk_14; struct_80133038_arg2 unkStruct; s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); if (this->enFsn == NULL) { this->enFsn = (EnFsn*)EnSuttari_GetActorById(globalCtx, ACTOR_EN_FSN); } else { - if ((this->flags1 & 0x2000) && (this->animationIdx == 1) && (curFrame == frameCount)) { - this->animationIdx = 2; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + if ((this->flags1 & 0x2000) && (this->animationIndex == 1) && (curFrame == frameCount)) { + this->animationIndex = 2; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } this->unk42A = REG(15) + *unk_14; if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) || @@ -1296,14 +1296,14 @@ void func_80BADA08(EnSuttari* this, GlobalContext* globalCtx) { void func_80BADA9C(EnSuttari* this, GlobalContext* globalCtx) { u8 talkstate = Message_GetState(&globalCtx->msgCtx); s16 curFrame = this->skelAnime.curFrame; - s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); + s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIndex].animation); if (this->flags1 & 1) { this->unk3F2 = this->unk2DC.y; func_80BAA9B4(this); - } else if ((this->animationIdx == 7) && (curFrame == frameCount)) { - this->animationIdx = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx); + } else if ((this->animationIndex == 7) && (curFrame == frameCount)) { + this->animationIndex = 1; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIndex); } if (talkstate == 5) { if (func_80147624(globalCtx)) { @@ -1449,11 +1449,11 @@ void EnSuttari_Update(Actor* thisx, GlobalContext* globalCtx) { EnSuttari_UpdateTime(); } if (this->unk428 != 0) { - if (this->animationIdx == 2 || this->animationIdx == 6) { + if (this->animationIndex == 2 || this->animationIndex == 6) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 16.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } - } else if (this->animationIdx == 0 || this->animationIdx == 5) { + } else if (this->animationIndex == 0 || this->animationIndex == 5) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h index 9c62be60f6..c6f8cc1530 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h @@ -55,7 +55,7 @@ typedef struct EnSuttari { /* 0x436 */ s16 unk436; /* 0x438 */ Vec3f unk438; /* 0x444 */ Vec3f unk444; - /* 0x450 */ s32 animationIdx; + /* 0x450 */ s32 animationIndex; /* 0x454 */ UNK_TYPE1 unk_454[0x2]; /* 0x456 */ s16 cutscenes[2]; /* 0x45A */ s16 cutsceneIdx; 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 075d42337d..b0b7932119 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -22,11 +22,11 @@ void EnTrt_Update(Actor* thisx, GlobalContext* globalCtx); void EnTrt_Draw(Actor* thisx, GlobalContext* globalCtx); void EnTrt_GetCutscenes(EnTrt* this, GlobalContext* globalCtx); -s32 EnTrt_ReturnItemToShelf(EnTrt* this); void EnTrt_ResetItemPosition(EnTrt* this); +void EnTrt_UpdateHeadYawAndPitch(EnTrt* this, GlobalContext* globalCtx); +s32 EnTrt_ReturnItemToShelf(EnTrt* this); s32 EnTrt_FacingShopkeeperDialogResult(EnTrt* this, GlobalContext* globalCtx); s32 EnTrt_TakeItemOffShelf(EnTrt* this); -void EnTrt_UpdateHeadYawAndPitch(EnTrt* this, GlobalContext* globalCtx); void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx); void EnTrt_IdleSleeping(EnTrt* this, GlobalContext* globalCtx); @@ -786,7 +786,7 @@ void EnTrt_IdleSleeping(EnTrt* this, GlobalContext* globalCtx) { if (DECR(this->timer) == 0) { this->timer = 40; EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 1); - this->animationIdx = 1; + this->animationIndex = 1; this->actionFunc = EnTrt_IdleAwake; this->blinkFunc = EnTrt_OpenThenCloseEyes; } @@ -832,7 +832,7 @@ void EnTrt_IdleAwake(EnTrt* this, GlobalContext* globalCtx) { if (DECR(this->timer) == 0) { this->timer = Rand_S16Offset(150, 100); EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 2); - this->animationIdx = 2; + this->animationIndex = 2; this->sleepSoundTimer = 10; this->actor.textId = 0; this->actionFunc = EnTrt_IdleSleeping; @@ -852,10 +852,10 @@ void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscene); } } else if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { - if (this->animationIdx != 5) { + if (this->animationIndex != 5) { if (curFrame == animLastFrame) { EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 3); - this->animationIdx = 3; + this->animationIndex = 3; this->blinkFunc = EnTrt_OpenEyesThenSetToBlink; this->timer = 10; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; @@ -870,7 +870,7 @@ void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx) { this->timer = Rand_S16Offset(40, 20); EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 5); Message_StartTextbox(globalCtx, this->textId, &this->actor); - this->animationIdx = 5; + this->animationIndex = 5; switch (this->textId) { case 0x834: if (!(gSaveContext.weekEventReg[12] & 8) && !(gSaveContext.weekEventReg[84] & 0x40) && @@ -911,7 +911,7 @@ void EnTrt_Surprised(EnTrt* this, GlobalContext* globalCtx) { } else if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { if (DECR(this->timer) == 0) { EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 4); - this->animationIdx = 4; + this->animationIndex = 4; this->blinkFunc = EnTrt_OpenEyes2; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_SURPRISED); this->timer = 30; @@ -921,7 +921,7 @@ void EnTrt_Surprised(EnTrt* this, GlobalContext* globalCtx) { this->timer = Rand_S16Offset(40, 20); EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 5); Message_StartTextbox(globalCtx, this->textId, &this->actor); - this->animationIdx = 5; + this->animationIndex = 5; this->actionFunc = EnTrt_TryToGiveRedPotionAfterSurprised; } } @@ -1221,10 +1221,7 @@ void EnTrt_UpdateCursorAnim(EnTrt* this) { void EnTrt_UpdateStickDirectionPromptAnim(EnTrt* this) { f32 arrowAnimTween = this->arrowAnimTween; f32 stickAnimTween = this->stickAnimTween; - - // Possbily fake temps - s32 maxColor = 255; - f32 tmp; + s32 maxColor = 255; // POSSIBLY FAKE if (this->arrowAnimState == 0) { arrowAnimTween += 0.05f; @@ -1251,31 +1248,33 @@ void EnTrt_UpdateStickDirectionPromptAnim(EnTrt* this) { stickAnimTween = 0.0f; this->stickAnimState = 0; } - - tmp = 155.0f * arrowAnimTween; - this->stickAnimTween = stickAnimTween; 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.b = COL_CHAN_MIX(0, -100.0f, arrowAnimTween); this->stickLeftPrompt.arrowColor.a = 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.arrowTexX = 290.0f; + + this->stickRightPrompt.arrowColor.r = COL_CHAN_MIX(maxColor, 155.0f, arrowAnimTween); + this->stickRightPrompt.arrowColor.g = COL_CHAN_MIX(255, 155.0f, arrowAnimTween); 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; this->stickRightPrompt.stickTexX = 274.0f; this->stickRightPrompt.stickTexX += 8.0f * stickAnimTween; + this->stickLeftPrompt.stickTexX = 49.0f; this->stickLeftPrompt.stickTexX -= 8.0f * stickAnimTween; - this->stickLeftPrompt.arrowTexY = this->stickRightPrompt.arrowTexY = 91.0f; - this->stickLeftPrompt.stickTexY = this->stickRightPrompt.stickTexY = 95.0f; + this->stickRightPrompt.arrowTexY = 91.0f; + this->stickLeftPrompt.arrowTexY = 91.0f; + + this->stickRightPrompt.stickTexY = 95.0f; + this->stickLeftPrompt.stickTexY = 95.0f; } void EnTrt_OpenEyes(EnTrt* this) { @@ -1451,9 +1450,6 @@ void EnTrt_InitShopkeeper(EnTrt* this, GlobalContext* globalCtx) { } void EnTrt_InitShop(EnTrt* this, GlobalContext* globalCtx) { - u32 maxcolor = 255; - EnTrt* this2; - EnTrt_GetCutscenes(this, globalCtx); this->cutscene = this->lookForwardCutscene; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); @@ -1470,58 +1466,55 @@ void EnTrt_InitShop(EnTrt* this, GlobalContext* globalCtx) { this->actionFunc = EnTrt_IdleSleeping; } + this->cursorPos.y = this->cursorPos.x = 100.0f; this->stickAccumY = 0; this->stickAccumX = 0; + this->cursorIdx = 0; - 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->cursorColor.b = 255; + this->cursorColor.a = 255; this->cursorAnimTween = 0.0f; this->cursorAnimState = 0; this->drawCursor = 0; - this2 = this; - 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.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; - this2->stickLeftPrompt.isEnabled = false; + 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.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; - if (1) {} + 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.arrowColor.r = 255; + 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; + this->stickRightPrompt.isEnabled = false; - 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.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; - this2->stickRightPrompt.isEnabled = false; - - this2->arrowAnimTween = 0.0f; - this2->stickAnimTween = 0.0f; - this2->arrowAnimState = 0; - this2->stickAnimState = 0; - this2->shopItemSelectedTween = 0.0f; + this->arrowAnimTween = 0.0f; + this->stickAnimTween = 0.0f; + this->arrowAnimState = 0; + this->stickAnimState = 0; + this->shopItemSelectedTween = 0.0f; this->actor.gravity = 0.0f; Actor_SetScale(&this->actor, sActorScale); @@ -1544,7 +1537,10 @@ void EnTrt_GetCutscenes(EnTrt* this, GlobalContext* globalCtx) { } void EnTrt_DrawCursor(GlobalContext* globalCtx, EnTrt* this, f32 x, f32 y, f32 z, u8 drawCursor) { - s32 ulx, uly, lrx, lry; + s32 ulx; + s32 uly; + s32 lrx; + s32 lry; f32 w; s32 dsdx; s32 pad; @@ -1554,8 +1550,8 @@ void EnTrt_DrawCursor(GlobalContext* globalCtx, EnTrt* this, f32 x, f32 y, f32 z func_8012C654(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, this->cursorColor.a); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, 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); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, gSelectionCursorTex, 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; ulx = (x - w) * 4.0f; uly = (y - w + -12.0f) * 4.0f; @@ -1570,11 +1566,16 @@ void EnTrt_DrawCursor(GlobalContext* globalCtx, EnTrt* this, f32 x, f32 y, f32 z void EnTrt_DrawTextRec(GlobalContext* globalCtx, s32 r, s32 g, s32 b, s32 a, f32 x, f32 y, f32 z, s32 s, s32 t, f32 dx, f32 dy) { f32 unk; - s32 ulx, uly, lrx, lry; - f32 w, h; - s32 dsdx, dtdy; + s32 ulx; + s32 uly; + s32 lrx; + s32 lry; + f32 w; + f32 h; + s32 dsdx; + s32 dtdy; - ((void)"../z_en_trt.c"); // Unreferenced + (void)"../z_en_trt.c"; OPEN_DISPS(globalCtx->state.gfxCtx); gDPPipeSync(OVERLAY_DISP++); @@ -1600,21 +1601,15 @@ void EnTrt_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnTrt* this) { s32 drawStickRightPrompt = this->stickLeftPrompt.isEnabled; s32 drawStickLeftPrompt = this->stickRightPrompt.isEnabled; - ((void)"../z_en_trt.c"); // Unreferenced + (void)"../z_en_trt.c"; OPEN_DISPS(globalCtx->state.gfxCtx); if (drawStickRightPrompt || drawStickLeftPrompt) { func_8012C654(globalCtx->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); - gDPLoadSync(OVERLAY_DISP++); - gDPLoadBlock(OVERLAY_DISP++, G_TX_LOADTILE, 0, 0, 191, 1024); - gDPPipeSync(OVERLAY_DISP++); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_8b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - 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); + gDPLoadTextureBlock(OVERLAY_DISP++, gArrowCursorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); if (drawStickRightPrompt) { EnTrt_DrawTextRec(globalCtx, this->stickLeftPrompt.arrowColor.r, this->stickLeftPrompt.arrowColor.g, this->stickLeftPrompt.arrowColor.b, this->stickLeftPrompt.arrowColor.a, @@ -1627,15 +1622,9 @@ void EnTrt_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnTrt* this) { this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); - gDPLoadSync(OVERLAY_DISP++); - gDPLoadBlock(OVERLAY_DISP++, G_TX_LOADTILE, 0, 0, 127, 1024); - gDPPipeSync(OVERLAY_DISP++); - gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_8b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, - 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); + gDPLoadTextureBlock(OVERLAY_DISP++, gControlStickTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); if (drawStickRightPrompt) { EnTrt_DrawTextRec(globalCtx, this->stickLeftPrompt.stickColor.r, this->stickLeftPrompt.stickColor.g, this->stickLeftPrompt.stickColor.b, this->stickLeftPrompt.stickColor.a, 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 2df343dfce..eb243317b9 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.h +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.h @@ -41,7 +41,7 @@ typedef struct EnTrt { /* 0x3F0 */ Color_RGBAu32 cursorColor; /* 0x400 */ u8 drawCursor; /* 0x402 */ s16 timer; - /* 0x404 */ s16 animationIdx; + /* 0x404 */ s16 animationIndex; /* 0x406 */ u16 textId; /* 0x408 */ u16 tmpTextId; /* 0x40A */ u16 talkOptionTextId; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index b78680dd4c..e81c1e758e 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -5802,10 +5802,10 @@ 0x808AAB30:("EnOssan_UpdateStickDirectionPromptAnim",), 0x808AACE0:("EnOssan_WaitForBlink",), 0x808AAD14:("EnOssan_Blink",), - 0x808AADB4:("EnOssan_InitCuriosityShopMan",), - 0x808AAE1C:("EnOssan_InitPartTimeWorker",), - 0x808AAE84:("EnOssan_GetWelcomeCuriosityShopMan",), - 0x808AAFB0:("EnOssan_GetWelcomePartTimeWorker",), + 0x808AADB4:("EnOssan_CuriosityShopMan_Init",), + 0x808AAE1C:("EnOssan_PartTimeWorker_Init",), + 0x808AAE84:("EnOssan_CuriosityShopMan_GetWelcome",), + 0x808AAFB0:("EnOssan_PartTimerWorker_GetWelcome",), 0x808AB0B0:("EnOssan_SetHaveMet",), 0x808AB16C:("EnOssan_InitShop",), 0x808AB404:("EnOssan_GetCutscenes",), @@ -5813,12 +5813,12 @@ 0x808AB52C:("EnOssan_DrawCursor",), 0x808AB78C:("EnOssan_DrawTextRec",), 0x808AB928:("EnOssan_DrawStickDirectionPrompts",), - 0x808ABCD0:("EnOssan_OverrideLimbDrawCuriosityShopMan",), - 0x808ABD10:("EnOssan_OverrideLimbDrawPartTimeWorker",), - 0x808ABD60:("EnOssan_PostLimbDrawCuriosityShopMan",), - 0x808ABE18:("EnOssan_PostLimbDrawPartTimeWorker",), - 0x808ABE58:("EnOssan_DrawCuriosityShopMan",), - 0x808ABF30:("EnOssan_DrawPartTimeWorker",), + 0x808ABCD0:("EnOssan_CuriosityShopMan_OverrideLimbDraw",), + 0x808ABD10:("EnOssan_PartTimeWorker_OverrideLimbDraw",), + 0x808ABD60:("EnOssan_CuriosityShopMan_PostLimbDraw",), + 0x808ABE18:("EnOssan_PartTimeWorker_PostLimbDraw",), + 0x808ABE58:("EnOssan_CuriosityShopMan_Draw",), + 0x808ABF30:("EnOssan_PartTimeWorker_Draw",), 0x808AC920:("EnFamos_Init",), 0x808ACB08:("EnFamos_Destroy",), 0x808ACB58:("func_808ACB58",), @@ -9605,7 +9605,7 @@ 0x80A0C938:("EnSob1_GetTalkOption",), 0x80A0CA38:("EnSob1_GetWelcome",), 0x80A0CC88:("EnSob1_GetGoodbye",), - 0x80A0CCEC:("EnSob1_EndInteractionBombShop",), + 0x80A0CCEC:("EnSob1_BombShopkeeper_EndInteraction",), 0x80A0CD48:("EnSob1_SpawnShopItems",), 0x80A0CE10:("EnSob1_GetObjIndices",), 0x80A0CED4:("EnSob1_Init",), @@ -9660,21 +9660,21 @@ 0x80A0F2FC:("EnSob1_Blink",), 0x80A0F39C:("EnSob1_ChangeObject",), 0x80A0F3D4:("EnSob1_AreObjectsLoaded",), - 0x80A0F470:("EnSob1_InitZoraShopkeeper",), - 0x80A0F554:("EnSob1_InitGoronShopkeeper",), - 0x80A0F638:("EnSob1_InitBombShopkeeper",), + 0x80A0F470:("EnSob1_ZoraShopkeeper_Init",), + 0x80A0F554:("EnSob1_GoronShopkeeper_Init",), + 0x80A0F638:("EnSob1_BombShopkeeper_Init",), 0x80A0F6B0:("EnSob1_InitShop",), 0x80A0FA0C:("EnSob1_Update",), 0x80A0FADC:("EnSob1_DrawCursor",), 0x80A0FD4C:("EnSob1_DrawTextRec",), 0x80A0FEE8:("EnSob1_DrawStickDirectionPrompt",), - 0x80A10290:("EnSob1_OverrideLimbDrawZoraShopkeeper",), - 0x80A102C8:("EnSob1_OverrideLimbDrawBombShopkeeper",), - 0x80A10308:("EnSob1_PostLimbDrawBombShopkeeper",), + 0x80A10290:("EnSob1_ZoraShopkeeper_OverrideLimbDraw",), + 0x80A102C8:("EnSob1_BombShopkeeper_OverrideLimbDraw",), + 0x80A10308:("EnSob1_BombShopkeeper_PostLimbDraw",), 0x80A10344:("EnSob1_EndDList",), - 0x80A10368:("EnSob1_DrawZoraShopkeeper",), - 0x80A104E4:("EnSob1_DrawGoronShopkeeper",), - 0x80A10608:("EnSob1_DrawBombShopkeeper",), + 0x80A10368:("EnSob1_ZoraShopkeeper_Draw",), + 0x80A104E4:("EnSob1_GoronShopkeeper_Draw",), + 0x80A10608:("EnSob1_BombShopkeeper_Draw",), 0x80A10FD0:("func_80A10FD0",), 0x80A11144:("func_80A11144",), 0x80A1143C:("func_80A1143C",),