-
Notifications
You must be signed in to change notification settings - Fork 573
Remove global dependencies (1) #1804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #ifndef Z_EN_A_OBJ_H | ||
| #define Z_EN_A_OBJ_H | ||
|
|
||
| #include "z64actor.h" | ||
|
|
||
| typedef enum { | ||
| /* 0 */ AOBJ_SIGNPOST_OBLONG, | ||
| /* 1 */ AOBJ_SIGNPOST_ARROW | ||
| } AObjType; | ||
|
|
||
| struct EnAObj; | ||
|
|
||
| typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*); | ||
|
|
||
| typedef struct EnAObj { | ||
| /* 0x000 */ Actor actor; | ||
| /* 0x144 */ EnAObjActionFunc actionFunc; | ||
| /* 0x148 */ ColliderCylinder collision; | ||
| } EnAObj; // size = 0x194 | ||
|
|
||
| #define AOBJ_GET_TEXTID(thisx) ((((thisx)->params >> 8) & 0xFF) | 0x300) | ||
| #define AOBJ_GET_TYPE(thisx) (((thisx)->params & 0xFF) - 9) | ||
|
|
||
| #define AOBJ_PARAMS(textId, type) ((((textId - 0x300) & 0xFF) << 8) | (type + 9)) | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #ifndef Z_EN_ITEM00_H | ||
| #define Z_EN_ITEM00_H | ||
|
|
||
| #include "ultra64.h" | ||
| #include "z64actor.h" | ||
|
|
||
| typedef enum Item00Type { | ||
| /* 0x00 */ ITEM00_RUPEE_GREEN, | ||
| /* 0x01 */ ITEM00_RUPEE_BLUE, | ||
| /* 0x02 */ ITEM00_RUPEE_RED, | ||
| /* 0x03 */ ITEM00_RECOVERY_HEART, | ||
| /* 0x04 */ ITEM00_BOMBS_A, | ||
| /* 0x05 */ ITEM00_ARROWS_10, | ||
| /* 0x06 */ ITEM00_HEART_PIECE, | ||
| /* 0x07 */ ITEM00_HEART_CONTAINER, | ||
| /* 0x08 */ ITEM00_ARROWS_30, | ||
| /* 0x09 */ ITEM00_ARROWS_40, | ||
| /* 0x0A */ ITEM00_ARROWS_50, | ||
| /* 0x0B */ ITEM00_BOMBS_B, | ||
| /* 0x0C */ ITEM00_DEKU_NUTS_1, | ||
| /* 0x0D */ ITEM00_DEKU_STICK, | ||
| /* 0x0E */ ITEM00_MAGIC_JAR_BIG, | ||
| /* 0x0F */ ITEM00_MAGIC_JAR_SMALL, | ||
| /* 0x10 */ ITEM00_MASK, | ||
| /* 0x11 */ ITEM00_SMALL_KEY, | ||
| /* 0x12 */ ITEM00_FLEXIBLE, | ||
| /* 0x13 */ ITEM00_RUPEE_HUGE, | ||
| /* 0x14 */ ITEM00_RUPEE_PURPLE, | ||
| /* 0x15 */ ITEM00_3_HEARTS, | ||
| /* 0x16 */ ITEM00_SHIELD_HERO, | ||
| /* 0x17 */ ITEM00_DEKU_NUTS_10, | ||
| /* 0x18 */ ITEM00_NOTHING, | ||
| /* 0x19 */ ITEM00_BOMBS_0, | ||
| /* 0x1A */ ITEM00_BIG_FAIRY, | ||
| /* 0x1B */ ITEM00_MAP, | ||
| /* 0x1C */ ITEM00_COMPASS, | ||
| /* 0x1D */ ITEM00_MUSHROOM_CLOUD, | ||
|
|
||
| /* 0xFF */ ITEM00_NO_DROP = -1 | ||
| } Item00Type; | ||
|
|
||
| struct EnItem00; | ||
| struct PlayState; | ||
|
|
||
| typedef void (*EnItem00ActionFunc)(struct EnItem00*, struct PlayState*); | ||
|
|
||
| #define ENITEM00_GET_8000(thisx) ((thisx)->params & 0x8000) | ||
| #define ENITEM00_GET_7F00(thisx) (((thisx)->params & 0x7F00) >> 8) | ||
|
|
||
| typedef struct EnItem00 { | ||
| /* 0x000 */ Actor actor; | ||
| /* 0x144 */ EnItem00ActionFunc actionFunc; | ||
| /* 0x148 */ s16 collectibleFlag; | ||
| /* 0x14A */ s16 getItemId; | ||
| /* 0x14C */ s16 unk14C; | ||
| /* 0x14E */ s16 unk14E; | ||
| /* 0x150 */ s16 unk150; | ||
| /* 0x152 */ s16 unk152; | ||
| /* 0x154 */ f32 unk154; | ||
| /* 0x158 */ ColliderCylinder collider; | ||
| /* 0x1A4 */ s8 unk1A4; | ||
| } EnItem00; // size = 0x1A8 | ||
|
|
||
| Actor* Item_DropCollectible(struct PlayState* play, Vec3f* spawnPos, u32 params); | ||
| Actor* Item_DropCollectible2(struct PlayState* play, Vec3f* spawnPos, s32 params); | ||
| void Item_DropCollectibleRandom(struct PlayState* play, Actor* fromActor, Vec3f* spawnPos, s16 params); | ||
| s32 func_800A8150(s32 index); | ||
| s32 func_800A817C(s32 index); | ||
| bool Item_CanDropBigFairy(struct PlayState* play, s32 index, s32 collectibleFlag); | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,23 @@ | ||
| #include "global.h" | ||
| #include "attributes.h" | ||
| #include "z_en_item00.h" | ||
| #include "overlays/actors/ovl_En_Elf/z_en_elf.h" | ||
| #include "overlays/actors/ovl_En_Elforg/z_en_elforg.h" | ||
|
|
||
| #include "libc64/qrand.h" | ||
| #include "attributes.h" | ||
| #include "gfx.h" | ||
| #include "gfx_setupdl.h" | ||
| #include "ichain.h" | ||
| #include "macros.h" | ||
| #include "rand.h" | ||
| #include "sfx.h" | ||
| #include "sys_matrix.h" | ||
| #include "z64effect.h" | ||
| #include "z64lib.h" | ||
| #include "z64play.h" | ||
|
|
||
| #include "global.h" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It feels kinda dumb adding all those individual headers and then add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i explain why it's not dumb in another comment. As for the question, it's mainly just that I started to take the same approach to removing
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the work is already done, I would kind of say just leave it for now. It does make sense for future PRs though to wait. |
||
| #include "assets/objects/gameplay_keep/gameplay_keep.h" | ||
| #include "assets/objects/object_gi_hearts/object_gi_hearts.h" | ||
| #include "overlays/actors/ovl_En_Elf/z_en_elf.h" | ||
| #include "overlays/actors/ovl_En_Elforg/z_en_elforg.h" | ||
|
|
||
| #define FLAGS 0x00000000 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move those overlays includes to the bottom instead?
Overall the include order and grouping we have been following is more or less the following:
Could you adjust your PR to follow this order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk the more I do this the more convinced I am at just sorting everything by folder, alphabetical order. Why is
attributes.ha "libraries" header? Are there more "libraries" headers hiding in the include folder?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's not how we have been sorting includes, and neither is how we intend to do it, so please change them. For example
z64.his more or less sorted this way.attributes.his kinda a "libraries" header because it doesn't really fit any other categoryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please sort them as we have been. Personally I like them sorted like this as it allows me to more easily find headers by knowing what category they are in (especially the current file header as first since that will generally be the first header I would like to see when looking at a new file).
I will say I'm not sure I agree
attributes.hwould be a library include. I get where that is coming from, but since it is just in the baseincludefolder I would just say its a "game engine" header.