diff options
| author | theo3 <arisstephenson2@gmail.com> | 2021-12-14 23:31:27 -0800 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2021-12-14 23:31:27 -0800 |
| commit | 34e69959df548688ef8535eb4cab18e5a53992a8 (patch) | |
| tree | d5a822be15b8f06323912e90ad2a25746b47b76e /src/object | |
| parent | 83fc0285020c456beb809d9918515ad1c1c73245 (diff) | |
cleanup
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/bigVortex.c | 2 | ||||
| -rw-r--r-- | src/object/book.c | 2 | ||||
| -rw-r--r-- | src/object/button.c | 16 | ||||
| -rw-r--r-- | src/object/cloud.c | 2 | ||||
| -rw-r--r-- | src/object/greatFairy.c | 4 | ||||
| -rw-r--r-- | src/object/heartContainer.c | 2 | ||||
| -rw-r--r-- | src/object/houseDoorExterior.c | 8 | ||||
| -rw-r--r-- | src/object/itemOnGround.c | 4 | ||||
| -rw-r--r-- | src/object/lilypadSmall.c | 2 | ||||
| -rw-r--r-- | src/object/minecart.c | 2 | ||||
| -rw-r--r-- | src/object/minishSizedEntrance.c | 2 | ||||
| -rw-r--r-- | src/object/object1A.c | 2 | ||||
| -rw-r--r-- | src/object/object86.c | 2 | ||||
| -rw-r--r-- | src/object/objectA2.c | 2 | ||||
| -rw-r--r-- | src/object/warpPoint.c | 4 |
15 files changed, 28 insertions, 28 deletions
diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c index f2743031..5e7f87eb 100644 --- a/src/object/bigVortex.c +++ b/src/object/bigVortex.c @@ -34,7 +34,7 @@ void sub_08098D1C(Entity* this) { this->spriteSettings.draw = TRUE; sub_08098E88(this); } - SetDefaultPriority(this, 6); + SetDefaultPriority(this, PRIO_PLAYER_EVENT); InitAnimationForceUpdate(this, 0); } diff --git a/src/object/book.c b/src/object/book.c index d069a149..3430e4ef 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -211,7 +211,7 @@ void sub_0809B5EC(Entity* this) { u32 sub_0809B688(Entity* this) { u32 ret; - ret = sub_080041A0(this, &gPlayerEntity, 6, 12); + ret = EntityInRectRadius(this, &gPlayerEntity, 6, 12); if (ret == 1 && gPlayerState.field_0xd != 16) { ret = 0; } diff --git a/src/object/button.c b/src/object/button.c index c1efa9ae..4c026baf 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -16,7 +16,7 @@ extern u32 sub_08081E3C(Entity*); void sub_08081AE0(Entity* this) { COLLISION_OFF(this); - this->updatePriority = 3; + this->updatePriority = PRIO_NO_BLOCK; this->y.HALF.HI++; if (this->cutsceneBeh.HWORD != 0) { this->collisionLayer = this->cutsceneBeh.HWORD; @@ -158,11 +158,11 @@ Entity* sub_08081D74(Entity* this) { } } else { if (gPlayerState.flags & 0x400000) { - if (sub_080041A0(this, gUnk_03004040[0], 5, 6)) { + if (EntityInRectRadius(this, gUnk_03004040[0], 5, 6)) { ent = gUnk_03004040[0]; - } else if (sub_080041A0(this, gUnk_03004040[1], 5, 6)) { + } else if (EntityInRectRadius(this, gUnk_03004040[1], 5, 6)) { ent = gUnk_03004040[1]; - } else if (sub_080041A0(this, gUnk_03004040[2], 5, 6)) { + } else if (EntityInRectRadius(this, gUnk_03004040[2], 5, 6)) { ent = gUnk_03004040[2]; } } @@ -176,7 +176,7 @@ u32 sub_08081E0C(Entity* this) { if (tmp->z.HALF.HI != 0 || !sub_08079F8C()) { return 0; } else { - return sub_080041A0(this, tmp, 5, 6); + return EntityInRectRadius(this, tmp, 5, 6); } } @@ -234,13 +234,13 @@ u32 sub_08081F00(u32* unk1, u32* unk2) { void sub_08081F24(Entity* this) { Entity* fx = CreateFx(this, FX_DASH, 0x40); if (fx) { - fx->updatePriority = 3; + fx->updatePriority = PRIO_NO_BLOCK; fx->x.HALF.HI += 7; fx->y.HALF.HI += 5; } fx = CreateFx(this, FX_DASH, 0x40); if (fx) { - fx->updatePriority = 3; + fx->updatePriority = PRIO_NO_BLOCK; fx->x.HALF.HI -= 7; fx->y.HALF.HI += 5; } @@ -252,7 +252,7 @@ u32 sub_08081F7C(Entity* this, u32 r7) { return 1; if (--this->actionDelay > 6) { if (this->child) - this->child->spriteOffsetY = 0xfc; + this->child->spriteOffsetY = -4; } else { if (this->actionDelay == 6) { SetFlag(this->field_0x86.HWORD); diff --git a/src/object/cloud.c b/src/object/cloud.c index 8b53e550..d8915514 100644 --- a/src/object/cloud.c +++ b/src/object/cloud.c @@ -120,7 +120,7 @@ void sub_0809F69C(Entity* this) { void sub_0809F6CC(Entity* this) { if (((gRoomControls.unk6 & 4) == 0) && (--this->actionDelay == 0)) { - gPlayerState.field_0x8b = 1; + gPlayerState.controlMode = 1; DeleteThisEntity(); } } diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c index 0aca5575..e5575a47 100644 --- a/src/object/greatFairy.c +++ b/src/object/greatFairy.c @@ -469,7 +469,7 @@ void GreatFairy_InitializeAnimation(Entity* this) { this->type2 = this->type % temp; this->collisionLayer = 2; InitializeAnimation(this, this->type2); - SetDefaultPriority(this, 2); + SetDefaultPriority(this, PRIO_MESSAGE); } Entity* GreatFairy_CreateForm(Entity* this, u32 curForm, u32 parameter) { @@ -516,7 +516,7 @@ void sub_08087424(Entity* this, ScriptExecutionContext* context) { if (ent != NULL) { ent->parent = &gPlayerEntity; CopyPosition(&gPlayerEntity, ent); - SetDefaultPriority(ent, 2); + SetDefaultPriority(ent, PRIO_MESSAGE); } switch (context->intVariable) { diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c index 7664546c..b0fb32e1 100644 --- a/src/object/heartContainer.c +++ b/src/object/heartContainer.c @@ -31,7 +31,7 @@ static void sub_0808E6A0(Entity* this) { this->spriteSettings.draw = 0; this->hitbox = &gUnk_08121C58; this->collisionLayer = 3; - this->updatePriority = 3; + this->updatePriority = PRIO_NO_BLOCK; } static void sub_0808E6E4(Entity* this) { diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index ae4f133d..b9747788 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -27,7 +27,7 @@ static bool32 sub_080867CC(u32); void sub_0808681C(Entity*); static u8 sub_08086954(Entity*); -extern u32 sub_080562CC(u32, u32, u32, u32); +extern u32 CheckRegionOnScreen(u32, u32, u32, u32); extern void sub_08078AC0(u32, u32, u32); extern void (*const gUnk_081206B4[])(Entity*); @@ -46,14 +46,14 @@ void sub_080866D8(Entity* this) { this->action = 1; *((u32*)(&this->field_0x68)) = 0; this->field_0x6c.HALF.LO = this->actionDelay; - SetDefaultPriority(this, 6); + SetDefaultPriority(this, PRIO_PLAYER_EVENT); } prop = GetCurrentRoomProperty(this->field_0x6c.HALF.LO); for (i = 0; prop->unk0 != 0xFFFF && i < 32; prop++, i++) { int mask = 1 << i; if ((*((u32*)(&this->field_0x68)) & mask) == 0 && sub_080867CC(prop->unk5) && - sub_080562CC(prop->unk0, prop->unk2, 32, 32)) { + CheckRegionOnScreen(prop->unk0, prop->unk2, 32, 32)) { entity = CreateObject(HOUSE_DOOR_EXT, prop->unk7, prop->unk6); if (entity) { entity->field_0x6c.HALF.LO = i; @@ -85,7 +85,7 @@ static bool32 sub_080867CC(u32 arg0) { } void sub_080867E4(Entity* this) { - if (!sub_080562CC(this->field_0x68.HWORD, this->field_0x6a.HWORD, 32, 32)) { + if (!CheckRegionOnScreen(this->field_0x68.HWORD, this->field_0x6a.HWORD, 32, 32)) { *((u32*)(&this->parent->field_0x68)) = *((u32*)(&this->parent->field_0x68)) & ~(1 << this->field_0x6c.HALF.LO); DeleteThisEntity(); } diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index de9e52a0..2c025c77 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -120,7 +120,7 @@ void sub_08080F20(Entity* this) { this->field_0x6c.HWORD = 0; this->field_0x68.HALF.LO = 0; this->actionDelay = 0; - SetDefaultPriority(this, 3); + SetDefaultPriority(this, PRIO_NO_BLOCK); this->field_0x1c = sub_0808147C(this->type); gUnk_0811E7E8[this->field_0x68.HALF.HI](this); } else { @@ -338,7 +338,7 @@ void sub_08081404(Entity* this, u32 arg1) { bool32 sub_08081420(Entity* this) { if (CheckShouldPlayItemGetCutscene(this)) { - SetDefaultPriority(this, 6); + SetDefaultPriority(this, PRIO_PLAYER_EVENT); CreateItemEntity(this->type, this->type2, 0); return TRUE; } else { diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c index b98ff330..ae74c9c8 100644 --- a/src/object/lilypadSmall.c +++ b/src/object/lilypadSmall.c @@ -34,7 +34,7 @@ void LilypadSmall(Entity* this) { u32 sub_08097ADC(Entity* this) { if ((gPlayerState.flags & PL_MINISH) == 0) { return 0; - } else if (sub_080041A0(this, &gPlayerEntity, 8, 8) == 0) { + } else if (EntityInRectRadius(this, &gPlayerEntity, 8, 8) == 0) { return 0; } else if (sub_08079F8C() == 0) { return 0; diff --git a/src/object/minecart.c b/src/object/minecart.c index 002c4946..fe333927 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -94,7 +94,7 @@ void sub_080917DC(Entity* this) { } void sub_080918A4(Entity* this) { - if (sub_080041A0(this, &gPlayerEntity, 2, 2) != 0) { + if (EntityInRectRadius(this, &gPlayerEntity, 2, 2) != 0) { gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; if (gPlayerEntity.z.HALF.HI > -0x10) { diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c index 4d7bc406..9338bca5 100644 --- a/src/object/minishSizedEntrance.c +++ b/src/object/minishSizedEntrance.c @@ -31,7 +31,7 @@ void sub_08090F00(Entity* this) { DeleteThisEntity(); } } - if ((gPlayerState.flags & PL_MINISH) && sub_080041A0(this, &gPlayerEntity, 4, 4) && + if ((gPlayerState.flags & PL_MINISH) && EntityInRectRadius(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 e515a30b..7f76d0f7 100644 --- a/src/object/object1A.c +++ b/src/object/object1A.c @@ -55,6 +55,6 @@ void sub_08086A6C(Entity* ent) { uVar1 = Random(); ent->zVelocity = 163840; - ent->direction = (uVar1 >> 16) & 31; + ent->direction = DirectionNormalize(uVar1 >> 16); ent->speed = uVar1 & 480; } diff --git a/src/object/object86.c b/src/object/object86.c index 6829c813..147e623c 100644 --- a/src/object/object86.c +++ b/src/object/object86.c @@ -56,7 +56,7 @@ void sub_08099E58(Entity* this) { } void sub_08099E8C(Entity* this) { - if (sub_080041A0(this, &gPlayerEntity, 0xc, 0xc)) { + if (EntityInRectRadius(this, &gPlayerEntity, 0xc, 0xc)) { if (this->subAction == 0) { sub_08099ECC(this); RequestPriorityDuration(this, 0x1e); diff --git a/src/object/objectA2.c b/src/object/objectA2.c index de21a664..4bcfa284 100644 --- a/src/object/objectA2.c +++ b/src/object/objectA2.c @@ -40,7 +40,7 @@ void sub_0809F318(Entity* this) { this->spriteOrientation.flipY = 2; this->action = 1; sub_0801D2B4(this, gUnk_08124704[this->type]); - SetDefaultPriority(this, 7); + SetDefaultPriority(this, PRIO_HIGHEST); } void sub_0809F374(Entity* this) { diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index a43d9552..58b2722b 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -41,7 +41,7 @@ void sub_0808B474(Entity* this) { this->palette.b.b0 = tmp; this->spritePriority.b0 = 6; this->hitbox = &gHitbox_1; - this->updatePriority = 3; + this->updatePriority = PRIO_NO_BLOCK; InitializeAnimation(this, 0); if (CheckFlags(this->field_0x86.HWORD)) { sub_0808B830(this); @@ -207,7 +207,7 @@ void sub_0808B73C(Entity* this) { u32 sub_0808B7C8(Entity* this) { if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.field_0xa8 != 0x12 && gPlayerEntity.health != 0 && - sub_08079F8C() && sub_080041A0(this, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) { + sub_08079F8C() && EntityInRectRadius(this, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) { if (this->actionDelay == 0 && gPlayerEntity.action == 0x1b) { sub_080791D0(); } |
