From b7f51cfe82b4787cbc2cc7479c8cafb322d41441 Mon Sep 17 00:00:00 2001 From: Robin Avery Date: Mon, 19 Feb 2024 14:25:14 -0500 Subject: [PATCH 1/2] Remove `it/types.h` dependency on `ft/types.h` --- src/melee/ft/forward.h | 1 - src/melee/ft/types.h | 83 ----------------------------------------- src/melee/it/types.h | 4 +- src/melee/lb/forward.h | 3 +- src/melee/lb/types.h | 83 +++++++++++++++++++++++++++++++++++++++++ src/melee/mp/forward.h | 2 +- src/melee/mp/mpisland.h | 1 + 7 files changed, 89 insertions(+), 88 deletions(-) diff --git a/src/melee/ft/forward.h b/src/melee/ft/forward.h index 91ef0e5f23..55c4cde0de 100644 --- a/src/melee/ft/forward.h +++ b/src/melee/ft/forward.h @@ -10,7 +10,6 @@ #define FIGHTERVARS_SIZE 0xF8 typedef enum_t FtMotionId; -typedef struct CollData CollData; typedef struct Fighter Fighter; typedef struct Fighter_CostumeStrings Fighter_CostumeStrings; typedef struct Fighter_DemoStrings Fighter_DemoStrings; diff --git a/src/melee/ft/types.h b/src/melee/ft/types.h index f66a15c534..44441f7e36 100644 --- a/src/melee/ft/types.h +++ b/src/melee/ft/types.h @@ -725,89 +725,6 @@ struct FighterBone { /* +6 */ u8 filler_x6[7]; }; -typedef struct _ftECB { - Vec2 top; - Vec2 bottom; - Vec2 right; - Vec2 left; -} ftECB; - -typedef struct _ECBFlagStruct { - union { - struct { - u8 b0 : 1; - u8 b1234 : 4; - u8 b5 : 1; - u8 b6 : 1; - u8 b7 : 1; - } bits; - u8 raw; - }; -} ECBFlagStruct; - -typedef struct SurfaceData { - int index; - u32 unk; - Vec3 normal; -} SurfaceData; - -struct CollData { - /* fp+6F0 */ HSD_GObj* x0_gobj; - /* fp+6F4 */ Vec3 x4_vec; - /* fp+700 */ Vec3 x10_vec; - /* fp+70C */ Vec3 x1C_vec; - /* fp+718 */ Vec3 x28_vec; - /* fp+724 */ ECBFlagStruct x34_flags; - /* fp+725 */ ECBFlagStruct x35_flags; - /* fp+726 */ s16 x36; - /* fp+728 */ s32 x38; - /* fp+72C */ s32 x3C; - /* fp+730 */ int ledge_id_unk0; - /* fp+734 */ int ledge_id_unk1; - /* fp+738 */ u32 x48; - /* fp+73C */ u32 x4C; - /* fp+740 */ float x50; - /* fp+744 */ float x54; - /* fp+748 */ float x58; - /* fp+74C */ float x5C; - /* fp+750 */ s32 x60; - /* fp+754 */ ftECB x64_ecb; - /* fp+774 */ ftECB x84_ecb; - /* fp+794 */ ftECB xA4_ecbCurrCorrect; - /* fp+7B4 */ ftECB xC4_ecb; - /* fp+7D4 */ ftECB xE4_ecb; - /// @todo this is the start of a substruct with size 0x2C - /* fp+7F4 */ s32 x104; - /* fp+7F8 */ union { - /* fp+7F8 */ struct { - /* fp+7F8 */ HSD_JObj* x108_joint; - /* fp+7FC */ HSD_JObj* x10C_joint[6]; - }; - /* fp+7F8 */ struct { - /* fp+7F8 */ float x108_f32; - /* fp+7FC */ float x10C_f32; - /* fp+800 */ float x110_f32; - /* fp+804 */ float x114_f32; - /* fp+808 */ float x118_f32; - /* fp+80C */ float x11C_f32; - /* fp+810 */ float x120_f32; - }; - }; - /* fp+814 */ float x124; - /* fp+818 */ float x128; - /* fp+81C */ float x12C; - /* fp+820 */ u32 x130_flags; - /* fp+824 */ s32 env_flags; - /* fp+828 */ s32 prev_env_flags; - /* fp+82C */ s32 x13C; - /* fp+830 */ Vec3 x140; - /* fp+83C */ SurfaceData floor; - /* fp+850 */ SurfaceData right_wall; - /* fp+864 */ SurfaceData left_wall; - /* fp+878 */ SurfaceData ceiling; - /* fp+88C */ s32 x19C; -}; - /* fp+2114 */ typedef struct _SmashAttr { /* fp+2114 */ SmashState state; /// number of frames fp has charged for diff --git a/src/melee/it/types.h b/src/melee/it/types.h index 4e1d6d092d..496eeca2a7 100644 --- a/src/melee/it/types.h +++ b/src/melee/it/types.h @@ -2,16 +2,16 @@ #define MELEE_IT_TYPES_H #include +#include "cm/forward.h" #include "it/forward.h" // IWYU pragma: export -#include "lb/forward.h" #include #include -#include "ft/types.h" #include "it/itCharItems.h" #include "it/itCommonItems.h" #include "it/itPKFlash.h" #include "it/itPKThunder.h" +#include "lb/types.h" #include #include diff --git a/src/melee/lb/forward.h b/src/melee/lb/forward.h index 577883e808..da7b98d4e7 100644 --- a/src/melee/lb/forward.h +++ b/src/melee/lb/forward.h @@ -4,14 +4,15 @@ #include typedef struct AbsorbDesc AbsorbDesc; +typedef struct CollData CollData; typedef struct HitCapsule HitCapsule; typedef struct HitResult HitResult; typedef struct HitVictim HitVictim; typedef struct HurtCapsule HurtCapsule; typedef struct lb_UnkAnimStruct lb_UnkAnimStruct; +typedef struct lbRefract_CallbackData lbRefract_CallbackData; typedef struct ReflectDesc ReflectDesc; typedef struct ShieldDesc ShieldDesc; -typedef struct lbRefract_CallbackData lbRefract_CallbackData; typedef enum HurtCapsuleState { HurtCapsule_Enabled, diff --git a/src/melee/lb/types.h b/src/melee/lb/types.h index 50bcff12a3..979855ce22 100644 --- a/src/melee/lb/types.h +++ b/src/melee/lb/types.h @@ -154,4 +154,87 @@ struct lbRefract_CallbackData { void* callback1; // x20 }; +typedef struct _ECBFlagStruct { + union { + struct { + u8 b0 : 1; + u8 b1234 : 4; + u8 b5 : 1; + u8 b6 : 1; + u8 b7 : 1; + } bits; + u8 raw; + }; +} ECBFlagStruct; + +typedef struct SurfaceData { + int index; + u32 unk; + Vec3 normal; +} SurfaceData; + +typedef struct _ftECB { + Vec2 top; + Vec2 bottom; + Vec2 right; + Vec2 left; +} ftECB; + +struct CollData { + /* fp+6F0 */ HSD_GObj* x0_gobj; + /* fp+6F4 */ Vec3 x4_vec; + /* fp+700 */ Vec3 x10_vec; + /* fp+70C */ Vec3 x1C_vec; + /* fp+718 */ Vec3 x28_vec; + /* fp+724 */ ECBFlagStruct x34_flags; + /* fp+725 */ ECBFlagStruct x35_flags; + /* fp+726 */ s16 x36; + /* fp+728 */ s32 x38; + /* fp+72C */ s32 x3C; + /* fp+730 */ int ledge_id_unk0; + /* fp+734 */ int ledge_id_unk1; + /* fp+738 */ u32 x48; + /* fp+73C */ u32 x4C; + /* fp+740 */ float x50; + /* fp+744 */ float x54; + /* fp+748 */ float x58; + /* fp+74C */ float x5C; + /* fp+750 */ s32 x60; + /* fp+754 */ ftECB x64_ecb; + /* fp+774 */ ftECB x84_ecb; + /* fp+794 */ ftECB xA4_ecbCurrCorrect; + /* fp+7B4 */ ftECB xC4_ecb; + /* fp+7D4 */ ftECB xE4_ecb; + /// @todo this is the start of a substruct with size 0x2C + /* fp+7F4 */ s32 x104; + /* fp+7F8 */ union { + /* fp+7F8 */ struct { + /* fp+7F8 */ HSD_JObj* x108_joint; + /* fp+7FC */ HSD_JObj* x10C_joint[6]; + }; + /* fp+7F8 */ struct { + /* fp+7F8 */ float x108_f32; + /* fp+7FC */ float x10C_f32; + /* fp+800 */ float x110_f32; + /* fp+804 */ float x114_f32; + /* fp+808 */ float x118_f32; + /* fp+80C */ float x11C_f32; + /* fp+810 */ float x120_f32; + }; + }; + /* fp+814 */ float x124; + /* fp+818 */ float x128; + /* fp+81C */ float x12C; + /* fp+820 */ u32 x130_flags; + /* fp+824 */ s32 env_flags; + /* fp+828 */ s32 prev_env_flags; + /* fp+82C */ s32 x13C; + /* fp+830 */ Vec3 x140; + /* fp+83C */ SurfaceData floor; + /* fp+850 */ SurfaceData right_wall; + /* fp+864 */ SurfaceData left_wall; + /* fp+878 */ SurfaceData ceiling; + /* fp+88C */ s32 x19C; +}; + #endif diff --git a/src/melee/mp/forward.h b/src/melee/mp/forward.h index 1bc6687a58..45649925ff 100644 --- a/src/melee/mp/forward.h +++ b/src/melee/mp/forward.h @@ -2,7 +2,7 @@ #define MELEE_MP_FORWARD_H #include -#include "ft/forward.h" +#include "lb/forward.h" typedef struct mp_UnkStruct0 mp_UnkStruct0; typedef struct mp_UnkStruct1 mp_UnkStruct1; diff --git a/src/melee/mp/mpisland.h b/src/melee/mp/mpisland.h index acf8ce4aae..e859734e22 100644 --- a/src/melee/mp/mpisland.h +++ b/src/melee/mp/mpisland.h @@ -2,6 +2,7 @@ #define GALE01_05A6F8 #include "mp/forward.h" +#include #include From 165a7fd7ef9cde56f50577f1b341955aef39df21 Mon Sep 17 00:00:00 2001 From: Robin Avery Date: Mon, 19 Feb 2024 14:28:01 -0500 Subject: [PATCH 2/2] Fix include --- src/melee/it/items/itseakneedleheld.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/melee/it/items/itseakneedleheld.h b/src/melee/it/items/itseakneedleheld.h index 1c2b560179..87635f9ad5 100644 --- a/src/melee/it/items/itseakneedleheld.h +++ b/src/melee/it/items/itseakneedleheld.h @@ -1,6 +1,8 @@ #ifndef GALE01_2B18B0 #define GALE01_2B18B0 +#include "ft/forward.h" + #include "it/types.h" /* 2AFD8C */ Fighter_GObj* it_802AFD8C(Fighter_GObj*, Vec3*, u32, float);