From 41b6509fec2d9f8d3cf6f04bd959f4680c2c6837 Mon Sep 17 00:00:00 2001 From: feacur Date: Thu, 14 Nov 2024 19:31:24 +0100 Subject: [PATCH] restore `limbIndex` naming for this PR https://github.com/zeldaret/oot/pull/2287/commits/43afb7b7cb54aa7b086d8cb7fca4cffaa7d145bf#r1842644602 --- .../actors/ovl_En_Diving_Game/z_en_diving_game.c | 12 ++++++------ src/overlays/actors/ovl_En_Fu/z_en_fu.c | 12 ++++++------ src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 10 +++++----- .../actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 14 ++++++++------ 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index d96b725fee..536be6a77d 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -547,22 +547,22 @@ Gfx* EnDivingGame_EmptyDList(GraphicsContext* gfxCtx) { return displayList; } -s32 EnDivingGame_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { +s32 EnDivingGame_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnDivingGame* this = (EnDivingGame*)thisx; s32 pad; - if (limb == 6) { + if (limbIndex == 6) { rot->x += this->torsoRot.y; } - if (limb == 15) { + if (limbIndex == 15) { rot->x += this->headRot.y; rot->z += this->headRot.z; } - if (this->notPlayingMinigame && (limb == 8 || limb == 9 || limb == 12)) { - rot->y += Math_SinS((play->state.frames * (limb * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y))) * FIDGET_AMPLITUDE; - rot->z += Math_CosS((play->state.frames * (limb * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z))) * FIDGET_AMPLITUDE; + if (this->notPlayingMinigame && (limbIndex == 8 || limbIndex == 9 || limbIndex == 12)) { + rot->y += Math_SinS((play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y))) * FIDGET_AMPLITUDE; + rot->z += Math_CosS((play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z))) * FIDGET_AMPLITUDE; } return 0; diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index f2544a8114..942bb6777e 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -257,14 +257,14 @@ void EnFu_Update(Actor* thisx, PlayState* play) { } } -s32 EnFu_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { +s32 EnFu_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnFu* this = (EnFu*)thisx; s32 pad; - if (limb == FU_LIMB_UNK) { + if (limbIndex == FU_LIMB_UNK) { return false; } - switch (limb) { + switch (limbIndex) { case FU_LIMB_HEAD: rot->x += this->lookAngleOffset.y; rot->z += this->lookAngleOffset.x; @@ -277,9 +277,9 @@ s32 EnFu_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, Ve return false; } - if (limb == FU_LIMB_CHEST_MUSIC_BOX) { - rot->y += Math_SinS((play->state.frames * (limb * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y))) * FIDGET_AMPLITUDE; - rot->z += Math_CosS((play->state.frames * (limb * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z))) * FIDGET_AMPLITUDE; + if (limbIndex == FU_LIMB_CHEST_MUSIC_BOX) { + rot->y += Math_SinS((play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y))) * FIDGET_AMPLITUDE; + rot->z += Math_CosS((play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z))) * FIDGET_AMPLITUDE; } return false; } diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index ff5d4a2a8e..bfd827349a 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -760,11 +760,11 @@ void EnGe1_StopFidget(EnGe1* this) { } } -s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { +s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { s32 pad; EnGe1* this = (EnGe1*)thisx; - if (limb == GE1_LIMB_HEAD) { + if (limbIndex == GE1_LIMB_HEAD) { rot->x += this->headRot.y; rot->z += this->headRot.x; } @@ -776,9 +776,9 @@ s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, V // The purpose of the state flag GE1_STATE_STOP_FIDGET is to skip this code, which this actor has in lieu of an idle // animation. - if ((limb == GE1_LIMB_TORSO) || (limb == GE1_LIMB_L_FOREARM) || (limb == GE1_LIMB_R_FOREARM)) { - rot->y += Math_SinS(play->state.frames * (limb * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y)) * FIDGET_AMPLITUDE; - rot->z += Math_CosS(play->state.frames * (limb * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z)) * FIDGET_AMPLITUDE; + if ((limbIndex == GE1_LIMB_TORSO) || (limbIndex == GE1_LIMB_L_FOREARM) || (limbIndex == GE1_LIMB_R_FOREARM)) { + rot->y += Math_SinS(play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y)) * FIDGET_AMPLITUDE; + rot->z += Math_CosS(play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z)) * FIDGET_AMPLITUDE; } return 0; } diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index c9af199d72..20bbcc9d1f 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -565,21 +565,23 @@ Gfx* EnNiwLady_EmptyDList(GraphicsContext* gfxCtx) { return dList; } -s32 EnNiwLady_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { +s32 EnNiwLady_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnNiwLady* this = (EnNiwLady*)thisx; s32 pad; - if (limb == 15) { + if (limbIndex == 15) { rot->x += this->headRot.y; rot->z += this->headRot.x; } - if (limb == 8) { + if (limbIndex == 8) { rot->x += this->torsoRot.y; } if (this->unk_275 != 0) { - if ((limb == 8) || (limb == 10) || (limb == 13)) { - rot->y += Math_SinS((play->state.frames * (limb * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y))) * FIDGET_AMPLITUDE; - rot->z += Math_CosS((play->state.frames * (limb * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z))) * FIDGET_AMPLITUDE; + if ((limbIndex == 8) || (limbIndex == 10) || (limbIndex == 13)) { + // clang-format off + rot->y += Math_SinS((play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y))) * FIDGET_AMPLITUDE; + rot->z += Math_CosS((play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z))) * FIDGET_AMPLITUDE; + // clang-format on } } return false;