diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 5d245f2d83..e316b220bd 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1033,7 +1033,7 @@ void EnGo_Update(Actor* thisx, PlayState* play) { if (this->actionFunc == EnGo_BiggoronActionFunc || this->actionFunc == EnGo_FireGenericActionFunc || this->actionFunc == func_80A40B1C) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, GORON_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 18); } EnGo_UpdateShadow(this); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h index 815a2999bd..bd673c9521 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -24,8 +24,6 @@ typedef s16 (*callback2_80A3ED24)(PlayState*, struct EnGo*); #define EN_GO_EFFECT_COUNT 20 -#define GORON_LIMB_MAX 18 - typedef struct EnGoEffect { /* 0x0000 */ u8 type; /* 0x0001 */ u8 timer; @@ -56,8 +54,8 @@ typedef struct EnGo { /* 0x021A */ s16 unk_21A; /* 0x021C */ s16 unk_21C; /* 0x021E */ s16 unk_21E; - /* 0x0220 */ s16 fidgetTableY[GORON_LIMB_MAX]; - /* 0x0244 */ s16 fidgetTableZ[GORON_LIMB_MAX]; + /* 0x0220 */ s16 fidgetTableY[18]; + /* 0x0244 */ s16 fidgetTableZ[18]; /* 0x0268 */ EnGoEffect effects[EN_GO_EFFECT_COUNT]; } EnGo; // size = 0x06C8 diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index ee645b353c..e4e549f735 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -1995,7 +1995,7 @@ void EnGo2_Update(Actor* thisx, PlayState* play) { #endif this->actionFunc(this, play); if (this->unk_211 == true) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, GORON2_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 18); } func_80A45288(this, play); EnGo2_EyeMouthTexState(this); diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.h b/src/overlays/actors/ovl_En_Go2/z_en_go2.h index 2549d3c9b5..6fb6229355 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.h +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.h @@ -67,8 +67,6 @@ typedef struct EnGo2DustEffectData { #define EN_GO2_EFFECT_COUNT 10 -#define GORON2_LIMB_MAX 18 - typedef struct EnGo2 { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; @@ -94,14 +92,14 @@ typedef struct EnGo2 { /* 0x021C */ char unk_21C[0x04]; /* 0x0220 */ f32 alpha; // Set to 0, used by func_80A45360, smoothed to this->actor.shape.shadowAlpha from either 0 or 255.0f /* 0x0224 */ s16 blinkTimer; - /* 0x0226 */ s16 fidgetTableY[GORON2_LIMB_MAX]; - /* 0x024A */ s16 fidgetTableZ[GORON2_LIMB_MAX]; + /* 0x0226 */ s16 fidgetTableY[18]; + /* 0x024A */ s16 fidgetTableZ[18]; /* 0x026E */ u16 trackingMode; /* 0x0270 */ EnGoEffect effects[EN_GO2_EFFECT_COUNT]; /* 0x04A0 */ Vec3f subCamEye; /* 0x04AC */ Vec3f subCamAt; - /* 0x04B8 */ Vec3s jointTable[GORON2_LIMB_MAX]; - /* 0x0524 */ Vec3s morphTable[GORON2_LIMB_MAX]; + /* 0x04B8 */ Vec3s jointTable[18]; + /* 0x0524 */ Vec3s morphTable[18]; /* 0x0590 */ s16 unk_590; // timer /* 0x0592 */ s16 animTimer; // animTimer. Plays NA_SE_EN_MORIBLIN_WALK, NA_SE_EV_IRON_DOOR_OPEN, NA_SE_EV_IRON_DOOR_CLOSE /* 0x0594 */ s32 getItemId; diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 1f61c4301b..93fe37fcce 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -157,7 +157,7 @@ void func_80A505CC(Actor* thisx, PlayState* play) { } Npc_TrackPoint(&this->actor, &this->interactInfo, 6, NPC_TRACKING_HEAD_AND_TORSO); - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, GUEST_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment); diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.h b/src/overlays/actors/ovl_En_Guest/z_en_guest.h index e8592f7f89..2130ebc74e 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.h +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.h @@ -8,20 +8,18 @@ struct EnGuest; typedef void (*EnGuestActionFunc)(struct EnGuest* this, PlayState* play); -#define GUEST_LIMB_MAX 16 - typedef struct EnGuest { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; - /* 0x0190 */ Vec3s jointTable[GUEST_LIMB_MAX]; - /* 0x01F0 */ Vec3s morphTable[GUEST_LIMB_MAX]; + /* 0x0190 */ Vec3s jointTable[16]; + /* 0x01F0 */ Vec3s morphTable[16]; /* 0x0250 */ EnGuestActionFunc actionFunc; /* 0x0254 */ ColliderCylinder collider; /* 0x02A0 */ NpcInteractInfo interactInfo; /* 0x02C8 */ s16 unk_2C8; /* 0x02CA */ s16 unk_2CA; - /* 0x02CC */ s16 fidgetTableY[GUEST_LIMB_MAX]; - /* 0x02EC */ s16 fidgetTableZ[GUEST_LIMB_MAX]; + /* 0x02CC */ s16 fidgetTableY[16]; + /* 0x02EC */ s16 fidgetTableZ[16]; /* 0x030C */ s8 osAnimeObjectSlot; /* 0x030D */ u8 unk_30D; /* 0x030E */ u8 unk_30E; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 26f873c89e..f58a322f82 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -709,7 +709,7 @@ s32 func_80A97D68(EnKo* this, PlayState* play) { s32 func_80A97E18(EnKo* this, PlayState* play) { s16 trackingMode; - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KOKIRI_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); if (EnKo_IsWithinTalkAngle(this) == true) { trackingMode = NPC_TRACKING_HEAD_AND_TORSO; } else { @@ -728,7 +728,7 @@ s32 func_80A97EB0(EnKo* this, PlayState* play) { s16 trackingMode; s32 result; - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KOKIRI_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); result = EnKo_IsWithinTalkAngle(this); trackingMode = (result == true) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; Npc_TrackPoint(&this->actor, &this->interactInfo, 2, trackingMode); @@ -736,7 +736,7 @@ s32 func_80A97EB0(EnKo* this, PlayState* play) { } s32 func_80A97F20(EnKo* this, PlayState* play) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KOKIRI_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); Npc_TrackPoint(&this->actor, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY); return 1; } @@ -748,7 +748,7 @@ s32 func_80A97F70(EnKo* this, PlayState* play) { if ((this->skelAnime.animation == &gKokiriBlockingAnim) == false) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENKO_ANIM_BLOCKING_STATIC); } - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KOKIRI_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); trackingMode = NPC_TRACKING_HEAD_AND_TORSO; } else { if ((this->skelAnime.animation == &gKokiriCuttingGrassAnim) == false) { @@ -768,7 +768,7 @@ s32 func_80A98034(EnKo* this, PlayState* play) { if ((this->skelAnime.animation == &gKokiriBlockingAnim) == false) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENKO_ANIM_BLOCKING_STATIC); } - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KOKIRI_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); result = EnKo_IsWithinTalkAngle(this); trackingMode = (result == true) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; } else { @@ -784,7 +784,7 @@ s32 func_80A98034(EnKo* this, PlayState* play) { // Same as func_80A97F20 s32 func_80A98124(EnKo* this, PlayState* play) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KOKIRI_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); Npc_TrackPoint(&this->actor, &this->interactInfo, 2, NPC_TRACKING_FULL_BODY); return 1; } @@ -798,7 +798,7 @@ s32 func_80A98174(EnKo* this, PlayState* play) { this->skelAnime.playSpeed = 1.0f; } if (this->skelAnime.playSpeed == 0.0f) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KOKIRI_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); } Npc_TrackPoint(&this->actor, &this->interactInfo, 2, (this->skelAnime.playSpeed == 0.0f) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE); diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.h b/src/overlays/actors/ovl_En_Ko/z_en_ko.h index 8b8fb27c28..085e9aca54 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.h +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.h @@ -8,8 +8,6 @@ struct EnKo; typedef void (*EnKoActionFunc)(struct EnKo*, PlayState*); -#define KOKIRI_LIMB_MAX 16 - typedef struct EnKo { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; @@ -28,10 +26,10 @@ typedef struct EnKo { /* 0x0218 */ f32 appearDist; /* 0x021C */ f32 lookDist; // distance to start looking at player /* 0x0220 */ f32 modelAlpha; - /* 0x0224 */ Vec3s jointTable[KOKIRI_LIMB_MAX]; - /* 0x0284 */ Vec3s morphTable[KOKIRI_LIMB_MAX]; - /* 0x02E4 */ s16 fidgetTableY[KOKIRI_LIMB_MAX]; - /* 0x0304 */ s16 fidgetTableZ[KOKIRI_LIMB_MAX]; + /* 0x0224 */ Vec3s jointTable[16]; + /* 0x0284 */ Vec3s morphTable[16]; + /* 0x02E4 */ s16 fidgetTableY[16]; + /* 0x0304 */ s16 fidgetTableZ[16]; } EnKo; // size = 0x0324 typedef enum KokiriChildren { diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index b19296a46c..e1218a636a 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -416,7 +416,7 @@ void EnKz_PreMweepWait(EnKz* this, PlayState* play) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->actionFunc = EnKz_SetupMweep; } else { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KINGZORA_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 12); } } @@ -479,7 +479,7 @@ void EnKz_Wait(EnKz* this, PlayState* play) { this->actionFunc = EnKz_SetupGetItem; EnKz_SetupGetItem(this, play); } else { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, KINGZORA_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 12); } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.h b/src/overlays/actors/ovl_En_Kz/z_en_kz.h index 7cccfd0c9b..b5cd380791 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.h +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.h @@ -8,8 +8,6 @@ struct EnKz; typedef void (*EnKzActionFunc)(struct EnKz*, PlayState*); -#define KINGZORA_LIMB_MAX 12 - typedef struct EnKz { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelanime; @@ -24,10 +22,10 @@ typedef struct EnKz { /* 0x0210 */ s16 eyeIdx; /* 0x0212 */ s16 subCamId; /* 0x0214 */ s16 returnToCamId; - /* 0x0216 */ Vec3s jointTable[KINGZORA_LIMB_MAX]; - /* 0x025E */ Vec3s morphTable[KINGZORA_LIMB_MAX]; - /* 0x02A6 */ s16 fidgetTableY[KINGZORA_LIMB_MAX]; - /* 0x02BE */ s16 fidgetTableZ[KINGZORA_LIMB_MAX]; + /* 0x0216 */ Vec3s jointTable[12]; + /* 0x025E */ Vec3s morphTable[12]; + /* 0x02A6 */ s16 fidgetTableY[12]; + /* 0x02BE */ s16 fidgetTableZ[12]; } EnKz; // size = 0x02D8 #endif diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index 92c9c37530..1ca62ee0aa 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -152,7 +152,7 @@ void EnMu_Destroy(Actor* thisx, PlayState* play) { } void EnMu_Pose(EnMu* this, PlayState* play) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, MU_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16); } void EnMu_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.h b/src/overlays/actors/ovl_En_Mu/z_en_mu.h index 34dd20e984..5ad4c34eca 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.h +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.h @@ -8,9 +8,6 @@ struct EnMu; typedef void (*EnMuActionFunc)(struct EnMu*, struct PlayState*); -#define MU_LIMB_MAX 16 // @note: correct, because `Actor_UpdateFidgetTables` uses it -#define MU_LIMB_MAX_BUG 17 // @bug: should be the same value - typedef struct EnMu { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; @@ -18,8 +15,8 @@ typedef struct EnMu { /* 0x0194 */ ColliderCylinder collider; /* 0x01E0 */ NpcInteractInfo npcInfo; /* 0x0208 */ u16 defaultTextId; - /* 0x020A */ s16 fidgetTableY[MU_LIMB_MAX]; - /* 0x022A */ s16 fidgetTableZ[MU_LIMB_MAX_BUG]; + /* 0x020A */ s16 fidgetTableY[16]; + /* 0x022A */ s16 fidgetTableZ[17]; // @note: looks like a bug, usually tables match } EnMu; // size = 0x024C #endif diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 29b7a79f30..59f955ab3c 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -612,7 +612,7 @@ void EnZo_Destroy(Actor* thisx, PlayState* play) { void EnZo_Standing(EnZo* this, PlayState* play) { s16 angle; - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, ZORA_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 20); EnZo_SetAnimation(this); if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { this->trackingMode = NPC_TRACKING_FULL_BODY; @@ -654,7 +654,7 @@ void EnZo_Surface(EnZo* this, PlayState* play) { } void EnZo_TreadWater(EnZo* this, PlayState* play) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, ZORA_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 20); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->canSpeak = true; this->trackingMode = NPC_TRACKING_FULL_BODY; diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.h b/src/overlays/actors/ovl_En_Zo/z_en_zo.h index 9713b0abd6..4d7a02ddf0 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.h +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.h @@ -21,8 +21,6 @@ typedef struct EnZoEffect { typedef void (*EnZoActionFunc)(struct EnZo*, PlayState*); -#define ZORA_LIMB_MAX 20 - typedef struct EnZo { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; @@ -30,8 +28,8 @@ typedef struct EnZo { /* 0x0194 */ NpcInteractInfo interactInfo; /* 0x01BC */ ColliderCylinder collider; /* 0x0208 */ u8 canSpeak; - /* 0x020A */ Vec3s jointTable[ZORA_LIMB_MAX]; - /* 0x0282 */ Vec3s morphTable[ZORA_LIMB_MAX]; + /* 0x020A */ Vec3s jointTable[20]; + /* 0x0282 */ Vec3s morphTable[20]; /* 0x02FC */ EnZoEffect effects[EN_ZO_EFFECT_COUNT]; /* 0x0644 */ f32 dialogRadius; /* 0x0648 */ f32 alpha; @@ -40,8 +38,8 @@ typedef struct EnZo { /* 0x0650 */ s16 timeToDive; /* 0x0652 */ s16 blinkTimer; /* 0x0654 */ s16 eyeTexture; - /* 0x0656 */ s16 fidgetTableY[ZORA_LIMB_MAX]; - /* 0x067E */ s16 fidgetTableZ[ZORA_LIMB_MAX]; + /* 0x0656 */ s16 fidgetTableY[20]; + /* 0x067E */ s16 fidgetTableZ[20]; } EnZo; // size = 0x06A8 #endif