remove redundant unions

This commit is contained in:
theo3
2021-11-12 01:34:34 -08:00
parent f70c95f037
commit ecc8a1439d
257 changed files with 1894 additions and 1923 deletions
+4 -4
View File
@@ -124,14 +124,14 @@ void sub_080ACC78(Entity* this) {
}
*(u32*)&this->field_0x74 += 2;
}
if (this->attachedEntity == NULL && (u32)this->field_0x70.WORD > 2) {
if (this->child == NULL && (u32)this->field_0x70.WORD > 2) {
this->field_0x70.WORD = 1;
}
if (--this->field_0x70.WORD != -1) {
return;
}
if (this->attachedEntity == NULL) {
if (this->child == NULL) {
this->field_0x70.WORD = 2;
} else {
this->field_0x70.WORD = gUnk_0812AABC[this->type];
@@ -173,12 +173,12 @@ ASM_FUNC("asm/non_matching/playerItem10/sub_080ACDB0.inc", bool32 sub_080ACDB0(E
void sub_080ACECC(Entity* this) {
Entity* entity;
if (this->type < 3 && this->attachedEntity == NULL && (s32) * (u32*)&this->field_0x78 >= 0 &&
if (this->type < 3 && this->child == NULL && (s32) * (u32*)&this->field_0x78 >= 0 &&
gUnk_0812AAE8[this->type] <= *(u32*)&this->field_0x78) {
entity = CreatePlayerItem(0x10, this->type + 1, 0, 0);
if (entity != NULL) {
entity->parent = this;
this->attachedEntity = entity;
this->child = entity;
entity->x.HALF.HI = this->x.HALF.HI;
entity->y.HALF.HI = this->y.HALF.HI;
}
+12 -12
View File
@@ -15,7 +15,7 @@ extern u8 gUnk_080B3DE0[];
extern Hitbox* gUnk_080B3DE8[];
void PlayerItem11(Entity* this) {
if (this->currentHealth) {
if (this->health) {
this->iframes = 0;
gUnk_080B3DD0[this->action](this);
} else {
@@ -36,7 +36,7 @@ void sub_08018CBC(Entity* this) {
this->hitType = 0x96;
this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x80;
this->flags2 = gPlayerEntity.flags2;
pEVar3 = this->attachedEntity;
pEVar3 = this->child;
if (pEVar3 != NULL) {
this->action = 1;
COLLISION_OFF(this);
@@ -44,14 +44,14 @@ void sub_08018CBC(Entity* this) {
this->hurtType = 0x1c;
this->damage = 6;
this->hitbox = &gUnk_080B3E18;
this->attachedEntity->spriteOffsetX = 0;
this->attachedEntity->spriteSettings.b.draw = 0;
this->child->spriteOffsetX = 0;
this->child->spriteSettings.draw = 0;
} else {
if (gPlayerState.field_0x1c == 0) {
DeleteThisEntity();
}
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->spriteIndex = 0xa6;
this->palette.raw = 0x33;
this->spriteVramOffset = 0;
@@ -72,7 +72,7 @@ void sub_08018CBC(Entity* this) {
void sub_08018DE8(Entity* this) {
u8 bVar1;
bVar1 = this->attachedEntity->field_0x3a & 4;
bVar1 = this->child->field_0x3a & 4;
if (bVar1 == 0) {
gPlayerState.field_0x1c = bVar1;
DeleteThisEntity();
@@ -82,11 +82,11 @@ void sub_08018DE8(Entity* this) {
sub_08018F6C(this);
break;
case 5:
this->attachedEntity->subAction = 4;
this->child->subAction = 4;
COLLISION_ON(this);
this->action = 2;
this->spritePriority.b0 = 2;
this->attachedEntity->spriteSettings.b.draw = 1;
this->child->spriteSettings.draw = 1;
sub_08018FA0(this);
break;
}
@@ -96,12 +96,12 @@ void sub_08018DE8(Entity* this) {
ASM_FUNC("asm/non_matching/playerItem11/sub_08018E68.inc", void sub_08018E68(Entity* this))
void sub_08018F6C(Entity* this) {
if (this->attachedEntity != NULL) {
this->attachedEntity->subAction = 5;
this->attachedEntity->spriteSettings.b.draw = 1;
if (this->child != NULL) {
this->child->subAction = 5;
this->child->spriteSettings.draw = 1;
} else {
GetNextFrame(this);
if (this->frames.all == 0) {
if (this->frame == 0) {
return;
}
}
+1 -1
View File
@@ -16,7 +16,7 @@ ASM_FUNC("asm/non_matching/playerItem12/sub_080701F8.inc", void sub_080701F8(Ent
void sub_0807037C(Entity* this) {
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
DeleteThisEntity();
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ void PlayerItem14(Entity* this) {
void sub_0805FBE8(Entity* this) {
CopyPosition(&gPlayerEntity, this);
this->action++;
this->spriteSettings.b.draw = TRUE;
this->spriteSettings.draw = TRUE;
this->field_0x3c = gPlayerEntity.field_0x3c + 1;
this->hitbox = &gUnk_08109AD0;
this->speed = 0x380;
+1 -1
View File
@@ -13,7 +13,7 @@ void PlayerItem15(Entity* this) {
}
void sub_080A3084(Entity* this) {
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->action = 0x01;
CopyPosition(this->parent, this);
if (this->type == 0) {
+1 -1
View File
@@ -40,7 +40,7 @@ NONMATCH("asm/non_matching/playerItemBomb/PlayerItemBomb.inc", void PlayerItemBo
this->action = 0x03;
this->spritePriority.b1 = 2;
this->actionDelay = 0x0f;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
sub_0805EC60(this);
sub_08078954(this);
CreateObjectWithParent(this, 0x20, 0, 0);
+4 -4
View File
@@ -32,7 +32,7 @@ void sub_080ADA6C(Entity* this) {
void sub_080ADAA8(Entity* this) {
sub_080ADC84(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->action = 2;
sub_080ADCA0(this, 0);
} else {
@@ -59,15 +59,15 @@ void sub_080ADC14(Entity* this) {
}
void sub_080ADC60(Entity* this) {
if ((this->frames.all & 0x80) != 0) {
this->spriteSettings.b.draw = 0;
if ((this->frame & 0x80) != 0) {
this->spriteSettings.draw = 0;
} else {
UpdateAnimationSingleFrame(this);
}
}
void sub_080ADC84(Entity* this) {
this->spriteSettings.b.flipX = gPlayerEntity.spriteSettings.b.flipX;
this->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
}
ASM_FUNC("asm/non_matching/playerItemGustJar/sub_080ADCA0.inc", void sub_080ADCA0(Entity* this, u32 param_1))
+3 -3
View File
@@ -23,7 +23,7 @@ void PlayerItemSwordBeam(Entity* this) {
void sub_08019498(Entity* this) {
CopyPosition(&gPlayerEntity, this);
this->action += 0x01;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->field_0x3c = gPlayerEntity.field_0x3c + 1;
this->hitbox = &gUnk_080B4408;
this->speed = 0x380;
@@ -38,13 +38,13 @@ void sub_08019498(Entity* this) {
case 0:
this->x.HALF.HI += -3;
this->y.HALF.HI += -8;
this->spriteSettings.raw |= 0x80;
this->spriteSettings.flipY = 1;
break;
case 4:
this->x.HALF.HI += 2;
break;
case 2:
this->spriteSettings.b.flipX = 1;
this->spriteSettings.flipX = 1;
this->x.HALF.HI += 1;
this->y.HALF.HI += -4;
break;