Use hitbox header

This commit is contained in:
octorock
2022-02-27 12:50:05 +01:00
parent 6d1424aad0
commit d37be75c49
42 changed files with 148 additions and 139 deletions
+1 -1
View File
@@ -9,6 +9,7 @@
#include "global.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -19,7 +20,6 @@ typedef struct {
/*0x86*/ u16 unk_86;
} BigIceBlockEntity;
extern const Hitbox gUnk_080FD190;
extern void (*const BigIceBlock_Actions[])(BigIceBlockEntity*);
extern const u16 gUnk_081237B0[];
+2 -1
View File
@@ -9,6 +9,7 @@
#include "global.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -25,7 +26,7 @@ typedef struct {
/*0x86*/ u16 unk_86;
} BossDoorEntity;
extern Hitbox gHitbox_3;
extern bool32 gUnk_02036BB8;
extern const u8 gUnk_0811F740[];
+1 -2
View File
@@ -9,6 +9,7 @@
#include "global.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -19,8 +20,6 @@ typedef struct {
extern u32 sub_080002BC(s32, s32, u32);
extern Hitbox gUnk_080FD2A8;
void sub_080969A4(CrenelBeanSproutEntity*);
void sub_08096A78(CrenelBeanSproutEntity*);
void CrenelBeanSprout_Init(CrenelBeanSproutEntity*);
+2 -1
View File
@@ -10,6 +10,7 @@
#include "object.h"
#include "functions.h"
#include "item.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -21,7 +22,7 @@ typedef struct {
/*0x87*/ u8 unk_87;
} FairyEntity;
extern Hitbox gUnk_080FD1A8;
void sub_0808D76C(FairyEntity*);
void sub_0808DAD0(FairyEntity*);
+2 -2
View File
@@ -7,6 +7,7 @@
#include "item.h"
#include "itemMetaData.h"
#include "functions.h"
#include "hitbox.h"
void sub_08081150(Entity*);
u8 sub_0808147C(u32);
@@ -23,7 +24,6 @@ extern void (*const gUnk_0811E7D4[])(Entity*);
extern void (*const gUnk_0811E7E8[])(Entity*);
extern void (*const gUnk_0811E814[])(Entity*);
extern void (*const gUnk_0811E840[])(Entity*);
extern Hitbox gUnk_080FD1A8;
typedef struct {
u8 unk0[2];
@@ -86,7 +86,7 @@ void sub_08080F20(Entity* this) {
this->field_0x3c = 0x47;
this->hurtType = 0x44;
this->health = 0xFF;
this->hitbox = &gUnk_080FD1A8;
this->hitbox = (Hitbox*)&gUnk_080FD1A8;
switch (this->type) {
case ITEM_SHELLS:
case ITEM_RUPEE1:
+1 -1
View File
@@ -9,6 +9,7 @@
#include "global.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -32,7 +33,6 @@ typedef struct {
} LavaPlatformEntry;
extern void sub_080A2CC0(Entity*, Entity**, u16*);
extern Hitbox gUnk_080FD280;
void sub_08092278(LavaPlatformEntity*);
void sub_08092344(LavaPlatformEntity*);
+3 -3
View File
@@ -5,12 +5,12 @@
#include "room.h"
#include "flags.h"
#include "functions.h"
#include "hitbox.h"
extern void (*const gUnk_081243B4[])(Entity*);
extern void (*const gUnk_081243BC[])(Entity*);
extern void (*const gUnk_081243C4[])(Entity*);
extern Hitbox gHitbox_0;
void LightableSwitch(Entity* this) {
gUnk_081243B4[this->type](this);
@@ -29,7 +29,7 @@ void sub_0809EA34(Entity* this) {
this->hurtType = 0x48;
this->hitType = 0x28;
this->flags2 = 10;
this->hitbox = &gHitbox_0;
this->hitbox = (Hitbox*)&gHitbox_0;
sub_0809EAD8(this);
UpdateSpriteForCollisionLayer(this);
sub_0809EABC(this);
@@ -101,7 +101,7 @@ void sub_0809EB80(Entity* this) {
this->hurtType = 0x48;
this->hitType = 0x28;
this->flags2 = 10;
this->hitbox = &gHitbox_0;
this->hitbox = (Hitbox*)&gHitbox_0;
sub_0809EAD8(this);
UpdateSpriteForCollisionLayer(this);
if (CheckFlags(this->cutsceneBeh.HWORD) != 0) {
+2 -3
View File
@@ -7,6 +7,7 @@
#include "effects.h"
#include "game.h"
#include "common.h"
#include "hitbox.h"
void sub_08083338(Entity*);
void sub_080834B4(Entity*);
@@ -35,8 +36,6 @@ void LockedDoor(Entity* this) {
gUnk_0811F65C[this->action](this);
}
extern Hitbox gHitbox_2;
typedef struct PACKED {
s8 x;
s8 y;
@@ -95,7 +94,7 @@ void sub_08083338(Entity* this) {
this->field_0x70.HALF.LO = this->x.HALF.HI;
this->field_0x70.HALF.HI = this->y.HALF.HI;
this->field_0x7c.BYTES.byte2 = this->type & 3;
this->hitbox = &gHitbox_2;
this->hitbox = (Hitbox*)&gHitbox_2;
this->spritePriority.b0 = 5;
this->frame = this->type & 0xF;
this->field_0x76.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI);
+2 -3
View File
@@ -6,6 +6,7 @@
#include "sound.h"
#include "functions.h"
#include "effects.h"
#include "hitbox.h"
extern u32 sub_08083734(Entity*, u32);
extern void sub_080A080C(Entity*);
@@ -13,8 +14,6 @@ extern void sub_080A0870(Entity*);
extern void (*const gUnk_0812493C[])(Entity*);
extern Hitbox gHitbox_3;
void MetalDoor(Entity* this) {
gUnk_0812493C[this->action](this);
}
@@ -28,7 +27,7 @@ void sub_080A0684(Entity* this) {
this->spriteSettings.draw = 0;
this->frameIndex = 0;
this->spriteSettings.flipY = 1;
this->hitbox = &gHitbox_3;
this->hitbox = (Hitbox*)&gHitbox_3;
this->spritePriority.b0 = 5;
this->field_0x70.HALF.LO = this->x.HALF.HI;
this->field_0x70.HALF.HI = this->y.HALF.HI;
+2 -2
View File
@@ -1,5 +1,6 @@
#include "object.h"
#include "functions.h"
#include "hitbox.h"
extern u32 sub_08091DDC(Entity*);
extern u32 sub_08007DD6(u32, u32);
@@ -8,7 +9,6 @@ extern void sub_08091C0C(Entity*);
extern void (*const gUnk_081223A8[])(Entity*);
extern Hitbox gUnk_080FD310;
extern const s8 gUnk_081223C8[];
extern const u32 gUnk_081223D8[];
@@ -30,7 +30,7 @@ void sub_080916EC(Entity* this) {
this->animationState = unk->field_0x5;
this->type2 = unk->field_0x6;
this->action = 1;
this->hitbox = &gUnk_080FD310;
this->hitbox = (Hitbox*)&gUnk_080FD310;
COLLISION_ON(this);
this->hitType = 1;
this->field_0x3c = 0x47;
+2 -3
View File
@@ -5,8 +5,7 @@
#include "object.h"
#include "functions.h"
#include "game.h"
extern Hitbox gHitbox_2;
#include "hitbox.h"
extern u8 gUpdateVisibleTiles;
@@ -15,7 +14,7 @@ void ObjectA(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->hitbox = &gHitbox_2;
this->hitbox = (Hitbox*)&gHitbox_2;
if (this->collisionLayer == 1) {
uVar2 = 0x26;
} else {
+1 -1
View File
@@ -10,6 +10,7 @@
#include "object.h"
#include "functions.h"
#include "item.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -20,7 +21,6 @@ typedef struct {
/*0x87*/ u8 unk_87;
} ObjectA8Entity;
extern Hitbox gUnk_080FD1A8;
void sub_0809FECC(ObjectA8Entity*);
bool32 sub_0809FE9C(ObjectA8Entity*);
+1 -1
View File
@@ -9,6 +9,7 @@
#include "global.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -29,7 +30,6 @@ typedef struct {
extern bool32 sub_080896B0(void); // pushableStatue
extern Hitbox gUnk_080FD1F4;
extern s16 gUnk_080B4488[];
typedef struct {
+3 -4
View File
@@ -6,6 +6,7 @@
#include "room.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
void sub_08082824(Entity*);
static void sub_08082850(Entity*, Entity*);
@@ -15,8 +16,6 @@ extern void (*const gUnk_0811F090[])(Entity*);
extern void (*const gUnk_0811F0A8[])(Entity*);
extern void (*const gUnk_0811F0C4[])(Entity*);
extern Hitbox gHitbox_18; // TODO: should be const
extern Hitbox gUnk_080FD340; // TODO: should be const
extern void sub_08078930(Entity*);
extern void sub_08016A6C(Entity*);
@@ -32,7 +31,7 @@ void sub_0808222C(Entity* this) {
}
this->action = 1;
this->hitbox = &gHitbox_18;
this->hitbox = (Hitbox*)&gHitbox_18;
this->speed = 0x80;
this->y.HALF.HI += 3;
this->field_0x16 = 0;
@@ -118,7 +117,7 @@ void sub_080824F8(Entity* this) {
void sub_08082510(Entity* this) {
COLLISION_ON(this);
this->hitbox = &gUnk_080FD340;
this->hitbox = (Hitbox*)&gUnk_080FD340;
this->field_0x3c = 7;
this->hitType = 1;
this->flags2 = gPlayerEntity.flags2;
+2 -5
View File
@@ -1,8 +1,7 @@
#define NENT_DEPRECATED
#include "object.h"
#include "functions.h"
u32 IsColliding(Entity*, Entity*);
#include "hitbox.h"
typedef struct {
Entity base;
@@ -22,8 +21,6 @@ PressurePlateAction sub_08088840;
PressurePlateAction sub_0808886C;
PressurePlateAction sub_080888F4;
extern Hitbox gUnk_080FD1D4;
static u32 sub_08088938(PressurePlateEntity*);
static u32 get_standing_count(PressurePlateEntity*);
@@ -50,7 +47,7 @@ void sub_08088840(PressurePlateEntity* this) {
super->action = 1;
super->spriteSettings.draw = 1;
super->spritePriority.b0 = 7;
super->hitbox = &gUnk_080FD1D4;
super->hitbox = (Hitbox*)&gUnk_080FD1D4;
this->dir = super->animationState;
}
+3 -4
View File
@@ -10,6 +10,7 @@
#include "object.h"
#include "functions.h"
#include "sound.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -31,8 +32,6 @@ typedef struct {
enum PullableLeverPart { HANDLE, MIDDLE, SOCKET };
extern u16 gUnk_02021F00[];
extern Hitbox gUnk_080FD270;
extern Hitbox gUnk_080FD278;
extern void (*const PullableLever_HandleActions[])(PullableLeverEntity*);
extern void (*const PullableLever_MiddleActions[])(PullableLeverEntity*);
@@ -76,9 +75,9 @@ void PullableLever_HandleInit(PullableLeverEntity* this) {
super->spriteSettings.draw = 1;
super->speed = 0x60;
if ((super->type2 & 1)) {
super->hitbox = &gUnk_080FD278;
super->hitbox = (Hitbox*)&gUnk_080FD278;
} else {
super->hitbox = &gUnk_080FD270;
super->hitbox = (Hitbox*)&gUnk_080FD270;
}
super->field_0x16 = 1;
super->x.HALF.HI += PullableLever_InitialOffsets[super->type2 * 2];
+1 -1
View File
@@ -10,6 +10,7 @@
#include "object.h"
#include "functions.h"
#include "game.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -20,7 +21,6 @@ typedef struct {
/*0x7c*/ u32 unk_7c;
} PullableMushroomEntity;
extern const Hitbox gUnk_080FD224;
extern const u8 gUnk_08126EE4[];
void PullableMushroom_Init(PullableMushroomEntity*);
+2 -2
View File
@@ -9,6 +9,7 @@
#include "global.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -26,8 +27,7 @@ typedef struct {
/*0x86*/ u16 pushedFlag;
} PushableGraveEntity;
extern const Hitbox gUnk_080FD578;
extern const Hitbox gUnk_080FD570;
extern void (*const gUnk_081232AC[])(PushableGraveEntity*);
extern const u8 gUnk_081232C0[];
+2 -1
View File
@@ -9,6 +9,7 @@
#include "global.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -20,7 +21,7 @@ typedef struct {
/*0x86*/ u16 unk_86;
} PushableStatueEntity;
extern const Hitbox gUnk_080FD1F4;
extern const s16 gUnk_080B4488[];
extern const s16 gUnk_080B4468[];
+2 -2
View File
@@ -1,11 +1,11 @@
#include "object.h"
#include "functions.h"
#include "hitbox.h"
void sub_08086A6C(Entity*);
void (*const gUnk_081206C4[])(Entity*);
extern Hitbox gUnk_080FD1A8;
// Main
void Rupee(Entity* ent) {
@@ -17,7 +17,7 @@ void sub_080869DC(Entity* ent) {
ent->action = 1;
ent->spriteSettings.draw = 0;
ent->hitbox = &gUnk_080FD1A8;
ent->hitbox = (Hitbox*)&gUnk_080FD1A8;
ent->field_0x3c |= 16;
itemEntity = CreateObject(GROUND_ITEM, ent->type, 0);
if (itemEntity != NULL) {
+1 -1
View File
@@ -9,6 +9,7 @@
#include "global.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
typedef struct {
/*0x00*/ Entity base;
@@ -20,7 +21,6 @@ typedef struct {
/*0x86*/ u16 unk_86;
} SmallIceBlockEntity;
extern const Hitbox gUnk_080FD408;
extern const s16 gUnk_080B4488[];
void sub_080996AC(SmallIceBlockEntity*);
+2 -3
View File
@@ -3,8 +3,7 @@
#include "coord.h"
#include "room.h"
#include "object.h"
extern Hitbox gHitbox_1;
#include "hitbox.h"
void TreeThorns(Entity* this) {
Entity* ent;
@@ -23,7 +22,7 @@ void TreeThorns(Entity* this) {
this->hurtType = 0x48;
this->hitType = 0x7a;
this->flags2 = 1;
this->hitbox = &gHitbox_1;
this->hitbox = (Hitbox*)&gHitbox_1;
tilePos = COORD_TO_TILE(this);
SetTile(0x4066, tilePos - 1, *layer);
SetTile(0x4065, tilePos, *layer);
+2 -3
View File
@@ -2,8 +2,7 @@
#include "object.h"
#include "game.h"
#include "functions.h"
extern Hitbox gHitbox_1;
#include "hitbox.h"
extern void sub_0807CAC8(u32);
extern u32 sub_0807CAEC(u32);
@@ -39,7 +38,7 @@ void sub_0808B474(Entity* this) {
tmp = gUnk_08121380[this->type];
this->palette.b.b0 = tmp;
this->spritePriority.b0 = 6;
this->hitbox = &gHitbox_1;
this->hitbox = (Hitbox*)&gHitbox_1;
this->updatePriority = PRIO_NO_BLOCK;
InitializeAnimation(this, 0);
if (CheckFlags(this->field_0x86.HWORD)) {