From ecc8a1439ddeedd458af5427711e07e146ed4612 Mon Sep 17 00:00:00 2001 From: theo3 Date: Fri, 12 Nov 2021 01:34:34 -0800 Subject: remove redundant unions --- src/object/archway.c | 2 +- src/object/backgroundCloud.c | 2 +- src/object/bakerOven.c | 8 +++--- src/object/bell.c | 2 +- src/object/bigVortex.c | 8 +++--- src/object/bird.c | 18 ++++++------- src/object/book.c | 12 ++++----- src/object/button.c | 14 +++++----- src/object/chestSpawner.c | 2 +- src/object/cloud.c | 4 +-- src/object/fan.c | 2 +- src/object/fileScreenObjects.c | 34 +++++++++++------------ src/object/giantLeaf.c | 2 +- src/object/greatFairy.c | 40 +++++++++++++-------------- src/object/heartContainer.c | 4 +-- src/object/hiddenLadderDown.c | 4 +-- src/object/houseDoorExterior.c | 4 +-- src/object/itemOnGround.c | 48 ++++++++++++++++----------------- src/object/jailBars.c | 4 +-- src/object/jarPortal.c | 18 ++++++------- src/object/lightableSwitch.c | 6 ++--- src/object/lilypadSmall.c | 10 +++---- src/object/lockedDoor.c | 8 +++--- src/object/mask.c | 6 ++--- src/object/metalDoor.c | 8 +++--- src/object/minecart.c | 16 +++++------ src/object/minishLight.c | 2 +- src/object/minishSizedEntrance.c | 6 ++--- src/object/object1A.c | 12 ++++----- src/object/object1C.c | 2 +- src/object/object2A.c | 4 +-- src/object/object49.c | 58 ++++++++++++++++++++-------------------- src/object/object7E.c | 10 +++---- src/object/object86.c | 10 +++---- src/object/object9E.c | 2 +- src/object/objectA2.c | 12 ++++----- src/object/objectA8.c | 2 +- src/object/objectAF.c | 6 ++--- src/object/objectB2.c | 6 ++--- src/object/pinwheel.c | 2 +- src/object/pot.c | 10 +++---- src/object/railtrack.c | 2 +- src/object/smoke.c | 4 +-- src/object/thoughtBubble.c | 4 +-- src/object/treeHidingPortal.c | 2 +- src/object/warpPoint.c | 16 +++++------ src/object/windTribeFlag.c | 4 +-- 47 files changed, 231 insertions(+), 231 deletions(-) (limited to 'src/object') diff --git a/src/object/archway.c b/src/object/archway.c index 49f3f497..823fa485 100644 --- a/src/object/archway.c +++ b/src/object/archway.c @@ -5,7 +5,7 @@ void Archway(Entity* this) { if (this->action == 0) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->frameIndex = this->type2; this->collisionLayer = 2; UpdateSpriteForCollisionLayer(this); diff --git a/src/object/backgroundCloud.c b/src/object/backgroundCloud.c index aaee8cf2..2ab9051a 100644 --- a/src/object/backgroundCloud.c +++ b/src/object/backgroundCloud.c @@ -13,7 +13,7 @@ void BackgroundCloud(Entity* this) { void sub_0808F658(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteOrientation.flipY = 3; this->spriteRendering.b3 = 3; this->spritePriority.b0 = this->type; diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index 13cb6627..b1c3a1db 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -33,7 +33,7 @@ void sub_0809CC74(Entity* this) { sub_0809CDF0(this); } else { if (this->type2 & 1) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->actionDelay = 20; } else { this->action = 2; @@ -48,7 +48,7 @@ void sub_0809CD0C(Entity* this) { if (this->type) { GetNextFrame(this); - frames = &this->frames.all; + frames = &this->frame; if (*frames & 1) { *frames &= 0xfe; this->y.HALF.HI++; @@ -56,7 +56,7 @@ void sub_0809CD0C(Entity* this) { if ((*frames & 0x80) && this->frameDuration == 1) { this->action = 2; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } /* Damage minish link if he touches a steam cloud */ @@ -79,7 +79,7 @@ void sub_0809CDB4(Entity* this) { this->action = 1; this->actionDelay = 30; this->field_0xf = 0; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->y.HALF.HI = this->parent->y.HALF.HI - 0xe; InitializeAnimation(this, 0); } diff --git a/src/object/bell.c b/src/object/bell.c index 3a1e7d41..a3e7ce3c 100644 --- a/src/object/bell.c +++ b/src/object/bell.c @@ -9,7 +9,7 @@ void Bell(Entity* ent) { void sub_08097D90(Entity* ent) { ent->action = 1; - ent->spriteSettings.b.draw = 1; + ent->spriteSettings.draw = 1; ent->collisionLayer = 1; ent->spritePriority.b0 = 0; UpdateSpriteForCollisionLayer(ent); diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c index 9a06d4ff..a34d7e59 100644 --- a/src/object/bigVortex.c +++ b/src/object/bigVortex.c @@ -23,7 +23,7 @@ void BigVortex(Entity* this) { void sub_08098D1C(Entity* this) { u32 temp; this->action = 1; - this->height.HALF.HI = -0x10; + this->z.HALF.HI = -0x10; temp = this->field_0x86.HWORD; @@ -31,7 +31,7 @@ void sub_08098D1C(Entity* this) { this->action = 1; } else { this->action = 3; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; sub_08098E88(this); } sub_0805E3A0(this, 6); @@ -54,7 +54,7 @@ void sub_08098D6C(Entity* this) { void sub_08098D9C(Entity* this) { if (--this->actionDelay == 0) { this->action = 3; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; sub_08098E88(this); } } @@ -88,7 +88,7 @@ void sub_08098E3C(Entity* this) { if (this->action == 0) { this->action = 1; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; InitAnimationForceUpdate(this, this->type); } temp = &gUnk_08123690[this->type & 2]; diff --git a/src/object/bird.c b/src/object/bird.c index 758a3564..da47a078 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -26,11 +26,11 @@ void sub_0809CF54(Entity* this) { Entity* target; this->action++; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; this->actionDelay = 0x31; this->field_0xf = 1; - this->hVelocity = -0x18000; - this->height.WORD = -0x38C000; + this->zVelocity = -0x18000; + this->z.WORD = -0x38C000; this->field_0x68.HWORD = -0x800; this->speed = 0x280; this->direction = 8; @@ -85,7 +85,7 @@ void sub_0809D084(Entity* this) { PositionRelative(this->parent, this, 0, 0x80000); } else { this->subAction++; - this->hVelocity = temp; + this->zVelocity = temp; } } } @@ -96,7 +96,7 @@ void sub_0809D0AC(Entity* this) { if (sub_080044EC(this, 0x1800) < 2) { this->type = 2; this->action = 1; - this->height.WORD = 0; + this->z.WORD = 0; this->collisionLayer = 1; SetLocalFlag(0x45); SoundReq(SFX_SECRET); @@ -134,14 +134,14 @@ void sub_0809D178(Entity* this) { this->action++; this->collisionLayer = 2; UpdateSpriteForCollisionLayer(this); - this->frames.all = 0x80; + this->frame = 0x80; } - if ((this->frames.all & 0x80) != 0) { + if ((this->frame & 0x80) != 0) { InitializeAnimation(this, Random() & 3); this->frameDuration = (Random() & 0xf) + 0x10; - this->spriteSettings.b.flipX = FALSE; + this->spriteSettings.flipX = FALSE; if ((Random() & 1) != 0) { - this->spriteSettings.b.flipX = TRUE; + this->spriteSettings.flipX = TRUE; } } else { GetNextFrame(this); diff --git a/src/object/book.c b/src/object/book.c index 3c60630c..4b20cf8e 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -31,7 +31,7 @@ void sub_0809B3C4(Entity* this) { } if (obtained != 2) { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } @@ -61,7 +61,7 @@ void sub_0809B3C4(Entity* this) { this->action = 3; scroll = (u16)gRoomControls.roomScrollY - 0x10; height = (u16)this->y.HALF.HI - scroll; - this->height.HALF.HI -= height; + this->z.HALF.HI -= height; return; } case 2: @@ -113,7 +113,7 @@ void sub_0809B524(Entity* this) { if (--this->field_0xf == 0) { this->action = 3; this->y.HALF.HI += 32; - this->height.HALF.HI -= 32; + this->z.HALF.HI -= 32; } else { this->action = 1; this->actionDelay = 22; @@ -152,7 +152,7 @@ void sub_0809B5B4(Entity* this) { } void sub_0809B5EC(Entity* this) { - if (this->spriteSettings.b.draw == 1) { + if (this->spriteSettings.draw == 1) { switch (this->subAction) { case 0: { Entity* parent; @@ -199,7 +199,7 @@ void sub_0809B5EC(Entity* this) { case 1: { u8 doTextBox = gMessage.doTextBox & 0x7f; if (!doTextBox) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->subAction = doTextBox; } break; @@ -225,7 +225,7 @@ void sub_0809B6B0(Entity* parent, Entity* this) { PositionRelative(parent, this, 0, offset); - this->height.HALF.HI = -(this->type << 2); + this->z.HALF.HI = -(this->type << 2); this->spritePriority.b0 = 3 - this->type; } diff --git a/src/object/button.c b/src/object/button.c index 0a1c7fbb..16b1896f 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -167,13 +167,13 @@ Entity* sub_08081D74(Entity* this) { } } } - this->attachedEntity = ent; + this->child = ent; return ent; } u32 sub_08081E0C(Entity* this) { Entity* tmp = &gPlayerEntity; - if (tmp->height.HALF.HI != 0 || !sub_08079F8C()) { + if (tmp->z.HALF.HI != 0 || !sub_08079F8C()) { return 0; } else { return sub_080041A0(this, tmp, 5, 6); @@ -251,8 +251,8 @@ u32 sub_08081F7C(Entity* this, u32 r7) { if (this->actionDelay == 0) return 1; if (--this->actionDelay > 6) { - if (this->attachedEntity) - this->attachedEntity->spriteOffsetY = 0xfc; + if (this->child) + this->child->spriteOffsetY = 0xfc; } else { if (this->actionDelay == 6) { SetFlag(this->field_0x86.HWORD); @@ -272,10 +272,10 @@ extern void sub_080044AE(Entity*, u32, u32); void sub_08081FF8(Entity* this) { u32 direction; u32 i; - if (this->attachedEntity != &gPlayerEntity) + if (this->child != &gPlayerEntity) return; - direction = GetFacingDirection(this->attachedEntity, this); - sub_080044AE(this->attachedEntity, 0x200, direction); + direction = GetFacingDirection(this->child, this); + sub_080044AE(this->child, 0x200, direction); for (i = 0; i < 3; i++) { if (gUnk_03004040[i]) { sub_080044AE(gUnk_03004040[i], 0x200, direction); diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index 3f7e6006..811817d7 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -24,7 +24,7 @@ void sub_08083E08(Entity* this) { void sub_08083E20(Entity* this) { this->action = 3; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteRendering.alphaBlend = 0; sub_080842D8(this); sub_08078828(this); diff --git a/src/object/cloud.c b/src/object/cloud.c index a2c20ff6..75fc7be6 100644 --- a/src/object/cloud.c +++ b/src/object/cloud.c @@ -35,7 +35,7 @@ void sub_0809F4DC(Entity* this) { void sub_0809F514(Entity* this) { this->action = 1; this->actionDelay = 120; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->field_0x68.HALF.LO = 12; gRoomControls.cameraTarget = this; gUnk_02034490[0] = 255; @@ -69,7 +69,7 @@ void sub_0809F5B0(Entity* this) { void sub_0809F5DC(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->field_0x68.HALF.LO = 12; } diff --git a/src/object/fan.c b/src/object/fan.c index 5d800011..0642a17e 100644 --- a/src/object/fan.c +++ b/src/object/fan.c @@ -52,7 +52,7 @@ void sub_0809ED88(Entity* this) { void sub_0809EDE4(Entity* this) { sub_0809F08C(); sub_0809EE44(this); - if (this->frames.b.f3) { + if (this->frame & 0x80) { sub_0809EE34(this); } } diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c index 5c5e419e..9c18f83c 100644 --- a/src/object/fileScreenObjects.c +++ b/src/object/fileScreenObjects.c @@ -46,7 +46,7 @@ extern const u8 gUnk_08121D48[]; extern const struct_08121D54 gUnk_08121D54[]; void FileScreenObjects(Entity* this) { - if (this->currentHealth == 0) { + if (this->health == 0) { sub_0808EFF0(this); } gUnk_08121C64[this->type](this); @@ -62,7 +62,7 @@ void sub_0808E7D8(Entity* this) { void sub_0808E7F0(Entity* this) { sub_080AE008(this, 1, 2); this->palette.b.b0 = 0xF; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->type2 = 0xFF; this->action = 1; } @@ -76,7 +76,7 @@ void sub_0808E818(Entity* this) { this->type2 = var2; this->field_0x68.HWORD = var2; this->field_0x6a.HWORD = var2; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; return; } @@ -111,7 +111,7 @@ void sub_0808E818(Entity* this) { } } - this->spriteSettings.b.flipX = this->animationState == 3; + this->spriteSettings.flipX = this->animationState == 3; var0 = this->field_0x68.HWORD + this->field_0x70.BYTES.byte0 + this->animationState; if (this->field_0x6a.HWORD != var0) { this->field_0x6a.HWORD = var0; @@ -119,7 +119,7 @@ void sub_0808E818(Entity* this) { InitAnimationForceUpdate(this, (u8)var0); } - this->spriteSettings.b.draw = 2; + this->spriteSettings.draw = 2; } static bool32 sub_0808E950(void) { @@ -160,19 +160,19 @@ void sub_0808E988(Entity* this) { if (this->type2 != i) { InitAnimationForceUpdate(this, i); } - this->spriteSettings.b.draw = 2; + this->spriteSettings.draw = 2; return; } } - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } void sub_0808E9F4(Entity* this) { if (sub_0808E950() && gSave.unk6) { - this->spriteSettings.b.draw = 2; + this->spriteSettings.draw = 2; } else { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } @@ -182,9 +182,9 @@ void sub_0808EA28(Entity* this) { if (this->type == 3) { if (gSaveHeader->gameLanguage > LANGUAGE_EN) { - this->spriteSettings.b.draw = 2; + this->spriteSettings.draw = 2; } else { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } @@ -443,9 +443,9 @@ void sub_0808EE98(Entity* this) { void sub_0808EED8(Entity* this) { int var0; if (gUnk_02032EC0.lastState != 3) { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } else { - this->spriteSettings.b.draw = 2; + this->spriteSettings.draw = 2; var0 = this->type - 19; this->palette.b.b0 = gMenu.column_idx == var0 ? 4 : 3; } @@ -454,9 +454,9 @@ void sub_0808EED8(Entity* this) { void sub_0808EF24(Entity* this) { int var0; if (gUnk_02032EC0.lastState != 3) { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } else { - this->spriteSettings.b.draw = 2; + this->spriteSettings.draw = 2; if (this->type == 21) { var0 = ((struct_02000000*)0x2000000)->messageSpeed; } else { @@ -518,9 +518,9 @@ static void sub_0808EFF0(Entity* this) { const struct_08121D54* var0; u8 var1; - this->spriteSettings.b.draw = 2; + this->spriteSettings.draw = 2; this->speed = 0x400; - this->currentHealth = 1; + this->health = 1; this->frameIndex = 0xFF; this->animIndex = 0xFF; var0 = &gUnk_08121D54[this->type]; diff --git a/src/object/giantLeaf.c b/src/object/giantLeaf.c index 9badc65b..a61b267a 100644 --- a/src/object/giantLeaf.c +++ b/src/object/giantLeaf.c @@ -11,7 +11,7 @@ extern s16 gUnk_0812176A[]; void GiantLeaf(Entity* ent) { if (ent->action == 0) { ent->action = 1; - ent->spriteSettings.b.draw = 1; + ent->spriteSettings.draw = 1; ent->spriteRendering.b3 = 3; ent->spritePriority.b0 = 7; ent->frameIndex = ent->type; diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c index 2a2cacf0..8eb5513f 100644 --- a/src/object/greatFairy.c +++ b/src/object/greatFairy.c @@ -109,7 +109,7 @@ void GreatFairy_SpawningUpdate(Entity* this) { SoundReq(SFX_145); this->action = 4; this->actionDelay = 60; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } } } @@ -154,7 +154,7 @@ void GreatFairy_WingsCallBehavior(Entity* this) { void GreatFairy_WingsInit(Entity* this) { GreatFairy_InitializeAnimation(this); this->spritePriority.b0 = 5; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteRendering.alphaBlend = 1; gScreen.controls.layerFXControl = 0xF40; gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 8); @@ -184,7 +184,7 @@ void GreatFairy_WakeCallBehavior(Entity* this) { void GreatFairy_WakeInit(Entity* this) { GreatFairy_InitializeAnimation(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b0 = 6; } @@ -205,7 +205,7 @@ void GreatFairy_MiniInit(Entity* this) { CopyPosition(this, aff); aff->parent = this; GreatFairy_InitializeAnimation(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0xf = 0; } } @@ -215,12 +215,12 @@ void GreatFairy_MiniRisingUpdate(Entity* this) { Entity* target; GetNextFrame(this); - this->height.WORD -= 0x8000; - if (this->height.HALF.HI == -20) { + this->z.WORD -= 0x8000; + if (this->z.HALF.HI == -20) { this->action = 2; SoundReq(SFX_HEART_CONTAINER_SPAWN); } else { - if (((this->height.HALF.HI == -10) && (this->field_0xf == 0)) && + if (((this->z.HALF.HI == -10) && (this->field_0xf == 0)) && (target = GreatFairy_CreateForm(this, DROPLET, 0), target != NULL)) { PositionRelative(this, target, 0, 0x40000); this->field_0xf = 1; @@ -245,7 +245,7 @@ void GreatFairy_MiniAffineCallBehavior(Entity* this) { void GreatFairy_MiniAffineInit(Entity* this) { GreatFairy_InitializeAnimation(this); this->spritePriority.b0 = 6; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } // Getting ready for affine transformation @@ -254,7 +254,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) { CopyPosition(parent, this); - if (this->height.HALF.HI == -20) { + if (this->z.HALF.HI == -20) { this->action = 2; this->actionDelay = 90; this->speed = 4096; @@ -282,15 +282,15 @@ void GreatFairy_DropletCallBehavior(Entity* this) { void GreatFairy_DropletInit(Entity* this) { GreatFairy_InitializeAnimation(this); - this->spriteSettings.b.draw = 1; - this->height.HALF.HI = 0; + this->spriteSettings.draw = 1; + this->z.HALF.HI = 0; this->spritePriority.b0 = 5; SoundReq(SFX_140); } void GreatFairy_DropletUpdate(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { DeleteEntity(this); } } @@ -302,7 +302,7 @@ void GreatFairy_RippleCallBehavior(Entity* this) { void GreatFairy_RippleInit(Entity* this) { GreatFairy_InitializeAnimation(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b0 = 6; } @@ -322,7 +322,7 @@ void GreatFairy_BigRippleCallBehavior(Entity* this) { void GreatFairy_BigRippleInit(Entity* this) { GreatFairy_InitializeAnimation(this); this->actionDelay = 120; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b0 = 5; SoundReq(SFX_TELEPORTER); } @@ -350,13 +350,13 @@ void GreatFairy_EnergyCallBehavior(Entity* this) { void GreatFairy_EnergyInit(Entity* this) { GreatFairy_InitializeAnimation(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b0 = 5; } void GreatFairy_EnergyUpdate(Entity* this) { GetNextFrame(this); - if (this->frames.all & 0x80) { + if (this->frame & 0x80) { DeleteEntity(this); } } @@ -372,7 +372,7 @@ void sub_08087114(Entity* this) { void sub_08087150(Entity* this) { GreatFairy_InitializeAnimation(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteOrientation.flipY = 0; this->spriteRendering.b3 = 0; this->spritePriority.b0 = 3; @@ -401,7 +401,7 @@ void sub_080871D0(Entity* this) { } void sub_080871F8(Entity* this) { - Entity* temp = this->attachedEntity; + Entity* temp = this->child; if ((temp->x.HALF.HI == this->x.HALF.HI) && (temp->y.HALF.HI - 32 == this->y.HALF.HI)) { this->action = 2; @@ -437,7 +437,7 @@ void sub_08087294(Entity* this) { } void sub_080872AC(Entity* this) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteOrientation.flipY = 1; this->spriteRendering.b3 = 0; this->field_0x68.HWORD = this->x.HALF.HI; @@ -458,7 +458,7 @@ void sub_080872F8(Entity* this) { this->direction = (this->direction + gUnk_081207AC[Random() & 3]) & 0x1f; } temp = gSineTable[this->actionDelay + 64]; - this->height.HALF.HI = (temp >> 6) - 8; + this->z.HALF.HI = (temp >> 6) - 8; this->actionDelay++; } diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c index 71d109f4..a2abfbda 100644 --- a/src/object/heartContainer.c +++ b/src/object/heartContainer.c @@ -28,7 +28,7 @@ static void sub_0808E6A0(Entity* this) { } this->action = 1; this->type = 0x62; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->hitbox = &gUnk_08121C58; this->collisionLayer = 3; this->updateConditions = 3; @@ -37,7 +37,7 @@ static void sub_0808E6A0(Entity* this) { static void sub_0808E6E4(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 2; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spriteRendering.b0 = 3; sub_0808E714(this); } diff --git a/src/object/hiddenLadderDown.c b/src/object/hiddenLadderDown.c index 5a176b07..7d1c7abd 100644 --- a/src/object/hiddenLadderDown.c +++ b/src/object/hiddenLadderDown.c @@ -22,7 +22,7 @@ void sub_08091F14(Entity* this) { puVar3 = &this->field_0x70.HALF.LO; if (CheckFlags(this->field_0x86.HWORD) != 0) { this->action = 2; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; SetTileType(0x1a2, *puVar3 - 0x41, this->collisionLayer); SetTileType(0x1a3, *puVar3 - 0x40, this->collisionLayer); SetTileType(0x1a4, *puVar3 - 0x3f, this->collisionLayer); @@ -38,7 +38,7 @@ void sub_08091F14(Entity* this) { void sub_08092000(Entity* this) { if (GetTileType(*(u16*)&this->field_0x70.HALF.LO, this->collisionLayer) == 0x1a6) { this->action = 2; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; SetFlag(this->field_0x86.HWORD); } } diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index 876fdc6a..41a3ee77 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -97,7 +97,7 @@ void sub_0808681C(Entity* this) { case 0: this->action = 1; this->actionDelay = 8; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->frameIndex = 0; this->hitbox = &gUnk_081206AC; if (this->subAction == 1) { @@ -127,7 +127,7 @@ void sub_0808681C(Entity* this) { void sub_080868B0(Entity* this) { if (this->action == 0) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->hitbox = &gUnk_081206AC; this->actionDelay = 8; } diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index f9ac58f6..a5c1770b 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -51,9 +51,9 @@ void ItemOnGround(Entity* this) { case 20: this->action = 3; COLLISION_OFF(this); - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0x3c |= 0x10; - this->attachedEntity = this->field_0x4c; + this->child = this->field_0x4c; break; case 0: case 1: @@ -90,13 +90,13 @@ void sub_08080F20(Entity* this) { } if (this->type != 0x60) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b1 = 3; - this->spriteSettings.b.shadow = 0; + this->spriteSettings.shadow = 0; this->hitType = 7; this->field_0x3c = 0x47; this->hurtType = 0x44; - this->currentHealth = 0xFF; + this->health = 0xFF; this->hitbox = &gUnk_080FD1A8; switch (this->type) { case 0x3f: @@ -150,8 +150,8 @@ void sub_080810A8(Entity* this) { this->direction |= 0xFF; } - if (this->hVelocity == 0) { - this->hVelocity = 0x1E000; + if (this->zVelocity == 0) { + this->zVelocity = 0x1E000; } if (this->collisionLayer == 2) { @@ -180,7 +180,7 @@ void sub_08081134(Entity* this) { void sub_08081150(Entity* this) { this->action = 2; COLLISION_ON(this); - this->height.HALF.HI = -0x80; + this->z.HALF.HI = -0x80; this->spriteOrientation.flipY = 1; this->spriteRendering.b3 = 1; SoundReq(SFX_12D); @@ -196,13 +196,13 @@ void sub_08081188(Entity* this) { void sub_080811AC(Entity* this) { this->action = 2; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->field_0x6e.HWORD = GetTileTypeByEntity(this); } void sub_080811C8(Entity* this) { this->action = 2; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } void sub_080811D8(Entity* this) { @@ -218,7 +218,7 @@ void sub_080811EC(Entity* this) { } sub_08003FC4(this, 0x2800); - if (this->hVelocity <= 0) { + if (this->zVelocity <= 0) { this->action = 2; COLLISION_ON(this); sub_080814A4(this); @@ -262,7 +262,7 @@ void sub_080812A8(Entity* this) { if (sub_080002D0(this) != 0xF && this->field_0x6e.HWORD != GetTileTypeByEntity(this)) { this->direction = 0; this->speed = 0; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->field_0x68.HALF.HI = 0; sub_080810A8(this); } @@ -283,12 +283,12 @@ void nullsub_510(Entity* this) { } void sub_08081328(Entity* this) { - Entity* other = this->attachedEntity; + Entity* other = this->child; if (!(other->kind == 8 && other->id == 3)) { sub_08081404(this, 0); } else { CopyPosition(other, this); - this->height.HALF.HI--; + this->z.HALF.HI--; other = &gPlayerEntity; if (sub_080177A0(this, other)) { sub_080810FC(this); @@ -298,7 +298,7 @@ void sub_08081328(Entity* this) { void sub_0808136C(Entity* this) { if (--this->actionDelay) { - Entity* other = this->attachedEntity; + Entity* other = this->child; this->x.WORD = other->x.WORD; this->y.WORD = other->y.WORD; this->spriteOrientation.flipY = other->spriteOrientation.flipY; @@ -316,7 +316,7 @@ void sub_080813BC(Entity* this) { void sub_080813D4(Entity* this) { this->subAction = 1; this->field_0x1d = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } void sub_080813E8(Entity* this) { @@ -383,7 +383,7 @@ u32 sub_080814C0(Entity* this) { } if (this->field_0x6c.HWORD < 90) { - this->spriteSettings.b.draw ^= 1; + this->spriteSettings.draw ^= 1; } } @@ -413,7 +413,7 @@ void sub_0808153C(Entity* this) { if (this->field_0x68.HALF.LO == 0) { if (!sub_08003FC4(this, 0x1000) && !sub_0800442E(this)) { this->field_0x68.HALF.LO = 1; - this->hVelocity = 0x1E000; + this->zVelocity = 0x1E000; sub_0808148C(this->type); UpdateSpriteForCollisionLayer(this); } @@ -426,20 +426,20 @@ void sub_0808153C(Entity* this) { } void sub_08081598(Entity* this) { - if (this->currentHealth == 0) { + if (this->health == 0) { sub_08081404(this, 1); } COLLISION_OFF(this); this->action = 4; this->actionDelay = 14; - this->hVelocity = 0x20000; - this->spriteSettings.b.draw = 1; + this->zVelocity = 0x20000; + this->spriteSettings.draw = 1; this->spritePriority.b1 = 2; this->spritePriority.b0 = 3; - this->attachedEntity = &gPlayerEntity; - CopyPosition(this->attachedEntity, this); - this->height.HALF.HI -= 4; + this->child = &gPlayerEntity; + CopyPosition(this->child, this); + this->z.HALF.HI -= 4; if (this->type != 0x5F && sub_08081420(this)) { sub_08081404(this, 1); } diff --git a/src/object/jailBars.c b/src/object/jailBars.c index fd534907..da5844e5 100644 --- a/src/object/jailBars.c +++ b/src/object/jailBars.c @@ -24,7 +24,7 @@ void sub_080A08C4(Entity* this) { InitializeAnimation(this, 1); sub_080A0960(this, 1); } - this->spriteSettings.b.draw = 3; // ??? + this->spriteSettings.draw = 3; // ??? this->collisionLayer = 1; UpdateSpriteForCollisionLayer(this); } @@ -39,7 +39,7 @@ void sub_080A0910(Entity* this) { void sub_080A0938(Entity* this) { GetNextFrame(this); - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { this->action = 3; InitializeAnimation(this, 1); } diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index 8262fa0a..b5eddce6 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -63,21 +63,21 @@ void sub_0808BF58(Entity* this) { sub_08003FC4(this, 0x2000); switch (this->subAction) { case 0: - if (this->hVelocity <= 98303) { + if (this->zVelocity <= 98303) { ++this->subAction; InitAnimationForceUpdate(this, 2); } break; case 1: UpdateAnimationSingleFrame(this); - if (!this->height.HALF.HI) { + if (!this->z.HALF.HI) { ++this->subAction; - this->hVelocity = 0x8000; + this->zVelocity = 0x8000; } break; case 2: UpdateAnimationSingleFrame(this); - if (!this->height.HALF.HI) { + if (!this->z.HALF.HI) { ++this->action; this->field_0xf = 0; InitAnimationForceUpdate(this, 1); @@ -131,21 +131,21 @@ void sub_0808C0AC(Entity* this) { sub_08003FC4(this, 0x2000); switch (this->subAction) { case 0: - if (this->hVelocity <= 98303) { + if (this->zVelocity <= 98303) { this->subAction = 1; InitAnimationForceUpdate(this, 3); } break; case 1: UpdateAnimationSingleFrame(this); - if (!this->height.HALF.HI) { + if (!this->z.HALF.HI) { ++this->subAction; - this->hVelocity = 0x8000; + this->zVelocity = 0x8000; } break; case 2: UpdateAnimationSingleFrame(this); - if (!this->height.HALF.HI) { + if (!this->z.HALF.HI) { this->action = 1; InitAnimationForceUpdate(this, 0); sub_0808C148(this, 1); @@ -160,7 +160,7 @@ u32 sub_0808C128(Entity* this) { void sub_0808C13C(Entity* this) { this->subAction = 0; - this->hVelocity = 163840; + this->zVelocity = 163840; } void sub_0808C148(Entity* this, u32 a2) { diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index 1b8d651a..35496766 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -68,8 +68,8 @@ void sub_0809EAD8(Entity* this) { if (this->type2 != 0) { - this->attachedEntity = GetCurrentRoomProperty(this->type2); - sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD); + this->child = GetCurrentRoomProperty(this->type2); + sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD); } else { SetTile(0x4050, COORD_TO_TILE(this), this->collisionLayer); @@ -86,7 +86,7 @@ void sub_0809EB30(Entity* this) { } puVar2 = &this->field_0x74.HWORD; if (!--*puVar2) { - sub_080A2CC0(this, &this->attachedEntity, puVar2); + sub_080A2CC0(this, &this->child, puVar2); } } } diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c index 37f78580..94aec1f7 100644 --- a/src/object/lilypadSmall.c +++ b/src/object/lilypadSmall.c @@ -18,16 +18,16 @@ void LilypadSmall(Entity* this) { rand = Random(); this->field_0xf = rand; this->frameIndex = (rand >> 0x10) & 3; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; this->spritePriority.b0 = 7; - this->attachedEntity = GetCurrentRoomProperty(this->type2); - sub_080A2CC0(this, &this->attachedEntity, &this->field_0x70.HALF.LO); + this->child = GetCurrentRoomProperty(this->type2); + sub_080A2CC0(this, &this->child, &this->field_0x70.HALF.LO); } sub_080A2BE4(this, sub_08097ADC(this)); sub_08097B24(this); psVar4 = (u16*)&this->field_0x70; if (--*psVar4 == 0) { - sub_080A2CC0(this, &this->attachedEntity, psVar4); + sub_080A2CC0(this, &this->child, psVar4); } } @@ -40,7 +40,7 @@ u32 sub_08097ADC(Entity* this) { return 0; } else { gPlayerState.field_0x14 = 1; - if (gPlayerEntity.height.HALF.HI != 0) { + if (gPlayerEntity.z.HALF.HI != 0) { return 0; } else { return 1; diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index d82a3e3d..db9404dd 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -99,7 +99,7 @@ void sub_08083338(Entity* this) { this->field_0x7c.BYTES.byte2 = this->type & 3; this->hitbox = &gUnk_080FD170; this->spritePriority.b0 = 5; - this->frames.all = this->type & 0xF; + this->frame = this->type & 0xF; this->field_0x76.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI); this->field_0x74.HWORD = sub_080001DA(this->field_0x76.HWORD, this->collisionLayer); switch (this->type2) { @@ -225,7 +225,7 @@ void sub_080835F8(Entity* this) { void sub_08083638(Entity* this) { this->action = 7; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->x.HALF.HI = this->field_0x70.HALF.LO; this->y.HALF.HI = this->field_0x70.HALF.HI; } @@ -244,7 +244,7 @@ void sub_08083658(Entity* this) { void sub_080836A0(Entity* this) { this->action = 6; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->x.HALF.HI = this->field_0x70.HALF.LO; this->y.HALF.HI = this->field_0x70.HALF.HI; SetTile(0x4022, this->field_0x76.HWORD, this->collisionLayer); @@ -254,7 +254,7 @@ void sub_080836DC(Entity* this, u32 unk_0, u32 unk_1) { const struct_0811F680* tmp; SetTile(0x4022, unk_1, this->collisionLayer); this->actionDelay = 7; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->direction = (unk_0 << 3) ^ 0x10; tmp = &gUnk_0811F688[unk_0]; if (this->type2 != 2) { diff --git a/src/object/mask.c b/src/object/mask.c index cd94a1b5..c5e0c12d 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -47,7 +47,7 @@ void sub_080929A4(Entity* this) { } this->action = 1; - this->hVelocity = 0x18000; + this->zVelocity = 0x18000; this->field_0x78.HWORD = ((Random() & 7) << 10) | 0x2000; @@ -92,7 +92,7 @@ void sub_08092A94(Entity* this) { this->action = 2; - this->height.HALF.HI -= 0x20; + this->z.HALF.HI -= 0x20; this->y.HALF.HI += 0x20; this->spriteRendering.b3 = 2; @@ -118,7 +118,7 @@ void sub_08092B0C(Entity* this) { } else { sub_080044EC(this, this->field_0x78.HWORD); - if (this->height.HALF.HI == 0) { + if (this->z.HALF.HI == 0) { this->actionDelay++; } } diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index a65cf709..13ac3763 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -25,9 +25,9 @@ void sub_080A0684(Entity* this) { } this->action = 1; this->speed = 0x300; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; this->frameIndex = 0; - this->spriteSettings.b.flipY = 1; + this->spriteSettings.flipY = 1; this->hitbox = &gUnk_080FD180; this->spritePriority.b0 = 5; this->field_0x70.HALF.LO = this->x.HALF.HI; @@ -39,7 +39,7 @@ void sub_080A0718(Entity* this) { if (sub_08083734(this, 2) != 0) { this->action = 2; this->actionDelay = 0xc; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; this->direction = 0; this->y.HALF.HI += 0x24; sub_080A080C(this); @@ -54,7 +54,7 @@ void sub_080A074C(Entity* this) { if (--this->actionDelay == 0) { this->action = 3; - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; this->x.HALF.HI = this->field_0x70.HALF.LO; this->y.HALF.HI = this->field_0x70.HALF.HI; ent = CreateFx(this, FX_DASH, 0x40); diff --git a/src/object/minecart.c b/src/object/minecart.c index a1c79b41..002c4946 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -60,7 +60,7 @@ void sub_080916EC(Entity* this) { void sub_080917DC(Entity* this) { if ((this->bitfield & 0x7f) == 0x1d) { - this->hVelocity = 0x2a000; + this->zVelocity = 0x2a000; this->action = 7; InitAnimationForceUpdate(this, this->type2 + 4 + this->animationState); SoundReq(SFX_13B); @@ -80,7 +80,7 @@ void sub_080917DC(Entity* this) { this->action = this->action + 1; gPlayerState.jumpStatus = 0x81; gPlayerState.flags |= 0x4000000; - gPlayerEntity.hVelocity = 0x20000; + gPlayerEntity.zVelocity = 0x20000; gPlayerEntity.speed = 0x100; gPlayerEntity.flags &= 0x7f; ResetPlayer(); @@ -97,8 +97,8 @@ void sub_080918A4(Entity* this) { if (sub_080041A0(this, &gPlayerEntity, 2, 2) != 0) { gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; - if (gPlayerEntity.height.HALF.HI > -0x10) { - if ((s32)gPlayerEntity.hVelocity > -1) { + if (gPlayerEntity.z.HALF.HI > -0x10) { + if ((s32)gPlayerEntity.zVelocity > -1) { return; } gPlayerEntity.animationState = this->animationState << 1; @@ -118,7 +118,7 @@ void sub_080918A4(Entity* this) { } else { gPlayerEntity.direction = GetFacingDirection(&gPlayerEntity, this); } - if (gPlayerEntity.hVelocity < 0) { + if (gPlayerEntity.zVelocity < 0) { gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1; } } @@ -133,10 +133,10 @@ void sub_080919AC(Entity* this) { return; } - if ((gPlayerEntity.frames.all & 0xf) == 0) { + if ((gPlayerEntity.frame & 0xf) == 0) { COLLISION_OFF(this); CopyPosition(this, &gPlayerEntity); - if ((gPlayerEntity.frames.all & 0xf0) == 0x10) { + if ((gPlayerEntity.frame & 0xf0) == 0x10) { this->spriteOffsetY = 1; } else { this->spriteOffsetY = 0; @@ -175,7 +175,7 @@ void sub_080919AC(Entity* this) { sub_08017744(this); gPlayerState.jumpStatus = 0x41; gPlayerState.flags = (gPlayerState.flags ^ 0x1000) | 0x4000000; - gPlayerEntity.hVelocity = 0x20000; + gPlayerEntity.zVelocity = 0x20000; gPlayerEntity.speed = 0x200; gPlayerEntity.animationState = this->animationState << 1; gPlayerEntity.direction = this->direction; diff --git a/src/object/minishLight.c b/src/object/minishLight.c index 458a0864..d7fc7bb4 100644 --- a/src/object/minishLight.c +++ b/src/object/minishLight.c @@ -14,7 +14,7 @@ void sub_0809F840(Entity* this) { this->field_0xf = 0; if (this->type2 != 0) { - this->spriteSettings.b.flipX = 1; + this->spriteSettings.flipX = 1; } UpdateSpriteForCollisionLayer(this); diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c index ddd776ae..cff1f9ed 100644 --- a/src/object/minishSizedEntrance.c +++ b/src/object/minishSizedEntrance.c @@ -27,12 +27,12 @@ void sub_08090F00(Entity* this) { if (this->type == 1) { Entity* parent = this->parent; u32 mask = 1 << this->field_0xf; - if (!(parent->hVelocity & mask)) { + if (!(parent->zVelocity & mask)) { DeleteThisEntity(); } } - if ((gPlayerState.flags & 0x80) && sub_080041A0(this, &gPlayerEntity, 4, 4) && - (gPlayerEntity.height.HALF.HI == 0) && (((u16)gPlayerState.field_0x90.HALF.LO) & gUnk_0812225C[this->type2])) { + if ((gPlayerState.flags & 0x80) && sub_080041A0(this, &gPlayerEntity, 4, 4) && (gPlayerEntity.z.HALF.HI == 0) && + (((u16)gPlayerState.field_0x90.HALF.LO) & gUnk_0812225C[this->type2])) { DoExitTransition(GetCurrentRoomProperty(this->actionDelay)); } } diff --git a/src/object/object1A.c b/src/object/object1A.c index 494ba821..e515a30b 100644 --- a/src/object/object1A.c +++ b/src/object/object1A.c @@ -19,21 +19,21 @@ void sub_080869DC(Entity* ent) { Entity* itemEntity; ent->action = 1; - ent->spriteSettings.b.draw = 0; + ent->spriteSettings.draw = 0; ent->hitbox = &gUnk_080FD1A8; ent->field_0x3c |= 16; itemEntity = CreateObject(GROUND_ITEM, ent->type, 0); if (itemEntity != NULL) { itemEntity->actionDelay = 10; itemEntity->parent = ent; - ent->attachedEntity = itemEntity; + ent->child = itemEntity; CopyPosition(ent, itemEntity); sub_08086A6C(ent); } } void sub_08086A28(Entity* ent) { - if (ent->attachedEntity->next == NULL) { + if (ent->child->next == NULL) { ent->action = 2; } else { u32 iVar1 = sub_080044EC(ent, 10240); @@ -41,12 +41,12 @@ void sub_08086A28(Entity* ent) { ent->action = 2; } ProcessMovement(ent); - CopyPosition(ent, ent->attachedEntity); + CopyPosition(ent, ent->child); } } void sub_08086A5C(Entity* ent) { - ent->attachedEntity->parent = NULL; + ent->child->parent = NULL; DeleteThisEntity(); } @@ -54,7 +54,7 @@ void sub_08086A6C(Entity* ent) { u32 uVar1; uVar1 = Random(); - ent->hVelocity = 163840; + ent->zVelocity = 163840; ent->direction = (uVar1 >> 16) & 31; ent->speed = uVar1 & 480; } diff --git a/src/object/object1C.c b/src/object/object1C.c index 3bd9af76..be2289cb 100644 --- a/src/object/object1C.c +++ b/src/object/object1C.c @@ -13,7 +13,7 @@ void Object1C(Entity* this) { this->action = 1; } if (CheckRectOnScreen(this->field_0x80.HWORD, this->field_0x82.HWORD, 0x10, 0x10) == 0) { - this->parent->hVelocity &= ~(1 << this->type2); + this->parent->zVelocity &= ~(1 << this->type2); DeleteThisEntity(); } } diff --git a/src/object/object2A.c b/src/object/object2A.c index dca66978..edc742c0 100644 --- a/src/object/object2A.c +++ b/src/object/object2A.c @@ -11,7 +11,7 @@ void Object2A(Entity* this) { void sub_08089B18(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; if (this->type2 != 0) { this->actionDelay = this->type2; } @@ -30,7 +30,7 @@ void sub_08089B18(Entity* this) { break; case 4: if (!CheckFlags(this->field_0x86.HWORD)) { - this->spriteSettings.b.draw = FALSE; + this->spriteSettings.draw = FALSE; this->subAction = 1; return; } diff --git a/src/object/object49.c b/src/object/object49.c index 02aac844..8b7c1bf3 100644 --- a/src/object/object49.c +++ b/src/object/object49.c @@ -34,12 +34,12 @@ void sub_0808F0D0(Entity* this) { u32 uVar3; ent = CreateObjectWithParent(this, OBJECT_49, 2, 0); - this->attachedEntity = ent; + this->child = ent; if (ent == NULL) { DeleteThisEntity(); } this->action = 1; - this->height.HALF.HI = -0xc0; + this->z.HALF.HI = -0xc0; offsetX = Random() % 64; if ((Random() & 1) != 0) { offsetX = -offsetX; @@ -79,7 +79,7 @@ void sub_0808F1A4(Entity* this) { *(u32*)&this->field_0x74 += 0x10; sub_0806FCF4(this, *(u32*)&this->field_0x78, 8, 2); if (*(u32*)&this->field_0x78 > 0x3ff) { - this->attachedEntity->action = 0xff; + this->child->action = 0xff; DeleteThisEntity(); } else { sub_0808F2B0(this); @@ -104,12 +104,12 @@ void sub_0808F1F8(Entity* this) { void sub_0808F244(Entity* this) { - this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw; + this->spriteSettings.draw = this->parent->spriteSettings.draw; this->y.HALF.HI = this->parent->y.HALF.HI + 3; - this->x.HALF.HI = (*(s8*)&this->attachedEntity->spriteOffsetX + this->attachedEntity->x.HALF.HI); - this->height.WORD = 0; - *(u32*)&this->field_0x74 = 0x80 - this->parent->height.HALF.HI; - *(u32*)&this->field_0x78 = 0x100 - this->parent->height.HALF.HI; + this->x.HALF.HI = (*(s8*)&this->child->spriteOffsetX + this->child->x.HALF.HI); + this->z.WORD = 0; + *(u32*)&this->field_0x74 = 0x80 - this->parent->z.HALF.HI; + *(u32*)&this->field_0x78 = 0x100 - this->parent->z.HALF.HI; *(u32*)&this->field_0x70.WORD = *((u8*)&this->parent->field_0x7c + 3); sub_0808F2B0(this); if ((this->parent->field_0x6c.HALF.HI & 2) != 0) { @@ -126,20 +126,20 @@ void sub_0808F2C0(Entity* this) { this->action++; this->spriteRendering.b3 = this->parent->spriteRendering.b3; this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b0 = 7; - this->height.WORD = 0; + this->z.WORD = 0; this->y.HALF.HI = this->parent->y.HALF.HI + 3; this->x.HALF.HI = this->parent->x.HALF.HI; InitializeAnimation(this, 3); } - if (this->parent->height.HALF.HI == 0) { + if (this->parent->z.HALF.HI == 0) { *(u32*)&this->field_0x74 = *(u32*)&this->parent->field_0x74; *(u32*)&this->field_0x78 = *(u32*)&this->parent->field_0x78; } else { - *(u32*)&this->field_0x74 = 0x200 - this->parent->height.HALF.HI; - *(u32*)&this->field_0x78 = this->parent->height.HALF.HI * -2 + 0x300; + *(u32*)&this->field_0x74 = 0x200 - this->parent->z.HALF.HI; + *(u32*)&this->field_0x78 = this->parent->z.HALF.HI * -2 + 0x300; } *(u32*)&this->field_0x70 = 0; sub_0808F2B0(this); @@ -177,39 +177,39 @@ void sub_0808F370(Entity* this) { void sub_0808F3DC(Entity* this) { if (this->action == 0) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->action = 1; this->actionDelay = 120; InitializeAnimation(this, this->type + 1); // TODO: This block of code might supposed to be a switch statement. if (this->type != 8) { if (this->type == 7) { - sub_0806FAD8(this->attachedEntity, this); + sub_0806FAD8(this->child, this); return; } } else { - this->hitType = this->attachedEntity->hitType; - this->attachedEntity->hitType = 0x7E; + this->hitType = this->child->hitType; + this->child->hitType = 0x7E; } - ResolveEntityOnTop(this->attachedEntity, this); + ResolveEntityOnTop(this->child, this); } else { if (*(u32*)&this->parent->field_0x74 == 0) { if (this->type == 8) { - this->attachedEntity->hitType = this->hitType; + this->child->hitType = this->hitType; } DeleteThisEntity(); } - if (this->type == 5 && this->frames.b.f0) { - Entity* entity = CreateObjectWithParent(this->attachedEntity, 0x49, 8, 0); + if (this->type == 5 && (this->frame & 1)) { + Entity* entity = CreateObjectWithParent(this->child, 0x49, 8, 0); if (entity) { entity->parent = this->parent; - entity->attachedEntity = this->parent->parent; + entity->child = this->parent->parent; } } GetNextFrame(this); - CopyPositionAndSpriteOffset(this->attachedEntity, this); + CopyPositionAndSpriteOffset(this->child, this); } } @@ -268,22 +268,22 @@ void sub_0808F554(Entity* this) { } void sub_0808F5EC(Entity* this) { - Entity* entity = CreateObjectWithParent(this->attachedEntity, 0x49, 5, 0); + Entity* entity = CreateObjectWithParent(this->child, 0x49, 5, 0); if (entity) { entity->parent = this; - entity->attachedEntity = this->attachedEntity; + entity->child = this->child; } - entity = CreateObjectWithParent(this->attachedEntity, 0x49, 6, 0); + entity = CreateObjectWithParent(this->child, 0x49, 6, 0); if (entity) { entity->parent = this; - entity->attachedEntity = this->attachedEntity; + entity->child = this->child; } - entity = CreateObjectWithParent(this->attachedEntity, 0x49, 7, 0); + entity = CreateObjectWithParent(this->child, 0x49, 7, 0); if (entity) { entity->parent = this; - entity->attachedEntity = this->attachedEntity; + entity->child = this->child; } *(u32*)&this->field_0x74 = 600; diff --git a/src/object/object7E.c b/src/object/object7E.c index c456a841..15785d8f 100644 --- a/src/object/object7E.c +++ b/src/object/object7E.c @@ -12,15 +12,15 @@ void Object7E(Entity* this) { this->spritePriority.b0 = 7; this->frameIndex = 0x28; if (this->type == 0) { - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; } else if (this->type == 2) { - this->spriteSettings.b.flipX = TRUE; + this->spriteSettings.flipX = TRUE; } } PositionRelative(this->parent, this, 0, 0x80000); - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; if (this->type != 0) { - this->spriteSettings.b.draw = this->attachedEntity->spriteSettings.b.draw; - this->frameIndex = this->attachedEntity->frameIndex + 0x1f; + this->spriteSettings.draw = this->child->spriteSettings.draw; + this->frameIndex = this->child->frameIndex + 0x1f; } } diff --git a/src/object/object86.c b/src/object/object86.c index 717e3ad0..a9bf512d 100644 --- a/src/object/object86.c +++ b/src/object/object86.c @@ -32,11 +32,11 @@ void sub_08099DD0(Entity* this) { void sub_08099E10(Entity* this) { if (CheckLocalFlag(0x74)) { GetNextFrame(this); - if ((this->frames.all == 1) && (this->subAction == 0)) { - this->frames.all = 0; + if ((this->frame == 1) && (this->subAction == 0)) { + this->frame = 0; sub_08099ECC(this); } - if (this->frames.b.f3) { + if (this->frame & 0x80) { this->action = 2; InitializeAnimation(this, 1); } @@ -45,8 +45,8 @@ void sub_08099E10(Entity* this) { void sub_08099E58(Entity* this) { GetNextFrame(this); - if (this->frames.b.f3) { - this->frames.b.f3 = 0; + if (this->frame & 0x80) { + this->frame &= ~0x80; this->actionDelay++; if (this->actionDelay == 3) { this->action = 3; diff --git a/src/object/object9E.c b/src/object/object9E.c index ea6b1787..6fdbdd29 100644 --- a/src/object/object9E.c +++ b/src/object/object9E.c @@ -31,7 +31,7 @@ void Object9E(Entity* this) { UpdateSpriteForCollisionLayer(this); ent = CreateObject(OBJECT_9E, 1, 0); if (ent != NULL) { - this->attachedEntity = ent; + this->child = ent; CopyPosition(this, ent); } } else { diff --git a/src/object/objectA2.c b/src/object/objectA2.c index a2092bb7..09a698a9 100644 --- a/src/object/objectA2.c +++ b/src/object/objectA2.c @@ -32,11 +32,11 @@ void ObjectA2(Entity* this) { void sub_0809F318(Entity* this) { InitializeAnimation(this, 0); if (Random() & 0x10) { - this->spriteSettings.b.flipX = 1; + this->spriteSettings.flipX = 1; } this->x.HALF.HI = 0x28; this->y.HALF.HI = 0x48; - this->height.HALF.HI = 0xFFB0; + this->z.HALF.HI = 0xFFB0; this->spriteOrientation.flipY = 2; this->action = 1; sub_0801D2B4(this, gUnk_08124704[this->type]); @@ -48,7 +48,7 @@ void sub_0809F374(Entity* this) { #ifndef EU if (gSaveHeader->gameLanguage < 2) { if (sub_080044EC(this, 0x2000) < 2) { - this->height.WORD = 0; + this->z.WORD = 0; this->action = 2; InitializeAnimation(this, 1); SoundReq(SFX_186); @@ -76,16 +76,16 @@ void sub_0809F374(Entity* this) { } void sub_0809F3E8(Entity* this) { - if (this->frames.b.f3) { + if (this->frame & 0x80) { this->action = 3; InitializeAnimation(this, 2); } } void sub_0809F408(Entity* this) { - switch (this->frames.all) { + switch (this->frame) { case 9: - this->frames.all = 0; + this->frame = 0; CreateFx(this, FX_BIG_EXPLOSION2, 0); gMenu.field_0x0 = 1; break; diff --git a/src/object/objectA8.c b/src/object/objectA8.c index c1a5193a..fbba13c3 100644 --- a/src/object/objectA8.c +++ b/src/object/objectA8.c @@ -21,7 +21,7 @@ void ObjectA8(Entity* this) { case 0x1e: case 0x1f: this->action = 5; - this->attachedEntity = &gPlayerEntity; + this->child = &gPlayerEntity; CreateItemEntity(this->type, 0, 0); DeleteThisEntity(); } diff --git a/src/object/objectAF.c b/src/object/objectAF.c index b678d81b..0aff1ed3 100644 --- a/src/object/objectAF.c +++ b/src/object/objectAF.c @@ -19,7 +19,7 @@ void sub_080A05A4(Entity* this) { } else { this->action = 2; this->y.HALF.HI++; - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; this->spriteOffsetY--; InitializeAnimation(this, 3); } @@ -40,7 +40,7 @@ void sub_080A05F4(Entity* this) { void sub_080A0624(Entity* this) { GetNextFrame(this); - if ((this->frames.b.f3) != 0) { + if (this->frame & 0x80) { DeleteThisEntity(); } } @@ -51,5 +51,5 @@ void sub_080A0640(Entity* this) { } else { CopyPosition(this->parent, this); } - this->height.HALF.HI = 0; + this->z.HALF.HI = 0; } diff --git a/src/object/objectB2.c b/src/object/objectB2.c index 0888ed38..75150bab 100644 --- a/src/object/objectB2.c +++ b/src/object/objectB2.c @@ -19,16 +19,16 @@ void ObjectB2(Entity* this) { } else { pEVar3 = &gUnk_02027EB4; } - this->attachedEntity = pEVar3; + this->child = pEVar3; InitializeAnimation(this, this->type); } this->speed = this->parent->speed; sub_0806F69C(this); - if (sub_080AE4CC(this->attachedEntity, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) { + if (sub_080AE4CC(this->child, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) { DeleteThisEntity(); } if (this->speed < 0x41) { - this->spriteSettings.b.draw ^= 1; + this->spriteSettings.draw ^= 1; if (--this->actionDelay == 0) { DeleteThisEntity(); diff --git a/src/object/pinwheel.c b/src/object/pinwheel.c index 7de61338..37234dc5 100644 --- a/src/object/pinwheel.c +++ b/src/object/pinwheel.c @@ -10,7 +10,7 @@ extern u16 gUnk_08125050[]; extern void (*gUnk_0812505C[])(Entity*); void Pinwheel(Entity* this) { - u16 x = this->currentHealth; + u16 x = this->health; if ((x & 0x7f) != 0) { if (ReadBit(&gUnk_020342F8, x - 1) == 0) { DeleteThisEntity(); diff --git a/src/object/pot.c b/src/object/pot.c index ce0fa0bf..58989f44 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -38,7 +38,7 @@ void sub_0808222C(Entity* this) { this->y.HALF.HI += 3; this->field_0x16 = 0; COLLISION_ON(this); - this->currentHealth = 1; + this->health = 1; this->field_0x3c = 7; this->hitType = 0x6E; this->flags2 = 0x84; @@ -67,9 +67,9 @@ void sub_08082310(Entity* this) { case 0x1D: SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); this->action = 5; - this->hVelocity = 0x2A000; + this->zVelocity = 0x2A000; this->spriteOffsetY = 0; - this->spriteSettings.b.shadow = 1; + this->spriteSettings.shadow = 1; this->spritePriority.b1 = 3; COLLISION_OFF(this); sub_08082824(this); @@ -251,8 +251,8 @@ void sub_08082818(Entity* this) { } void sub_08082824(Entity* this) { - if (this->hVelocity < 0) { - this->spriteSettings.b.flipY = 1; + if (this->zVelocity < 0) { + this->spriteSettings.flipY = 1; } if (sub_08003FC4(this, 0x2000) == 0) { diff --git a/src/object/railtrack.c b/src/object/railtrack.c index 52a74bc3..00fbb4ec 100644 --- a/src/object/railtrack.c +++ b/src/object/railtrack.c @@ -22,7 +22,7 @@ void sub_080851AC(Entity* this) { u32 uVar1; this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; this->spritePriority.b0 = 7; if ((this->type2 & 1) != 0) { this->field_0x7c.HALF.LO = -1; diff --git a/src/object/smoke.c b/src/object/smoke.c index 565daa79..17ec7ad0 100644 --- a/src/object/smoke.c +++ b/src/object/smoke.c @@ -36,7 +36,7 @@ void sub_0808A46C(Entity* this) { void sub_0808A484(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = TRUE; + this->spriteSettings.draw = TRUE; this->speed = 0x40; this->direction = 6; this->spriteRendering.b3 = 1; @@ -48,7 +48,7 @@ void sub_0808A484(Entity* this) { void sub_0808A4D0(Entity* this) { GetNextFrame(this); sub_0806F69C(this); - if (this->frames.b.f3) { + if (this->frame & 0x80) { DeleteEntity(this); } } diff --git a/src/object/thoughtBubble.c b/src/object/thoughtBubble.c index 70ad3c73..1789195b 100644 --- a/src/object/thoughtBubble.c +++ b/src/object/thoughtBubble.c @@ -13,7 +13,7 @@ void ThoughtBubble(Entity* this) { void ThoughtBubble_Init(Entity* this) { this->action = 1; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; if (this->actionDelay == 0) { this->actionDelay = 0x2d; } @@ -26,7 +26,7 @@ void ThoughtBubble_Update(Entity* this) { if (this->parent != NULL) { this->x.HALF.HI = this->parent->x.HALF.HI; this->y.HALF.HI = this->parent->y.HALF.HI; - this->height.HALF.HI = this->parent->height.HALF.HI; + this->z.HALF.HI = this->parent->z.HALF.HI; } if (this->type2 != 2) { if (--this->actionDelay == 0) { diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c index dcaf3ebc..94ba273a 100644 --- a/src/object/treeHidingPortal.c +++ b/src/object/treeHidingPortal.c @@ -52,7 +52,7 @@ void sub_0809E8BC(Entity* this) { if (--this->actionDelay == 0) { this->action = 3; this->actionDelay = 0x3c; - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; sub_0809E96C(this); sub_0809E918(this); } diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index fc6239d1..d20ceadf 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -77,7 +77,7 @@ void sub_0808B564(Entity* this) { if (!--this->field_0xf) { this->action = 3; } else { - this->spriteSettings.b.draw = this->field_0xf & 2 ? 0 : 1; + this->spriteSettings.draw = this->field_0xf & 2 ? 0 : 1; } } @@ -177,7 +177,7 @@ void sub_0808B684(Entity* this) { tmp = 1; } } else { - gPlayerEntity.spriteSettings.b.draw = 0; + gPlayerEntity.spriteSettings.draw = 0; } break; } @@ -194,20 +194,20 @@ void sub_0808B73C(Entity* this) { InitializeAnimation(this, 1); } if (sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28)) { - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; } else { if (sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x2e)) { - this->spriteSettings.b.draw ^= 1; + this->spriteSettings.draw ^= 1; } else { - this->spriteSettings.b.draw = 0; + this->spriteSettings.draw = 0; } } GetNextFrame(this); } u32 sub_0808B7C8(Entity* this) { - if (!(gPlayerState.flags & 0x80) && gPlayerState.field_0xa8 != 0x12 && gPlayerEntity.currentHealth != 0 && - sub_08079F8C() && sub_080041A0(this, &gPlayerEntity, 5, 5) && gPlayerEntity.height.HALF.HI == 0) { + if (!(gPlayerState.flags & 0x80) && gPlayerState.field_0xa8 != 0x12 && gPlayerEntity.health != 0 && + sub_08079F8C() && sub_080041A0(this, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) { if (this->actionDelay == 0 && gPlayerEntity.action == 0x1b) { sub_080791D0(); } @@ -220,7 +220,7 @@ void sub_0808B830(Entity* this) { Entity* tmp; this->action = 3; this->actionDelay = 0; - this->spriteSettings.b.draw = 1; + this->spriteSettings.draw = 1; tmp = CreateObject(0x34, 0, 0); if (tmp) { tmp->field_0x70.BYTES.byte0 = 1; diff --git a/src/object/windTribeFlag.c b/src/object/windTribeFlag.c index bc9d0fa3..1fcfea7d 100644 --- a/src/object/windTribeFlag.c +++ b/src/object/windTribeFlag.c @@ -7,9 +7,9 @@ void WindTribeFlag(Entity* this) { this->action++; this->collisionLayer = 2; if (this->type == 0) { - this->spriteSettings.b.flipX = 0; + this->spriteSettings.flipX = 0; } else { - this->spriteSettings.b.flipX = 1; + this->spriteSettings.flipX = 1; } UpdateSpriteForCollisionLayer(this); InitializeAnimation(this, 0); -- cgit v1.2.3