summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2022-03-17 19:13:56 -0700
committertheo3 <arisstephenson2@gmail.com>2022-03-17 19:16:43 -0700
commitef470547e04f2cbc50b98d6578932f1188d25dbd (patch)
tree4a5e5bffb8ea301bd15b8bda4627c48ccf052cce /src/object
parent33579844948ca5c2ed9e1e353fba8b9571f7104d (diff)
cleanup
Diffstat (limited to 'src/object')
-rw-r--r--src/object/angryStatue.c2
-rw-r--r--src/object/beanstalk.c10
-rw-r--r--src/object/bigIceBlock.c4
-rw-r--r--src/object/bigPushableLever.c2
-rw-r--r--src/object/bigVortex.c2
-rw-r--r--src/object/bird.c2
-rw-r--r--src/object/bollard.c4
-rw-r--r--src/object/bossDoor.c2
-rw-r--r--src/object/chestSpawner.c2
-rw-r--r--src/object/crenelBeanSprout.c8
-rw-r--r--src/object/deathFx.c6
-rw-r--r--src/object/eyeSwitch.c4
-rw-r--r--src/object/ezloCap.c6
-rw-r--r--src/object/fan.c2
-rw-r--r--src/object/figurineDevice.c4
-rw-r--r--src/object/frozenWaterElement.c6
-rw-r--r--src/object/gentariCurtains.c4
-rw-r--r--src/object/greatFairy.c12
-rw-r--r--src/object/heartContainer.c2
-rw-r--r--src/object/jailBars.c12
-rw-r--r--src/object/lavaPlatform.c6
-rw-r--r--src/object/lilypadLarge.c12
-rw-r--r--src/object/lilypadSmall.c2
-rw-r--r--src/object/litArea.c4
-rw-r--r--src/object/macroBook.c8
-rw-r--r--src/object/macroPlayer.c4
-rw-r--r--src/object/minecart.c4
-rw-r--r--src/object/mineralWaterSource.c7
-rw-r--r--src/object/object15.c2
-rw-r--r--src/object/object1E.c2
-rw-r--r--src/object/object20.c2
-rw-r--r--src/object/object21.c2
-rw-r--r--src/object/object2B.c2
-rw-r--r--src/object/object36.c4
-rw-r--r--src/object/object3D.c4
-rw-r--r--src/object/object3E.c2
-rw-r--r--src/object/object43.c2
-rw-r--r--src/object/object44.c2
-rw-r--r--src/object/object49.c2
-rw-r--r--src/object/object4B.c8
-rw-r--r--src/object/object61.c2
-rw-r--r--src/object/object64.c8
-rw-r--r--src/object/object66.c2
-rw-r--r--src/object/object67.c12
-rw-r--r--src/object/object6A.c12
-rw-r--r--src/object/object86.c6
-rw-r--r--src/object/object9B.c2
-rw-r--r--src/object/objectA2.c2
-rw-r--r--src/object/objectAF.c2
-rw-r--r--src/object/objectB3.c2
-rw-r--r--src/object/objectC1.c2
-rw-r--r--src/object/objectOnPillar.c4
-rw-r--r--src/object/objectOnSpinyBeetle.c2
-rw-r--r--src/object/octorokBossObject.c6
-rw-r--r--src/object/playerClone.c2
-rw-r--r--src/object/pot.c8
-rw-r--r--src/object/pullableLever.c2
-rw-r--r--src/object/pullableMushroom.c28
-rw-r--r--src/object/pushableLever.c2
-rw-r--r--src/object/pushableRock.c4
-rw-r--r--src/object/pushableStatue.c2
-rw-r--r--src/object/smallIceBlock.c4
-rw-r--r--src/object/smoke.c2
-rw-r--r--src/object/specialFx.c8
64 files changed, 149 insertions, 154 deletions
diff --git a/src/object/angryStatue.c b/src/object/angryStatue.c
index 097f4626..d3fbe01d 100644
--- a/src/object/angryStatue.c
+++ b/src/object/angryStatue.c
@@ -55,7 +55,7 @@ void AngryStatue_Action2(Entity* this) {
EnqueueSFX(SFX_EC);
}
- } else if ((this->frame & 0x80) != 0) {
+ } else if ((this->frame & ANIM_DONE) != 0) {
this->action = 1;
InitializeAnimation(this, this->type);
}
diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c
index 729d0fe0..5dace1cc 100644
--- a/src/object/beanstalk.c
+++ b/src/object/beanstalk.c
@@ -169,7 +169,7 @@ void Beanstalk_Action1Type0(BeanstalkEntity* this) {
void Beanstalk_Action1Type0SubAction0(BeanstalkEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->actionDelay < 2) {
super->actionDelay++;
} else {
@@ -186,7 +186,7 @@ void Beanstalk_Action1Type0SubAction1(BeanstalkEntity* this) {
SoundReq(SFX_198);
}
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
Entity* entity = CreateObject(BEANSTALK, 1, 0);
super->child = entity;
if (entity != NULL) {
@@ -228,7 +228,7 @@ void Beanstalk_Action1Type2(BeanstalkEntity* this) {
super->actionDelay = 0;
}
}
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->child = CreateObject(BEANSTALK, 3, 0);
if (super->child != NULL) {
super->child->x.HALF.HI = super->x.HALF.HI;
@@ -242,7 +242,7 @@ void Beanstalk_Action1Type2(BeanstalkEntity* this) {
}
void Beanstalk_Action1Type4(BeanstalkEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
GetNextFrame(super);
}
}
@@ -290,7 +290,7 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) {
super->actionDelay = 0;
}
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
InitializeAnimation(super, (super->type2 - 1) * 3 + 1);
}
break;
diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c
index 09407bc4..79df9f91 100644
--- a/src/object/bigIceBlock.c
+++ b/src/object/bigIceBlock.c
@@ -87,7 +87,7 @@ void BigIceBlock_Action2(BigIceBlockEntity* this) {
super->actionDelay += 1;
}
tmp = gUnk_081237B0[super->actionDelay >> 5];
- sub_0805EC9C(super, 0x100, tmp, 0);
+ SetAffineInfo(super, 0x100, tmp, 0);
if (super->type != 1) {
if (super->type != 2) {
SetFlag(this->unk_86);
@@ -114,7 +114,7 @@ void sub_08099880(BigIceBlockEntity* this) {
sub_08099C18(this);
}
uVar4 = (0x3c - super->actionDelay) * 0x20 + 0x100;
- sub_0805EC9C(super, 0x100, uVar4, 0);
+ SetAffineInfo(super, 0x100, uVar4, 0);
sub_0806FCF4(super, uVar4, 2, 0);
obj = CreateObject(SPECIAL_FX, 0x11, 0x40);
if (obj != NULL) {
diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c
index 5c36d40b..23aa475f 100644
--- a/src/object/bigPushableLever.c
+++ b/src/object/bigPushableLever.c
@@ -70,7 +70,7 @@ void BigPushableLever_Idle(BigPushableLeverEntity* this) {
void BigPushableLever_Pushing(BigPushableLeverEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->type2 == 0) {
SetFlag(this->pushedFlag);
} else {
diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c
index 69260c5b..323cbf0b 100644
--- a/src/object/bigVortex.c
+++ b/src/object/bigVortex.c
@@ -91,7 +91,7 @@ void sub_08098E3C(Entity* this) {
InitAnimationForceUpdate(this, this->type);
}
temp = &gUnk_08123690[this->type & 2];
- sub_0805EC9C(this, temp[0], temp[1], 0);
+ SetAffineInfo(this, temp[0], temp[1], 0);
UpdateAnimationSingleFrame(this);
}
diff --git a/src/object/bird.c b/src/object/bird.c
index cafe1262..f16d46b5 100644
--- a/src/object/bird.c
+++ b/src/object/bird.c
@@ -131,7 +131,7 @@ void sub_0809D178(Entity* this) {
UpdateSpriteForCollisionLayer(this);
this->frame = 0x80;
}
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
InitializeAnimation(this, Random() & 3);
this->frameDuration = (Random() & 0xf) + 0x10;
this->spriteSettings.flipX = FALSE;
diff --git a/src/object/bollard.c b/src/object/bollard.c
index 3a7d13b7..1c6a8bda 100644
--- a/src/object/bollard.c
+++ b/src/object/bollard.c
@@ -59,7 +59,7 @@ void sub_0808B2CC(BollardEntity* this) {
void sub_0808B324(BollardEntity* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_0808B42C(this);
}
}
@@ -80,7 +80,7 @@ void sub_0808B344(BollardEntity* this) {
void sub_0808B38C(BollardEntity* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_0808B41C(this);
}
}
diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c
index 5b1bd36d..0d1844e1 100644
--- a/src/object/bossDoor.c
+++ b/src/object/bossDoor.c
@@ -93,7 +93,7 @@ void BossDoor_Action1(BossDoorEntity* this) {
}
void BossDoor_Action2(BossDoorEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
if ((gRoomTransition.frameCount & 3) == 0) {
SoundReq(SFX_185);
}
diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c
index a7890edb..a7072aa7 100644
--- a/src/object/chestSpawner.c
+++ b/src/object/chestSpawner.c
@@ -162,7 +162,7 @@ void ChestSpawner_Type2Action3(ChestSpawnerEntity* this) {
void ChestSpawner_Type2Action4(ChestSpawnerEntity* this) {
sub_0800445C(super);
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (--super->field_0xf == 0) {
if (super->actionDelay == 0x18) {
super->action = 6;
diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c
index 13652224..52fe70db 100644
--- a/src/object/crenelBeanSprout.c
+++ b/src/object/crenelBeanSprout.c
@@ -133,7 +133,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
u32 tmp;
if ((super->type & 1) != 0) {
if (super->type == 3) {
- sub_08078930(super);
+ RegisterCarryEntity(super);
sub_0800445C(super);
} else {
PositionRelative(super->parent, super, -0x1c0000, -0x280000);
@@ -159,7 +159,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
super->spriteRendering.b3 = parent->spriteRendering.b3;
super->spriteOrientation.flipY = parent->spriteOrientation.flipY;
}
- sub_0805EC9C(super, 0xcc, 0xcc, 0);
+ SetAffineInfo(super, 0xcc, 0xcc, 0);
} else {
gPlayerState.mobility |= 0x80;
gPlayerState.heldObject = 5;
@@ -177,7 +177,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
gUnk_0200AF00.unk_2f = 0;
}
PositionRelative(&gPlayerEntity, super, 0, 0x10000);
- if (sub_080B1AA8(super) == 0x19) {
+ if (GetTileUnderEntity(super) == 0x19) {
sub_0807BA8C(0xdc, super->collisionLayer);
sub_08096A78(this);
}
@@ -228,7 +228,7 @@ void CrenelBeanSprout_Action2SubAction3(CrenelBeanSproutEntity* this) {
void CrenelBeanSprout_Action3(CrenelBeanSproutEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action++;
InitializeAnimation(super, 10);
}
diff --git a/src/object/deathFx.c b/src/object/deathFx.c
index 4fe5ccb9..dee32ccc 100644
--- a/src/object/deathFx.c
+++ b/src/object/deathFx.c
@@ -49,7 +49,7 @@ void DeathFx_Action0(DeathFxObject* this) {
tmp = super->actionDelay;
super->actionDelay = 0;
}
- sub_0805EC9C(super, tmp, tmp, 0);
+ SetAffineInfo(super, tmp, tmp, 0);
LoadSwapGFX(super, 4, 0);
InitAnimationForceUpdate(super, 0);
SoundReq(SFX_BOSS_EXPLODE);
@@ -80,7 +80,7 @@ void DeathFx_Action0(DeathFxObject* this) {
void DeathFx_Action1(DeathFxObject* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_08081790(this);
DeathFx_Delete(this);
} else {
@@ -92,7 +92,7 @@ void DeathFx_Action1(DeathFxObject* this) {
void DeathFx_Action2(DeathFxObject* this) {
UpdateAnimationSingleFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
DeathFx_Delete(this);
} else {
if ((super->frame & 1) != 0) {
diff --git a/src/object/eyeSwitch.c b/src/object/eyeSwitch.c
index 125e68fe..769a2cdf 100644
--- a/src/object/eyeSwitch.c
+++ b/src/object/eyeSwitch.c
@@ -56,7 +56,7 @@ void sub_08088718(EyeSwitchEntity* this) {
void sub_08088760(EyeSwitchEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
this->unk70 = super->actionDelay << 1;
InitializeAnimation(super, super->animationState + 4);
@@ -78,7 +78,7 @@ void sub_08088790(EyeSwitchEntity* this) {
void sub_080887D8(EyeSwitchEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 1;
COLLISION_ON(super);
InitializeAnimation(super, super->animationState);
diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c
index e36a09cf..1a0d8894 100644
--- a/src/object/ezloCap.c
+++ b/src/object/ezloCap.c
@@ -152,7 +152,7 @@ void EzloCap_Type1Action1(EzloCapEntity* this) {
}
}
}
- } else if ((super->frame & 0x80) != 0) {
+ } else if ((super->frame & ANIM_DONE) != 0) {
super->actionDelay = Random() & 3;
if (super->actionDelay != 0) {
super->spriteSettings.flipX = Random() & 1;
@@ -203,7 +203,7 @@ void sub_08082C5C(EzloCapEntity* this) {
}
break;
case 2:
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
InitAnimationForceUpdate(super, gUnk_0811F18C[Random() & 3] + (Random() & 3));
return;
}
@@ -292,7 +292,7 @@ void EzloCap_ScriptedAction2(EzloCapEntity* this) {
void EzloCap_ScriptedAction3(EzloCapEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 1;
super->subAction = 0;
super->spriteOffsetX = 0;
diff --git a/src/object/fan.c b/src/object/fan.c
index 890689e9..d372ff5c 100644
--- a/src/object/fan.c
+++ b/src/object/fan.c
@@ -81,7 +81,7 @@ void Fan_Action2(FanEntity* this) {
void Fan_Action3(FanEntity* this) {
sub_0809F08C(this);
sub_0809EE44(this);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_0809EE34(this);
}
}
diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c
index 3ae836d1..df7dbdc5 100644
--- a/src/object/figurineDevice.c
+++ b/src/object/figurineDevice.c
@@ -197,7 +197,7 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) {
GetNextFrame(super);
switch (this->unk_7a) {
case 0:
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
this->unk_7a = 1;
super->actionDelay = 0x28;
ChangeObjPalette(super, gUnk_08120AA8[super->type2]);
@@ -207,7 +207,7 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) {
break;
case 1:
- if (((super->frame & 0x80) != 0) && (--super->actionDelay == 0)) {
+ if (((super->frame & ANIM_DONE) != 0) && (--super->actionDelay == 0)) {
this->unk_7a = 2;
SetRoomFlag(2);
MenuFadeIn(7, super->field_0xf);
diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c
index c0019201..7d3bd4c7 100644
--- a/src/object/frozenWaterElement.c
+++ b/src/object/frozenWaterElement.c
@@ -47,12 +47,12 @@ void sub_0809BECC(FrozenWaterElementEntity* this) {
super->frameIndex = 0;
super->spriteRendering.b0 = 3;
sub_0809C0A8(this);
- sub_0805EC9C(super, 0xcc, 0xcc, 0);
+ SetAffineInfo(super, 0xcc, 0xcc, 0);
}
}
void sub_0809BF1C(FrozenWaterElementEntity* this) {
- sub_0805EC9C(super, 0xcc, 0xcc, 0);
+ SetAffineInfo(super, 0xcc, 0xcc, 0);
if (CheckFlags(OUGONTEKI_G)) {
Entity* obj = CreateObject(OBJECT_90, 0, 0);
if (obj != NULL) {
@@ -88,7 +88,7 @@ void sub_0809BF74(FrozenWaterElementEntity* this) {
if (this->unk_74 < 0x78) {
tmp2 = ((0x78 - this->unk_74) << 5);
tmp2 += 0xcc;
- sub_0805EC9C(super, ((0x78 - this->unk_74) << 4) + 0xcc, tmp2, 0);
+ SetAffineInfo(super, ((0x78 - this->unk_74) << 4) + 0xcc, tmp2, 0);
sub_0806FCF4(super, tmp2, 8, 0);
super->spriteOffsetY += 8;
}
diff --git a/src/object/gentariCurtains.c b/src/object/gentariCurtains.c
index e3ff7b3a..eed470dc 100644
--- a/src/object/gentariCurtains.c
+++ b/src/object/gentariCurtains.c
@@ -27,7 +27,7 @@ void sub_080921F0(GentariCurtainEntity* this);
void sub_08092214(GentariCurtainEntity* this);
extern Entity gUnk_030011E8[7];
-extern Entity gUnk_03003BE0;
+extern Entity gCarryEntities;
void GentariCurtain(Entity* this) {
static void (*const actionFuncs[])(GentariCurtainEntity*) = {
@@ -76,7 +76,7 @@ void sub_0809214C(GentariCurtainEntity* this) {
void sub_08092164(GentariCurtainEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
SetTile(this->tileIndex, this->tile, 1);
SetTile(this->tileIndex2, this->tile2, 1);
diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c
index a03d9344..ffbfe2a6 100644
--- a/src/object/greatFairy.c
+++ b/src/object/greatFairy.c
@@ -173,7 +173,7 @@ void GreatFairy_WingsInit(Entity* this) {
gScreen.controls.layerFXControl = 0xF40;
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 8);
this->speed = 1024;
- sub_0805EC9C(this, 1024, 256, 0);
+ SetAffineInfo(this, 1024, 256, 0);
}
void GreatFairy_WingsUpdate(Entity* this) {
@@ -184,7 +184,7 @@ void GreatFairy_WingsUpdate(Entity* this) {
gRoomVars.animFlags |= 32;
gActiveScriptInfo.syncFlags |= 4;
} else {
- sub_0805EC9C(this, this->speed, 256, 0);
+ SetAffineInfo(this, this->speed, 256, 0);
}
}
@@ -273,7 +273,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) {
this->actionDelay = 90;
this->speed = 4096;
this->spriteRendering.b0 = 3;
- sub_0805EC9C(this, 256, 256, 0);
+ SetAffineInfo(this, 256, 256, 0);
}
}
@@ -285,7 +285,7 @@ void GreatFairy_MiniAffineUpdate(Entity* this) {
sub_0805EC60(this);
} else {
this->speed -= 24;
- sub_0805EC9C(this, 256, this->speed >> 4, 0);
+ SetAffineInfo(this, 256, this->speed >> 4, 0);
}
}
@@ -304,7 +304,7 @@ void GreatFairy_DropletInit(Entity* this) {
void GreatFairy_DropletUpdate(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteEntity(this);
}
}
@@ -370,7 +370,7 @@ void GreatFairy_EnergyInit(Entity* this) {
void GreatFairy_EnergyUpdate(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteEntity(this);
}
}
diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c
index a81709c4..421990cb 100644
--- a/src/object/heartContainer.c
+++ b/src/object/heartContainer.c
@@ -47,7 +47,7 @@ static void sub_0808E714(Entity* this) {
int var0 = 0x400 - this->field_0xf * 8;
if (var0 > 0x100) {
this->field_0xf++;
- sub_0805EC9C(this, var0, var0, 0);
+ SetAffineInfo(this, var0, var0, 0);
} else {
this->action = 3;
this->field_0x3c |= 0x10;
diff --git a/src/object/jailBars.c b/src/object/jailBars.c
index 9983eb1c..3a4abc9b 100644
--- a/src/object/jailBars.c
+++ b/src/object/jailBars.c
@@ -5,7 +5,7 @@
#include "sound.h"
#include "functions.h"
-extern void sub_080A0960(Entity*, u32);
+static void SetJailBarTiles(Entity*, u32);
extern void (*const gUnk_08124950[])(Entity*);
extern u16 gUnk_08124960[];
@@ -18,11 +18,11 @@ void JailBars(Entity* this) {
void sub_080A08C4(Entity* this) {
if (CheckFlags(this->field_0x86.HWORD) == 0) {
this->action = 1;
- sub_080A0960(this, 0);
+ SetJailBarTiles(this, 0);
} else {
this->action = 3;
InitializeAnimation(this, 1);
- sub_080A0960(this, 1);
+ SetJailBarTiles(this, 1);
}
this->spriteSettings.draw = 3; // ???
this->collisionLayer = 1;
@@ -32,14 +32,14 @@ void sub_080A08C4(Entity* this) {
void sub_080A0910(Entity* this) {
if (CheckFlags(this->field_0x86.HWORD) != 0) {
this->action = 2;
- sub_080A0960(this, 1);
+ SetJailBarTiles(this, 1);
SoundReq(SFX_10B);
}
}
void sub_080A0938(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
InitializeAnimation(this, 1);
}
@@ -48,7 +48,7 @@ void sub_080A0938(Entity* this) {
void nullsub_127(Entity* this) {
}
-void sub_080A0960(Entity* this, u32 arg1) {
+static void SetJailBarTiles(Entity* this, u32 arg1) {
u16* puVar1;
puVar1 = gUnk_08124960;
diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c
index 8576cfa8..56338844 100644
--- a/src/object/lavaPlatform.c
+++ b/src/object/lavaPlatform.c
@@ -95,7 +95,7 @@ void LavaPlatform_Type0Action2(LavaPlatformEntity* this) {
(super->child)->spriteOffsetY = 0;
InitializeAnimation(super->child, super->child->animationState);
CreateFx(super, FX_LAVA_SPLASH_HUGE, 0);
- } else if ((super->zVelocity < 0x18000) && ((super->frame & 0x80) == 0)) {
+ } else if ((super->zVelocity < 0x18000) && ((super->frame & ANIM_DONE) == 0)) {
UpdateAnimationSingleFrame(super);
}
}
@@ -169,7 +169,7 @@ void LavaPlatform_Type1Action4(LavaPlatformEntity* this) {
}
if (this->timer < 0x8d) {
GetNextFrame(super);
- tmp = super->frame & 0x80;
+ tmp = super->frame & ANIM_DONE;
if (tmp) {
// Platform sank
super->action = 5;
@@ -216,7 +216,7 @@ void LavaPlatform_Type1Action6(LavaPlatformEntity* this) {
super->flags |= ENT_COLLIDE;
super->hitType = 0xac;
} else {
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
sub_0809264C(this);
if (tmp) {
gPlayerState.field_0x3f = 0xfd;
diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c
index d7f653df..a7fd4209 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -124,7 +124,7 @@ void sub_08085A98(LilypadLargeEntity* this) {
sub_08085F1C(this);
if (0x7fffff < (u32)this->unk_78.WORD) {
this->unk_78.WORD -= 0x20000;
- sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
+ SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
if (sub_080B1A8C(super, 0, 0x18) != 0x11) {
super->subAction = 2;
@@ -148,7 +148,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
if (GravityUpdate(super, 0x2000) != 0) {
if ((u32)this->unk_78.WORD < 0x1200000) {
this->unk_78.WORD += 0x100000;
- sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
+ SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
gPlayerEntity.y.HALF.HI = (super->y.HALF.HI + super->z.HALF.HI) - this->unk_74;
if (gArea.locationIndex == 0x1b) {
@@ -159,7 +159,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
}
} else {
ResetCollisionLayer(super);
- if (sub_080B1AA8(super) == 0xd) {
+ if (GetTileUnderEntity(super) == 0xd) {
ResetCollisionLayer(&gPlayerEntity);
sub_08085CDC(this);
super->direction = GetFacingDirection(&gPlayerEntity, super);
@@ -181,7 +181,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
super->actionDelay |= 0x80;
this->unk_70 = 0;
this->unk_6c = 0;
- if (sub_080B1AA8(super) == 0xd) {
+ if (GetTileUnderEntity(super) == 0xd) {
super->action = 4;
}
}
@@ -214,7 +214,7 @@ void sub_08085C5C(LilypadLargeEntity* this) {
void sub_08085CDC(LilypadLargeEntity* this) {
this->unk_78.WORD += 0x100000;
if (this->unk_78.WORD_U < 0x4000000) {
- sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
+ SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
} else {
DeleteThisEntity();
}
@@ -381,5 +381,5 @@ void sub_08085F48(LilypadLargeEntity* this) {
}
}
}
- sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
+ SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c
index c8cf76f1..ce03ff99 100644
--- a/src/object/lilypadSmall.c
+++ b/src/object/lilypadSmall.c
@@ -59,5 +59,5 @@ static void sub_08097B24(Entity* this) {
temp2 = ++this->field_0xf;
temp = temp3[(temp2 >> 5) & 7];
- sub_0805EC9C(this, temp, temp, 0);
+ SetAffineInfo(this, temp, temp, 0);
}
diff --git a/src/object/litArea.c b/src/object/litArea.c
index 06d50198..f042209e 100644
--- a/src/object/litArea.c
+++ b/src/object/litArea.c
@@ -19,7 +19,7 @@ void LitArea(Entity* this) {
this->actionDelay = 2;
this->field_0x68.HWORD = 0xfffe;
this->field_0x6a.HWORD = 0x80;
- sub_0805EC9C(this, 0x80, 0x80, 0);
+ SetAffineInfo(this, 0x80, 0x80, 0);
} else {
if (--this->actionDelay == 0) {
this->actionDelay = 2;
@@ -30,7 +30,7 @@ void LitArea(Entity* this) {
if (0x88 < this->field_0x6a.HWORD) {
this->field_0x68.HWORD = 0xffff;
}
- sub_0805EC9C(this, this->field_0x6a.HWORD, this->field_0x6a.HWORD, 0);
+ SetAffineInfo(this, this->field_0x6a.HWORD, this->field_0x6a.HWORD, 0);
}
}
gScreen.lcd.displayControl |= DISPCNT_OBJWIN_ON;
diff --git a/src/object/macroBook.c b/src/object/macroBook.c
index 462dfea1..b63bfc37 100644
--- a/src/object/macroBook.c
+++ b/src/object/macroBook.c
@@ -44,7 +44,7 @@ void MacroBook_Init(MacroBookEntity* this) {
super->spriteOffsetY = -4;
super->spritePriority.b0 = 7;
super->spriteRendering.b3 = 3;
- sub_0805EC9C(super, this->unk80, this->unk80, 0);
+ SetAffineInfo(super, this->unk80, this->unk80, 0);
UpdateSpriteForCollisionLayer(super);
InitAnimationForceUpdate(super, super->field_0xf);
sub_0809A958(this);
@@ -56,7 +56,7 @@ void MacroBook_Action1(MacroBookEntity* this) {
if (super->actionDelay) {
super->actionDelay--;
} else {
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->field_0xf == 3) {
super->action = 2;
super->actionDelay = 90;
@@ -83,7 +83,7 @@ void MacroBook_Action2(MacroBookEntity* this) {
super->action = 1;
super->actionDelay = 0;
} else {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
return;
}
super->action = 3;
@@ -117,7 +117,7 @@ void MacroBook_Action3(MacroBookEntity* this) {
if (super->actionDelay) {
this->unk80 += 8;
super->x.WORD += 0x400;
- sub_0805EC9C(super, this->unk80, this->unk80, 0);
+ SetAffineInfo(super, this->unk80, this->unk80, 0);
} else {
sub_0809AA9C(this, super->child, 0);
sub_0809AA9C(this, &gPlayerEntity, 1);
diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c
index 37cf06ce..4adcb573 100644
--- a/src/object/macroPlayer.c
+++ b/src/object/macroPlayer.c
@@ -111,7 +111,7 @@ void MacroPlayer_Type0_Init(MacroPlayerEntity* this) {
super->z.HALF.HI = 0xff50;
this->unk6a = 4;
super->spriteRendering.b0 = 3;
- sub_0805EC9C(super, 4, 4, 0);
+ SetAffineInfo(super, 4, 4, 0);
ptr = gUnk_02018EB0;
*(Entity**)&ptr[0x14] = super;
ChangeObjPalette(super, sub_0807A094(0));
@@ -125,7 +125,7 @@ void MacroPlayer_Type0_Init(MacroPlayerEntity* this) {
void sub_0808CC88(MacroPlayerEntity* this) {
if (this->unk6a < 0x400) {
this->unk6a += 4;
- sub_0805EC9C(super, this->unk6a, this->unk6a, 0);
+ SetAffineInfo(super, this->unk6a, this->unk6a, 0);
sub_0806FCF4(super, this->unk6a, 8, 2);
}
}
diff --git a/src/object/minecart.c b/src/object/minecart.c
index 5b2538f2..7370c28b 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -146,7 +146,7 @@ void sub_080919AC(Entity* this) {
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
if (iVar2 == 0) {
this->direction = DirectionTurnAround(this->direction);
- this->animationState = this->animationState ^ 2;
+ this->animationState = AnimationStateFlip90(this->animationState);
} else {
switch (uVar3) {
case 0x64:
@@ -177,7 +177,7 @@ void sub_080919AC(Entity* this) {
case 0x6d:
case 0x6e:
case 0x6f:
- if (uVar3 == sub_080B1AA8(this)) {
+ if (uVar3 == GetTileUnderEntity(this)) {
sub_08091C0C(this);
gPlayerEntity.animationState = this->animationState << 1;
return;
diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c
index 1ffcd585..e4b438d4 100644
--- a/src/object/mineralWaterSource.c
+++ b/src/object/mineralWaterSource.c
@@ -1,5 +1,4 @@
-#include "global.h"
-#include "entity.h"
+#include "object.h"
extern void (*MineralWaterSourceActionFuncs[])(Entity*);
@@ -12,8 +11,6 @@ typedef struct {
extern UnkStruct_MineralWater MineralWaterSourceParameters[];
-extern bool32 AllocMutableHitbox(Entity*);
-
void MineralWaterSource(Entity* this) {
MineralWaterSourceActionFuncs[this->action](this);
}
@@ -21,7 +18,7 @@ void MineralWaterSource(Entity* this) {
void MineralWaterSource_Init(Entity* this) {
UnkStruct_MineralWater* unknownParameters;
- if (!AllocMutableHitbox(this)) {
+ if (AllocMutableHitbox(this) == NULL) {
return;
}
diff --git a/src/object/object15.c b/src/object/object15.c
index 25bfe1f5..43b03d0b 100644
--- a/src/object/object15.c
+++ b/src/object/object15.c
@@ -34,7 +34,7 @@ void Object15_Action1(Entity* this) {
DeleteThisEntity();
}
} else {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/object/object1E.c b/src/object/object1E.c
index 48991a92..1356bdd0 100644
--- a/src/object/object1E.c
+++ b/src/object/object1E.c
@@ -72,7 +72,7 @@ END_NONMATCH
void sub_080875F4(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
if (this->type2 != 0) {
diff --git a/src/object/object20.c b/src/object/object20.c
index 1cfb4c2c..9474f662 100644
--- a/src/object/object20.c
+++ b/src/object/object20.c
@@ -48,7 +48,7 @@ void sub_08087824(Entity* this) {
void sub_08087888(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
} else {
if (this->frame < 5) {
diff --git a/src/object/object21.c b/src/object/object21.c
index 6641b14c..f25e1a50 100644
--- a/src/object/object21.c
+++ b/src/object/object21.c
@@ -38,7 +38,7 @@ void Object21(Object21Entity* this) {
} else {
if (super->animIndex == 0xa) {
InitializeAnimation(super, 0xd);
- } else if ((super->frame & 0x80) != 0) {
+ } else if ((super->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/object/object2B.c b/src/object/object2B.c
index 747bf241..efd23de9 100644
--- a/src/object/object2B.c
+++ b/src/object/object2B.c
@@ -17,6 +17,6 @@ void Object2B(Entity* object) {
DeleteThisEntity();
} else {
int position = 0x120 - parent->z.HALF.HI;
- sub_0805EC9C(object, position, position, parent->field_0x7c.HALF_U.HI);
+ SetAffineInfo(object, position, position, parent->field_0x7c.HALF_U.HI);
}
}
diff --git a/src/object/object36.c b/src/object/object36.c
index 83150e0f..94dae2b3 100644
--- a/src/object/object36.c
+++ b/src/object/object36.c
@@ -69,7 +69,7 @@ void sub_0808BBE0(Object36Entity* this) {
diff /= 0x10;
super->spriteOffsetY = gUnk_08121474[diff];
ptr = &gUnk_0812144C[diff * 2];
- sub_0805EC9C(super, ptr[0], ptr[1], 0);
+ SetAffineInfo(super, ptr[0], ptr[1], 0);
} else {
super->bitfield &= 0x7f;
}
@@ -119,7 +119,7 @@ void sub_0808BD14(Object36Entity* this) {
if (super->field_0xf != 0) {
super->field_0xf -= 8;
- sub_0805EC9C(super, 0x200 - super->field_0xf, 0x200 - super->field_0xf, 0);
+ SetAffineInfo(super, 0x200 - super->field_0xf, 0x200 - super->field_0xf, 0);
}
if (super->bitfield == 0x93) {
super->direction = GetFacingDirection(super, &gPlayerEntity);
diff --git a/src/object/object3D.c b/src/object/object3D.c
index 0416ac2c..05514818 100644
--- a/src/object/object3D.c
+++ b/src/object/object3D.c
@@ -74,7 +74,7 @@ void Object3D_Action1(Object3DEntity* this) {
super->actionDelay = 0x1e;
super->field_0xf = 0xff;
super->spriteRendering.b0 = 3;
- sub_0805EC9C(super, 0x100, 0x100, 0);
+ SetAffineInfo(super, 0x100, 0x100, 0);
gArea.field_0x10 = 1;
SetFade(5, 8);
}
@@ -108,7 +108,7 @@ void Object3D_Action2(Object3DEntity* this) {
if (0x80 < super->field_0xf) {
super->field_0xf -= 8;
}
- sub_0805EC9C(super, super->field_0xf, super->field_0xf, 0);
+ SetAffineInfo(super, super->field_0xf, super->field_0xf, 0);
} else {
gArea.filler3[0]++;
gArea.field_0x10 = 0;
diff --git a/src/object/object3E.c b/src/object/object3E.c
index 672c428e..c950452e 100644
--- a/src/object/object3E.c
+++ b/src/object/object3E.c
@@ -191,7 +191,7 @@ void Object3E_Type7(Object3EEntity* this) {
super->spritePriority.b0 = 7;
super->spriteRendering.alphaBlend = 1;
super->frameIndex = super->type2;
- sub_0805EC9C(super, (1 - super->type2) * 0x200 + 0x100, 0xffffff40, 0);
+ SetAffineInfo(super, (1 - super->type2) * 0x200 + 0x100, 0xffffff40, 0);
}
}
diff --git a/src/object/object43.c b/src/object/object43.c
index fdf67abc..b8d9edea 100644
--- a/src/object/object43.c
+++ b/src/object/object43.c
@@ -197,7 +197,7 @@ void Object43_Action3(Object43Entity* this) {
void Object43_Action4(Object43Entity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/object/object44.c b/src/object/object44.c
index 0753c7f4..b73c0bca 100644
--- a/src/object/object44.c
+++ b/src/object/object44.c
@@ -51,7 +51,7 @@ void sub_0808E298(Entity* this) {
void sub_0808E318(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_0808E354(this, 0x343);
DeleteThisEntity();
} else {
diff --git a/src/object/object49.c b/src/object/object49.c
index aaecd05b..1b74b298 100644
--- a/src/object/object49.c
+++ b/src/object/object49.c
@@ -111,7 +111,7 @@ void sub_0808F244(Entity* this) {
}
static void sub_0808F2B0(Entity* this) {
- sub_0805EC9C(this, *(u32*)&this->field_0x74, *(u32*)&this->field_0x78, this->field_0x70.WORD);
+ SetAffineInfo(this, *(u32*)&this->field_0x74, *(u32*)&this->field_0x78, this->field_0x70.WORD);
}
void sub_0808F2C0(Entity* this) {
diff --git a/src/object/object4B.c b/src/object/object4B.c
index 7e76e856..b7dbc6ab 100644
--- a/src/object/object4B.c
+++ b/src/object/object4B.c
@@ -48,7 +48,7 @@ void Object4B_Action1(Object4BEntity* this) {
void Object4B_Action2(Object4BEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action++;
super->spritePriority.b1 = 3;
InitializeAnimation(super, 2);
@@ -80,12 +80,12 @@ void Object4B_Action4(Object4BEntity* this) {
}
if ((super->y.HALF.HI - gRoomControls.origin_y) < 0x231) {
super->y.HALF.HI = gRoomControls.origin_y + 0x230;
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action++;
super->actionDelay = 0x78;
InitializeAnimation(super, 2);
}
- } else if ((super->frame & 0x80) != 0) {
+ } else if ((super->frame & ANIM_DONE) != 0) {
super->zVelocity = 0x20000;
InitializeAnimation(super, 3);
SoundReq(SFX_12B);
@@ -102,7 +102,7 @@ void Object4B_Action5(Object4BEntity* this) {
void Object4B_Action6(Object4BEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action++;
super->actionDelay = 0x3c;
InitializeAnimation(super, 1);
diff --git a/src/object/object61.c b/src/object/object61.c
index 4c72c0d9..5756afdd 100644
--- a/src/object/object61.c
+++ b/src/object/object61.c
@@ -124,7 +124,7 @@ void Object61_Action1Type0(Object61Entity* this) {
super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
sub_0806FCF4(super, this->unk_72, 10, 2);
- sub_0805EC9C(super, this->unk_6e, this->unk_72, 0);
+ SetAffineInfo(super, this->unk_6e, this->unk_72, 0);
sub_0806FEBC(&gPlayerEntity, 1, super);
}
diff --git a/src/object/object64.c b/src/object/object64.c
index a536c556..d1d6f62e 100644
--- a/src/object/object64.c
+++ b/src/object/object64.c
@@ -67,7 +67,7 @@ void sub_08093EAC(Object64Entity* this) {
void sub_08093ED0(Object64Entity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
DeleteEntity(super);
}
}
@@ -80,7 +80,7 @@ void sub_08093EF0(Object64Entity* this) {
return;
}
GetNextFrame(super);
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
return;
}
object = CreateObject(OBJECT_64, 1, 0);
@@ -100,7 +100,7 @@ void sub_08093EF0(Object64Entity* this) {
CopyPosition(super, object);
}
}
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
return;
}
if (super->parent == &gPlayerEntity) {
@@ -111,7 +111,7 @@ void sub_08093EF0(Object64Entity* this) {
break;
case 2:
GetNextFrame(super);
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
return;
}
DeleteThisEntity();
diff --git a/src/object/object66.c b/src/object/object66.c
index 02f31e6c..bd82c084 100644
--- a/src/object/object66.c
+++ b/src/object/object66.c
@@ -27,7 +27,7 @@ void Object66(Entity* this) {
iVar2 = 0x100 - 2 * (parent->z.HALF.HI + 0x40);
iVar4 = 0x200 - 4 * (parent->z.HALF.HI + 0x40);
}
- sub_0805EC9C(this, iVar2, iVar4, 0);
+ SetAffineInfo(this, iVar2, iVar4, 0);
} else {
DeleteThisEntity();
}
diff --git a/src/object/object67.c b/src/object/object67.c
index 05218223..f36636f8 100644
--- a/src/object/object67.c
+++ b/src/object/object67.c
@@ -27,8 +27,6 @@ void sub_08094570(Object67Entity*);
void sub_08094660(Object67Entity*);
void sub_08094708(Object67Entity*, u32, u32);
-extern bool32 AllocMutableHitbox(Entity*);
-
void Object67(Entity* this) {
static void (*const actionFuncs[])(Object67Entity*) = {
sub_08094148, sub_08094398, sub_08094424, sub_08094540, sub_08094570,
@@ -135,7 +133,7 @@ void sub_08094148(Object67Entity* this) {
this->unk84.HALF.HI = 0x100;
}
- if (AllocMutableHitbox(super)) {
+ if (AllocMutableHitbox(super) != NULL) {
super->hitbox->offset_x = gUnk_080FD2E8.offset_x;
super->hitbox->offset_y = gUnk_080FD2E8.offset_y;
super->hitbox->unk2[0] = gUnk_080FD2E8.unk2[0];
@@ -181,7 +179,7 @@ void sub_08094398(Object67Entity* this) {
this->unk7c = 600;
super->action = 2;
}
- sub_0805EC9C(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
+ SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
} else {
if ((((GenericEntity*)super->child)->field_0x78.HALF.HI & 0x80) == 0) {
DeleteThisEntity();
@@ -224,7 +222,7 @@ void sub_08094424(Object67Entity* this) {
} else {
sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->actionDelay);
sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->field_0xf);
- sub_0805EC9C(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
+ SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
}
if (super->hitbox != NULL) {
@@ -241,7 +239,7 @@ void sub_08094540(Object67Entity* this) {
super->action = 4;
this->unk7c = 2;
}
- sub_0805EC9C(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
+ SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
}
void sub_08094570(Object67Entity* this) {
@@ -275,7 +273,7 @@ void sub_08094570(Object67Entity* this) {
}
sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->actionDelay);
sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->field_0xf);
- sub_0805EC9C(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
+ SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
}
if (super->hitbox != NULL) {
diff --git a/src/object/object6A.c b/src/object/object6A.c
index 9ae71669..79670b5a 100644
--- a/src/object/object6A.c
+++ b/src/object/object6A.c
@@ -327,7 +327,7 @@ void sub_08094E30(Object6AEntity* this) {
super->zVelocity = 0;
SetDefaultPriority(super, PRIO_PLAYER_EVENT);
InitializeAnimation(super, 0);
- if (sub_080B1AA8(super) == 13) {
+ if (GetTileUnderEntity(super) == 13) {
super->action = 3;
}
break;
@@ -344,7 +344,7 @@ void sub_08094E30(Object6AEntity* this) {
break;
case 2:
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
DeleteThisEntity();
}
break;
@@ -548,9 +548,9 @@ void sub_08095288(Object6AEntity* this) {
if (super->subAction != 0) {
if ((u32)sub_080044EC(super, 0x1800) <= 1) {
super->subAction = 0;
- sub_0805EC9C(super, 0x100, 0x100, 0xC000);
+ SetAffineInfo(super, 0x100, 0x100, 0xC000);
} else {
- sub_0805EC9C(super, 0x100, 0x100, super->actionDelay << 8);
+ SetAffineInfo(super, 0x100, 0x100, super->actionDelay << 8);
super->actionDelay += 10;
LinearMoveUpdate(super);
}
@@ -770,7 +770,7 @@ void sub_0809577C(Object6AEntity* this) {
InitializeAnimation(super, 1);
}
GetNextFrame(super);
- if (super->frame & 0x80)
+ if (super->frame & ANIM_DONE)
DeleteThisEntity();
}
@@ -951,7 +951,7 @@ void sub_08095B48(Object6AEntity* this) {
p = super->parent;
if (p != NULL) {
if ((p->frame & 0x40) == 0) {
- if (p->frame & 0x80) {
+ if (p->frame & ANIM_DONE) {
DeleteThisEntity();
return;
}
diff --git a/src/object/object86.c b/src/object/object86.c
index 57151a05..bdaa2811 100644
--- a/src/object/object86.c
+++ b/src/object/object86.c
@@ -31,7 +31,7 @@ void sub_08099E10(Entity* this) {
this->frame = 0;
sub_08099ECC(this);
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
InitializeAnimation(this, 1);
}
@@ -40,7 +40,7 @@ void sub_08099E10(Entity* this) {
void sub_08099E58(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->frame &= ~0x80;
this->actionDelay++;
if (this->actionDelay == 3) {
@@ -70,5 +70,5 @@ void sub_08099ECC(Entity* this) {
CopyPosition(this, &gPlayerEntity);
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x38 = 0;
- gPlayerState.flags |= PL_FLAGS8000;
+ gPlayerState.flags |= PL_PIT_IS_EXIT;
}
diff --git a/src/object/object9B.c b/src/object/object9B.c
index 1f88aefa..82b7eebf 100644
--- a/src/object/object9B.c
+++ b/src/object/object9B.c
@@ -25,7 +25,7 @@ void sub_0809E7C0(Entity* this) {
void sub_0809E7E0(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteThisEntity();
}
}
diff --git a/src/object/objectA2.c b/src/object/objectA2.c
index e529794c..8091c484 100644
--- a/src/object/objectA2.c
+++ b/src/object/objectA2.c
@@ -74,7 +74,7 @@ void sub_0809F374(Entity* this) {
}
void sub_0809F3E8(Entity* this) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
InitializeAnimation(this, 2);
}
diff --git a/src/object/objectAF.c b/src/object/objectAF.c
index 8aa2c9ed..cd7ebe6a 100644
--- a/src/object/objectAF.c
+++ b/src/object/objectAF.c
@@ -40,7 +40,7 @@ void sub_080A05F4(Entity* this) {
void sub_080A0624(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteThisEntity();
}
}
diff --git a/src/object/objectB3.c b/src/object/objectB3.c
index 770d4e27..de0313ee 100644
--- a/src/object/objectB3.c
+++ b/src/object/objectB3.c
@@ -75,7 +75,7 @@ void sub_080A0AF0(Entity* this) {
ExecuteScriptForEntity(this, NULL);
GetNextFrame(this);
if (this->animIndex == 5) {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/object/objectC1.c b/src/object/objectC1.c
index 780c1c78..ed045a6d 100644
--- a/src/object/objectC1.c
+++ b/src/object/objectC1.c
@@ -101,7 +101,7 @@ void ObjectC1_Action8(ObjectC1Entity* this) {
if ((gMessage.doTextBox & 0x7f) != 0) {
return;
}
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 1;
gPlayerEntity.flags = this->unk_69;
gPlayerEntity.spriteSettings.draw = this->unk_68;
diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c
index 5582f707..0433a93d 100644
--- a/src/object/objectOnPillar.c
+++ b/src/object/objectOnPillar.c
@@ -99,7 +99,7 @@ void ObjectOnPillar_Action1(ObjectOnPillarEntity* this) {
if (sub_08097008(this)) {
super->action = 3;
} else {
- sub_08078930(super);
+ RegisterCarryEntity(super);
}
}
}
@@ -211,7 +211,7 @@ void sub_080970F4(ObjectOnPillarEntity* this) {
bool32 sub_08097144(ObjectOnPillarEntity* this) {
LinearMoveUpdate(super);
sub_0800445C(super);
- if (sub_080B1AA8(super) == 0x19) {
+ if (GetTileUnderEntity(super) == 0x19) {
super->spriteOffsetY = 2;
}
if ((--this->unk_76 == 0) && sub_08097194(this) == FALSE) {
diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c
index e986348f..faba73b0 100644
--- a/src/object/objectOnSpinyBeetle.c
+++ b/src/object/objectOnSpinyBeetle.c
@@ -120,7 +120,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) {
}
} else {
sub_08098918(this);
- sub_08078930(super);
+ RegisterCarryEntity(super);
}
} else {
sub_080989C0(this);
diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c
index ef2f279a..f1fbb022 100644
--- a/src/object/octorokBossObject.c
+++ b/src/object/octorokBossObject.c
@@ -111,7 +111,7 @@ void OctorokBossObject_Init(Entity* this) {
((-(u32)this->parent->field_0x7a.HALF.HI << 0x18) >> 0x18) +
(u32)gUnk_0812388C[(u32)this->type2 * 2 + 1],
(u32)gUnk_0812388C[(u32)this->type2 * 2]);
- sub_0805EC9C(this, this->field_0x76.HWORD, this->field_0x74.HWORD, this->field_0x7a.HWORD);
+ SetAffineInfo(this, this->field_0x76.HWORD, this->field_0x74.HWORD, this->field_0x7a.HWORD);
InitializeAnimation(this, 7);
break;
case 7:
@@ -239,8 +239,8 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc",
this->field_0x76.HWORD -= 0x20;
this->field_0x74.HWORD -= 0x20;
}
- sub_0805EC9C(this, (u32)this->field_0x76.HWORD, (u32)(u16)this->field_0x74.HWORD,
- (u32)(u16)this->field_0x7a.HWORD);
+ SetAffineInfo(this, (u32)this->field_0x76.HWORD, (u32)(u16)this->field_0x74.HWORD,
+ (u32)(u16)this->field_0x7a.HWORD);
} else {
*(int*)&this->field_0x78 -= 1;
}
diff --git a/src/object/playerClone.c b/src/object/playerClone.c
index eee252ae..b8a94abc 100644
--- a/src/object/playerClone.c
+++ b/src/object/playerClone.c
@@ -98,7 +98,7 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
if (gPlayerEntity.iframes >= 1) {
gPlayerState.chargeState.action = 1;
} else {
- sub_080B1AA8(super);
+ GetTileUnderEntity(super);
sub_08084B1C(this);
super->x.HALF.HI = gPlayerEntity.x.HALF.HI + this->unk78;
super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->unk7a;
diff --git a/src/object/pot.c b/src/object/pot.c
index 239d0732..22ee8ce0 100644
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -16,7 +16,7 @@ extern void (*const gUnk_0811F090[])(Entity*);
extern void (*const gUnk_0811F0A8[])(Entity*);
extern void (*const gUnk_0811F0C4[])(Entity*);
-extern void sub_08078930(Entity*);
+extern void RegisterCarryEntity(Entity*);
extern void sub_08016A6C(Entity*);
void Pot(Entity* this) {
@@ -94,7 +94,7 @@ void sub_08082310(Entity* this) {
DeleteThisEntity();
break;
default:
- if (sub_080B1AA8(this) == 13) {
+ if (GetTileUnderEntity(this) == 13) {
CreateFx(this, FX_FALL_DOWN, 0);
} else if (tileType == 0x4005) {
gPlayerState.field_0xab = 4;
@@ -104,7 +104,7 @@ void sub_08082310(Entity* this) {
break;
}
} else {
- sub_08078930(this);
+ RegisterCarryEntity(this);
}
break;
}
@@ -194,7 +194,7 @@ void sub_08082614(Entity* this) {
break;
default:
SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer);
- sub_08078930(this);
+ RegisterCarryEntity(this);
break;
}
}
diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c
index 35088834..98b62c82 100644
--- a/src/object/pullableLever.c
+++ b/src/object/pullableLever.c
@@ -92,7 +92,7 @@ void PullableLever_HandleInit(PullableLeverEntity* this) {
}
void PullableLever_HandleAction1(PullableLeverEntity* this) {
- sub_08078930(super);
+ RegisterCarryEntity(super);
if (this->pullLength != 0) {
super->direction = super->type2 << 3;
LinearMoveUpdate(super);
diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c
index ff7bff42..0c0e5796 100644
--- a/src/object/pullableMushroom.c
+++ b/src/object/pullableMushroom.c
@@ -162,7 +162,7 @@ void sub_0808ACEC(PullableMushroomEntity* this) {
default:
super->field_0xf = 0;
super->actionDelay = 0;
- sub_08078930(super);
+ RegisterCarryEntity(super);
break;
}
}
@@ -171,7 +171,7 @@ void sub_0808ADA0(PullableMushroomEntity* this) {
if ((sub_0808B1F0(this, super->child) < 8) || (super->child == NULL)) {
super->subAction += 1;
super->actionDelay = 2;
- super->flags |= 0x80;
+ super->flags |= ENT_COLLIDE;
super->animationState ^= 2;
super->spritePriority.b0 = 4;
} else {
@@ -182,9 +182,9 @@ void sub_0808ADA0(PullableMushroomEntity* this) {
void sub_0808ADF0(PullableMushroomEntity* this) {
if (super->animationState + 0xd == super->animIndex) {
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->subAction = 0;
- super->flags |= 0x80;
+ super->flags |= ENT_COLLIDE;
} else {
GetNextFrame(super);
}
@@ -199,7 +199,7 @@ void sub_0808ADF0(PullableMushroomEntity* this) {
SoundReq(SFX_12E);
} else {
GetNextFrame(super);
- if (((super->frame & 0x80) != 0) && (--super->actionDelay == 0xff)) {
+ if (((super->frame & ANIM_DONE) != 0) && (--super->actionDelay == 0xff)) {
InitializeAnimation(super, super->animationState + 0xd);
}
}
@@ -245,7 +245,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
} else {
super->actionDelay = 1;
this->unk_7c = 1;
- super->animationState = gPlayerEntity.animationState >> 1 ^ 2;
+ super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
super->direction = (super->animationState << 3);
super->flags &= 0x7f;
super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
@@ -264,7 +264,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
void sub_0808AFD4(PullableMushroomEntity* this) {
super->action = 1;
super->subAction = 1;
- (super->child)->direction = super->direction ^ 0x10;
+ (super->child)->direction = DirectionTurnAround(super->direction);
SoundReq(SFX_130);
}
@@ -278,9 +278,9 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) {
if ((((gPlayerState.field_0x1c & 0xf) != 1) || ((super->bitfield & 0x7f) != 0x13)) && (super->type == 1)) {
(super->parent)->action = 1;
(super->parent)->subAction = 1;
- super->direction = super->parent->direction ^ 0x10;
- super->parent->flags &= 0x7f;
- super->flags &= 0x7f;
+ super->direction = DirectionTurnAround(super->parent->direction);
+ super->parent->flags &= ~ENT_COLLIDE;
+ super->flags &= ~ENT_COLLIDE;
super->action = 1;
SoundReq(SFX_130);
}
@@ -288,7 +288,7 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) {
void sub_0808B05C(PullableMushroomEntity* this) {
if (super->type == 0) {
- super->animationState = gPlayerEntity.animationState >> 1 ^ 2;
+ super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
super->direction = super->animationState << 3;
super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
super->flags &= 0x7f;
@@ -346,7 +346,7 @@ void sub_0808B168(PullableMushroomEntity* this, u32 param_2) {
Entity* pEVar6;
if (param_2 != 0) {
- iVar2 = (super->animationState ^ 2) * 2;
+ iVar2 = AnimationStateFlip90(super->animationState) * 2;
pcVar5 = (gUnk_081211F4 + iVar2);
pcVar3 = pcVar5 + 1;
pEVar5 = super->parent;
@@ -356,11 +356,11 @@ void sub_0808B168(PullableMushroomEntity* this, u32 param_2) {
pEVar6 = &gPlayerEntity;
pEVar5 = super->parent;
pcVar5 = (gUnk_081211FC + super->animationState * 2);
- pcVar3 = (gUnk_081211F4 + 1 + (super->animationState ^ 2) * 2);
+ pcVar3 = (gUnk_081211F4 + 1 + AnimationStateFlip90(super->animationState) * 2);
} else {
pEVar6 = super->parent;
pEVar5 = &gPlayerEntity;
- pcVar5 = (gUnk_081211F4 + (super->animationState ^ 2) * 2);
+ pcVar5 = (gUnk_081211F4 + AnimationStateFlip90(super->animationState) * 2);
pcVar3 = (gUnk_081211FC + 1 + super->animationState * 2);
}
}
diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c
index 503f75d2..c546d23e 100644
--- a/src/object/pushableLever.c
+++ b/src/object/pushableLever.c
@@ -69,7 +69,7 @@ void PushableLever_Idle(PushableLeverEntity* this) {
void PushableLever_Pushing(PushableLeverEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->type2 == 0) {
SetFlag(this->pushedFlag);
} else {
diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c
index 75a9733e..20c84f43 100644
--- a/src/object/pushableRock.c
+++ b/src/object/pushableRock.c
@@ -75,13 +75,13 @@ void PushableRock_Action2(PushableRockEntity* this) {
super->speed = PushableRock_Speeds[super->frame & 0xf];
LinearMoveUpdate(super);
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->action = 0;
}
}
void PushableRock_Action3(PushableRockEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
GetNextFrame(super);
} else {
super->spritePriority.b0 = 7;
diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c
index c47ebfba..fd8de005 100644
--- a/src/object/pushableStatue.c
+++ b/src/object/pushableStatue.c
@@ -83,7 +83,7 @@ void PushableStatue_Action1(PushableStatueEntity* this) {
break;
}
} else {
- sub_08078930(super);
+ RegisterCarryEntity(super);
}
}
}
diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c
index 3ffedb89..11994ed5 100644
--- a/src/object/smallIceBlock.c
+++ b/src/object/smallIceBlock.c
@@ -137,7 +137,7 @@ void SmallIceBlock_Action3(SmallIceBlockEntity* this) {
} else {
super->actionDelay++;
}
- sub_0805EC9C(super, 0x100, gUnk_08123748[super->actionDelay >> 5], 0);
+ SetAffineInfo(super, 0x100, gUnk_08123748[super->actionDelay >> 5], 0);
if (super->type == 1) {
CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->unk_86);
SoundReq(SFX_SECRET);
@@ -162,7 +162,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
if (super->actionDelay == 0x30) {
SetTile(this->unk_6c, this->unk_70, super->collisionLayer);
}
- sub_0805EC9C(super, 0x100, (0x3c - super->actionDelay) * 0x20 + 0x100, 0);
+ SetAffineInfo(super, 0x100, (0x3c - super->actionDelay) * 0x20 + 0x100, 0);
if ((super->actionDelay & 1) != 0) {
obj = CreateObject(SPECIAL_FX, 0x11, 0x40);
if (obj != NULL) {
diff --git a/src/object/smoke.c b/src/object/smoke.c
index 7fed0867..4ce9b8c4 100644
--- a/src/object/smoke.c
+++ b/src/object/smoke.c
@@ -44,7 +44,7 @@ void sub_0808A484(Entity* this) {
void sub_0808A4D0(Entity* this) {
GetNextFrame(this);
LinearMoveUpdate(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteEntity(this);
}
}
diff --git a/src/object/specialFx.c b/src/object/specialFx.c
index dcd3a25a..c5262d9c 100644
--- a/src/object/specialFx.c
+++ b/src/object/specialFx.c
@@ -187,7 +187,7 @@ void sub_080845B8(SpecialFxObject* this) {
void sub_080845DC(SpecialFxObject* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
DeleteThisEntity();
}
}
@@ -202,7 +202,7 @@ void sub_080845F8(SpecialFxObject* this) {
void sub_08084630(SpecialFxObject* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
if ((super->type2 & 1) && (super->child != 0)) {
((GenericEntity*)super->child)->field_0x6a.HWORD--;
if (this->unk_68 != 0) {
@@ -254,7 +254,7 @@ void sub_080846B0(SpecialFxObject* this) {
void sub_0808471C(SpecialFxObject* this) {
static const s8 gUnk_0811FB08[] = { -8, -8, 8, -8, -8, 8, 8, 8 };
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
u32 i;
for (i = 0; i < 4; i++) {
Entity* fx = CreateFx(super, 0x24, 0);
@@ -280,7 +280,7 @@ void sub_08084784(SpecialFxObject* this) {
void sub_08084798(SpecialFxObject* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) || !super->child->next) {
+ if ((super->frame & ANIM_DONE) || !super->child->next) {
DeleteThisEntity();
}
}