summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-04-01 18:19:56 +0300
committerTal Hayon <talhayon1@gmail.com>2022-04-01 18:19:56 +0300
commitd6d7916a460acb7190bd353b3ed86eb85f3a6002 (patch)
treeb6fae3edaf0c04001089806de650b6e7cead8207 /src/object
parent9233701a5df02847510df90937f25bccc46eebd2 (diff)
Use fixed point macros where possible
Diffstat (limited to 'src/object')
-rw-r--r--src/object/bird.c10
-rw-r--r--src/object/crenelBeanSprout.c4
-rw-r--r--src/object/ezloCap.c4
-rw-r--r--src/object/fairy.c4
-rw-r--r--src/object/frozenOctorok.c6
-rw-r--r--src/object/greatFairy.c2
-rw-r--r--src/object/itemOnGround.c8
-rw-r--r--src/object/jarPortal.c4
-rw-r--r--src/object/keyStealingTakkuri.c12
-rw-r--r--src/object/ladderUp.c2
-rw-r--r--src/object/lavaPlatform.c6
-rw-r--r--src/object/lilypadLarge.c4
-rw-r--r--src/object/macroBook.c2
-rw-r--r--src/object/macroPlayer.c14
-rw-r--r--src/object/minecart.c2
-rw-r--r--src/object/object1F.c4
-rw-r--r--src/object/object30.c18
-rw-r--r--src/object/object37.c2
-rw-r--r--src/object/object45.c2
-rw-r--r--src/object/object49.c2
-rw-r--r--src/object/object4B.c6
-rw-r--r--src/object/object53.c4
-rw-r--r--src/object/object63.c2
-rw-r--r--src/object/object67.c6
-rw-r--r--src/object/object68.c2
-rw-r--r--src/object/object6A.c6
-rw-r--r--src/object/object79.c2
-rw-r--r--src/object/object96.c14
-rw-r--r--src/object/objectA2.c2
-rw-r--r--src/object/objectA8.c4
-rw-r--r--src/object/objectB3.c6
-rw-r--r--src/object/objectOnSpinyBeetle.c4
-rw-r--r--src/object/pot.c2
-rw-r--r--src/object/specialFx.c8
34 files changed, 90 insertions, 90 deletions
diff --git a/src/object/bird.c b/src/object/bird.c
index 44af688e..0ec0b1b6 100644
--- a/src/object/bird.c
+++ b/src/object/bird.c
@@ -50,7 +50,7 @@ void Bird_Type0_Init(Entity* this) {
this->subtimer = 1;
this->zVelocity = Q_16_16(-1.5);
this->z.WORD = Q_16_16(-56.75);
- this->field_0x68.HWORD = Q_16_16(-0.03125);
+ this->field_0x68.HWORD = Q_8_8(-8.0);
this->speed = 0x280;
this->direction = 8;
this->collisionLayer = 2;
@@ -225,7 +225,7 @@ void Bird_Type8(Entity* this) {
this->action = 2;
this->timer = 8;
this->speed = 0x300;
- this->field_0x68.HWORD = 0xe000;
+ this->field_0x68.HWORD = Q_8_8(-32.0);
PlayerDropHeldObject();
sub_08078B48();
ResetPlayerAnimationAndAction();
@@ -286,9 +286,9 @@ void Bird_Type9(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->spriteSettings.draw = 1;
- this->zVelocity = -0x28000;
- this->z.WORD = 0xffb4c000;
- this->field_0x68.HWORD = 0xf000;
+ this->zVelocity = Q_16_16(-2.5);
+ this->z.WORD = Q_16_16(-75.25);
+ this->field_0x68.HWORD = Q_8_8(-16.0);
this->speed = 0x300;
this->direction = 8;
this->collisionLayer = 1;
diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c
index ab865f7d..a953c47e 100644
--- a/src/object/crenelBeanSprout.c
+++ b/src/object/crenelBeanSprout.c
@@ -190,7 +190,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
gPlayerState.heldObject = 0;
super->action = 5;
super->speed = 0x100;
- super->zVelocity = 0x20000;
+ super->zVelocity = Q_16_16(2);
super->spritePriority.b1 = 1;
super->spriteSettings.shadow = 1;
RestorePrevTileEntity(0xdc, super->collisionLayer);
@@ -256,7 +256,7 @@ void CrenelBeanSprout_Action5(CrenelBeanSproutEntity* this) {
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, this->unk_70, this->unk_72);
LinearMoveUpdate(super);
}
- if (GravityUpdate(super, 0x4000) == 0) {
+ if (GravityUpdate(super, Q_8_8(64.0)) == 0) {
sub_08096A78(this);
}
}
diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c
index 39c7793a..9780c525 100644
--- a/src/object/ezloCap.c
+++ b/src/object/ezloCap.c
@@ -220,7 +220,7 @@ void sub_08082C5C(EzloCapEntity* this) {
return;
}
}
- GravityUpdate(super, 0x2000);
+ GravityUpdate(super, Q_8_8(32.0));
UpdateAnimationSingleFrame(super);
}
@@ -273,7 +273,7 @@ void sub_08082D20(EzloCapEntity* this, ScriptExecutionContext* context) {
void EzloCap_ScriptedAction2(EzloCapEntity* this) {
ExecuteScript(super, this->unk_84);
- GravityUpdate(super, 0x1800);
+ GravityUpdate(super, Q_8_8(24.0));
switch (super->subAction) {
case 0:
if (super->zVelocity < 0) {
diff --git a/src/object/fairy.c b/src/object/fairy.c
index 988d56e7..349fdf68 100644
--- a/src/object/fairy.c
+++ b/src/object/fairy.c
@@ -115,7 +115,7 @@ void Fairy_Init(FairyEntity* this) {
switch (super->type2) {
case 0:
- super->zVelocity = 0x1e000;
+ super->zVelocity = Q_16_16(1.875);
super->z.HALF.HI += 8;
// fallthrough
default:
@@ -131,7 +131,7 @@ void Fairy_Init(FairyEntity* this) {
}
void Fairy_Action1(FairyEntity* this) {
- super->z.WORD -= 0xe000;
+ super->z.WORD -= Q_16_16(0.875);
if (super->frame != 0) {
if (super->timer != 0) {
this->unk_78 *= 0x1e;
diff --git a/src/object/frozenOctorok.c b/src/object/frozenOctorok.c
index 100ec565..4004cfe4 100644
--- a/src/object/frozenOctorok.c
+++ b/src/object/frozenOctorok.c
@@ -84,10 +84,10 @@ void FrozenOctorok_Action1SubAction0(FrozenOctorokEntity* this) {
if (this->unk_7e == 0) {
child = super->child;
if (child->z.HALF.HI > -0x10) {
- child->z.WORD -= 0x4000;
+ child->z.WORD -= Q_16_16(0.25);
} else {
- child->z.WORD -= 0x1000;
- (super->child)->zVelocity = 0x3000;
+ child->z.WORD -= Q_16_16(0.0625);
+ (super->child)->zVelocity = Q_16_16(0.1875);
this->unk_7e = 0x200;
}
}
diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c
index ab08f369..fdc16d3e 100644
--- a/src/object/greatFairy.c
+++ b/src/object/greatFairy.c
@@ -229,7 +229,7 @@ void GreatFairy_MiniRisingUpdate(Entity* this) {
Entity* target;
GetNextFrame(this);
- this->z.WORD -= 0x8000;
+ this->z.WORD -= Q_16_16(0.5);
if (this->z.HALF.HI == -20) {
this->action = 2;
SoundReq(SFX_HEART_CONTAINER_SPAWN);
diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c
index f9806ec8..8a29ce8c 100644
--- a/src/object/itemOnGround.c
+++ b/src/object/itemOnGround.c
@@ -206,7 +206,7 @@ void sub_080811EC(Entity* this) {
LinearMoveUpdate(this);
}
- GravityUpdate(this, 0x2800);
+ GravityUpdate(this, Q_8_8(40.0));
if (this->zVelocity <= 0) {
this->action = 2;
COLLISION_ON(this);
@@ -293,7 +293,7 @@ void sub_0808136C(Entity* this) {
this->y.WORD = other->y.WORD;
this->spriteOrientation.flipY = other->spriteOrientation.flipY;
this->spriteRendering.b3 = other->spriteRendering.b3;
- GravityUpdate(this, 0x2800);
+ GravityUpdate(this, Q_8_8(40.0));
} else {
sub_08081404(this, 1);
}
@@ -397,14 +397,14 @@ void sub_0808153C(Entity* this) {
return;
if (this->field_0x68.HALF.LO == 0) {
- if (!GravityUpdate(this, 0x1000) && !sub_0800442E(this)) {
+ if (!GravityUpdate(this, Q_8_8(16.0)) && !sub_0800442E(this)) {
this->field_0x68.HALF.LO = 1;
this->zVelocity = Q_16_16(1.875);
sub_0808148C(this->type);
UpdateSpriteForCollisionLayer(this);
}
} else {
- if (!GravityUpdate(this, 0x2800)) {
+ if (!GravityUpdate(this, Q_8_8(40.0))) {
this->field_0x68.HALF.LO = 2;
sub_0808148C(this->type);
}
diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c
index 355a6b78..4cdcf642 100644
--- a/src/object/jarPortal.c
+++ b/src/object/jarPortal.c
@@ -56,7 +56,7 @@ void sub_0808BF14(Entity* this) {
}
void sub_0808BF58(Entity* this) {
- GravityUpdate(this, 0x2000);
+ GravityUpdate(this, Q_8_8(32.0));
switch (this->subAction) {
case 0:
if (this->zVelocity < Q_16_16(1.5)) {
@@ -124,7 +124,7 @@ void sub_0808C01C(Entity* this, u32 r1) {
}
void sub_0808C0AC(Entity* this) {
- GravityUpdate(this, 0x2000);
+ GravityUpdate(this, Q_8_8(32.0));
switch (this->subAction) {
case 0:
if (this->zVelocity < Q_16_16(1.5)) {
diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c
index d1dc56bf..9d6390f7 100644
--- a/src/object/keyStealingTakkuri.c
+++ b/src/object/keyStealingTakkuri.c
@@ -80,8 +80,8 @@ void KeyStealingTakkuri_Type0_Init(KeyStealingTakkuriEntity* this) {
void KeyStealingTakkuri_Type0_Action1(KeyStealingTakkuriEntity* this) {
if (--super->timer == 0) {
super->action++;
- super->y.WORD += 0x100000;
- super->z.WORD -= 0x100000;
+ super->y.WORD += Q_16_16(16.0);
+ super->z.WORD -= Q_16_16(16.0);
InitAnimationForceUpdate(super, 3);
}
}
@@ -159,7 +159,7 @@ void KeyStealingTakkuri_Type5_Init(KeyStealingTakkuriEntity* this) {
super->spriteSettings.draw = 1;
super->direction = 0x18;
super->speed = 0x100;
- super->zVelocity = 0x20000;
+ super->zVelocity = Q_16_16(2.0);
super->timer = 1;
SoundReq(SFX_RUPEE_BOUNCE);
}
@@ -169,7 +169,7 @@ void KeyStealingTakkuri_Type5_Action1(KeyStealingTakkuriEntity* this) {
if (sub_080044EC(super, 0x2000) < 2) {
if (super->timer != 0) {
super->timer--;
- super->zVelocity = 0x10000;
+ super->zVelocity = Q_16_16(1.0);
} else {
super->action++;
super->collisionLayer = gPlayerEntity.collisionLayer;
@@ -194,8 +194,8 @@ void KeyStealingTakkuri_Type2_Init(KeyStealingTakkuriEntity* this) {
super->spriteRendering.b3 = 1;
super->speed = 0;
super->direction = 0x18;
- super->y.WORD += 0x100000;
- super->z.WORD -= 0x100000;
+ super->y.WORD += Q_16_16(16.0);
+ super->z.WORD -= Q_16_16(16.0);
this->unk_68 = super->x.HALF.HI;
this->unk_6a = super->y.HALF.HI;
this->unk_6c = 0;
diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c
index 98a3b01a..b173b5f6 100644
--- a/src/object/ladderUp.c
+++ b/src/object/ladderUp.c
@@ -34,7 +34,7 @@ void LadderUp(Entity* this) {
SetTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
break;
case 1:
- if (GravityUpdate(this, 0x1000) == 0) {
+ if (GravityUpdate(this, Q_8_8(16.0)) == 0) {
fxEnt = CreateFx(this, FX_GIANT_EXPLOSION, 0x40);
if (fxEnt) {
fxEnt->y.HALF.HI += 8;
diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c
index 4459128b..be0e619f 100644
--- a/src/object/lavaPlatform.c
+++ b/src/object/lavaPlatform.c
@@ -77,7 +77,7 @@ void LavaPlatform_Type0Action1(LavaPlatformEntity* this) {
if (*(u8*)&this->timer != 0) {
// Use this entity to show the platform flipping animation.
super->action = 2;
- super->zVelocity = 0x2c000;
+ super->zVelocity = Q_16_16(2.75);
super->spriteSettings.draw = 1;
UpdateSpriteForCollisionLayer(super);
InitAnimationForceUpdate(super, (super->child)->animationState);
@@ -87,7 +87,7 @@ void LavaPlatform_Type0Action1(LavaPlatformEntity* this) {
}
void LavaPlatform_Type0Action2(LavaPlatformEntity* this) {
- if (GravityUpdate(super, 0x2400) == 0) {
+ if (GravityUpdate(super, Q_8_8(36.0)) == 0) {
// Finished flipping platform.
super->action = 1;
super->spriteSettings.draw = 0;
@@ -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 & ANIM_DONE) == 0)) {
+ } else if ((super->zVelocity < Q_16_16(1.5)) && ((super->frame & ANIM_DONE) == 0)) {
UpdateAnimationSingleFrame(super);
}
}
diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c
index 241ee9de..e447e036 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -145,7 +145,7 @@ void sub_08085A98(LilypadLargeEntity* this) {
void sub_08085B40(LilypadLargeEntity* this) {
if (super->z.WORD != 0) {
- if (GravityUpdate(super, 0x2000) != 0) {
+ if (GravityUpdate(super, Q_8_8(32.0)) != 0) {
if ((u32)this->unk_78.WORD < 0x1200000) {
this->unk_78.WORD += 0x100000;
SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
@@ -168,7 +168,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
}
if (this->unk_82 == 0) {
- if (GravityUpdate(&gPlayerEntity, 0x2000) == 0) {
+ if (GravityUpdate(&gPlayerEntity, Q_8_8(32.0)) == 0) {
ResetCollisionLayer(&gPlayerEntity);
sub_08085F1C(this);
super->action = 1;
diff --git a/src/object/macroBook.c b/src/object/macroBook.c
index 722ce8a4..675ac74c 100644
--- a/src/object/macroBook.c
+++ b/src/object/macroBook.c
@@ -116,7 +116,7 @@ void MacroBook_Action3(MacroBookEntity* this) {
if (super->timer) {
this->unk80 += 8;
- super->x.WORD += 0x400;
+ super->x.WORD += Q_16_16(1.0 / 64.0);
SetAffineInfo(super, this->unk80, this->unk80, 0);
} else {
sub_0809AA9C(this, super->child, 0);
diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c
index 5a75369b..603251e6 100644
--- a/src/object/macroPlayer.c
+++ b/src/object/macroPlayer.c
@@ -130,11 +130,11 @@ void sub_0808CC88(MacroPlayerEntity* this) {
void MacroPlayer_Type0_Action1(MacroPlayerEntity* this) {
sub_0808CC88(this);
- if (GravityUpdate(super, 0x1000) == 0) {
+ if (GravityUpdate(super, Q_8_8(16.0)) == 0) {
super->action++;
super->direction = DirectionSouthWest;
super->speed = 0x100;
- super->zVelocity = 0x30000;
+ super->zVelocity = Q_16_16(3.0);
super->spriteSettings.shadow = 0;
super->child->subAction = 1;
gUnk_02018EB0.unk_18 = 1;
@@ -144,13 +144,13 @@ void MacroPlayer_Type0_Action1(MacroPlayerEntity* this) {
void MacroPlayer_Type0_Action2(MacroPlayerEntity* this) {
sub_0808CC88(this);
UpdateAnimationSingleFrame(super);
- if (GravityUpdate(super, 0x2000)) {
+ if (GravityUpdate(super, Q_8_8(32.0))) {
LinearMoveUpdate(super);
} else {
super->action++;
super->direction = 10;
super->speed = 0xc0;
- super->zVelocity = 0x28000;
+ super->zVelocity = Q_16_16(2.5);
gUnk_02018EB0.unk_19 = 1;
}
}
@@ -158,20 +158,20 @@ void MacroPlayer_Type0_Action2(MacroPlayerEntity* this) {
void MacroPlayer_Type0_Action3(MacroPlayerEntity* this) {
sub_0808CC88(this);
UpdateAnimationSingleFrame(super);
- if (GravityUpdate(super, 0x2000)) {
+ if (GravityUpdate(super, Q_8_8(32.0))) {
LinearMoveUpdate(super);
} else {
super->action++;
super->direction = 17;
super->speed = 0x100;
- super->zVelocity = 0x24000;
+ super->zVelocity = Q_16_16(2.25);
gUnk_02018EB0.unk_1a = 1;
}
}
void MacroPlayer_Type0_Action4(MacroPlayerEntity* this) {
sub_0808CC88(this);
- if (GravityUpdate(super, 0x1800)) {
+ if (GravityUpdate(super, Q_8_8(24.0))) {
UpdateAnimationSingleFrame(super);
LinearMoveUpdate(super);
if (super->x.HALF.HI < 0x80) {
diff --git a/src/object/minecart.c b/src/object/minecart.c
index f49042bf..1b2988d1 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -295,7 +295,7 @@ void sub_08091D90(MinecartEntity* this) {
if (super->zVelocity < 0) {
UpdateAnimationSingleFrame(super);
}
- if (((super->frame & 0x7f) == 0) && GravityUpdate(super, 0x2000) == 0) {
+ if (((super->frame & 0x7f) == 0) && GravityUpdate(super, Q_8_8(32.0)) == 0) {
super->type2 ^= 4;
super->action = 1;
this->minecartData->field_0x6 = super->type2;
diff --git a/src/object/object1F.c b/src/object/object1F.c
index 351ff739..efa7f8db 100644
--- a/src/object/object1F.c
+++ b/src/object/object1F.c
@@ -41,7 +41,7 @@ void Object1F_Init(Object1FEntity* this) {
u32 temp;
super->action = 1;
- super->zVelocity = 0x2c000;
+ super->zVelocity = Q_16_16(2.75);
super->direction = super->animationState << 2 ^ 0x10;
if (super->animationState == 0) {
super->spritePriority.b0--;
@@ -66,7 +66,7 @@ void Object1F_Action1(Object1FEntity* this) {
uVar1 = gPlayerState.field_0x3c[1];
} else {
ProcessMovement2(super);
- uVar1 = GravityUpdate(super, 0x2800);
+ uVar1 = GravityUpdate(super, Q_8_8(40.0));
}
if (uVar1 == 0) {
diff --git a/src/object/object30.c b/src/object/object30.c
index 5dc2cff7..6a999eb3 100644
--- a/src/object/object30.c
+++ b/src/object/object30.c
@@ -17,7 +17,7 @@ typedef struct {
/*0x68*/ u16 unk_68;
/*0x6a*/ u16 unk_6a;
/*0x6c*/ u16* unk_6c;
- /*0x70*/ u32 unk_70;
+ /*0x70*/ u32 gravity;
} Object30Entity;
extern u32 sub_0806F798(Entity*);
@@ -73,19 +73,19 @@ void Object30_Action2(Object30Entity* this) {
u8 tmp;
switch (super->type) {
case 0:
- if (this->unk_70 != 0) {
+ if (this->gravity != 0) {
if (super->zVelocity < 0) {
if (super->z.HALF.HI > -8) {
- this->unk_70 = 0;
+ this->gravity = 0;
} else {
- if (super->zVelocity < -0x4000) {
- this->unk_70 = -0x400;
+ if (super->zVelocity < Q_16_16(-0.25)) {
+ this->gravity = Q_8_8(-4.0);
} else {
- this->unk_70 = 0x400;
+ this->gravity = Q_8_8(4.0);
}
}
}
- GravityUpdate(super, this->unk_70);
+ GravityUpdate(super, this->gravity);
return;
}
// fallthrough
@@ -105,11 +105,11 @@ void sub_0808A968(Object30Entity* this) {
super->action = 2;
super->timer = 0x1e;
super->spriteSettings.draw = 1;
- super->zVelocity = 0x28000;
+ super->zVelocity = Q_16_16(2.5);
super->spritePriority.b1 = 3;
super->spriteSettings.shadow = 0;
super->collisionFlags |= 0x10;
super->hitbox = (Hitbox*)&gUnk_08121C58;
SetDefaultPriority(super, 2);
- this->unk_70 = 0x2800;
+ this->gravity = Q_8_8(40.0);
}
diff --git a/src/object/object37.c b/src/object/object37.c
index 99eca229..e4cbc8f9 100644
--- a/src/object/object37.c
+++ b/src/object/object37.c
@@ -43,7 +43,7 @@ void Object37_Action1(Object37Entity* this) {
if (item != 0) {
item->direction = gPlayerEntity.animationState << 2;
item->speed = 0x80;
- item->zVelocity = 0x20000;
+ item->zVelocity = Q_16_16(2.0);
}
gSave.unk24E[0] = 1;
DeleteThisEntity();
diff --git a/src/object/object45.c b/src/object/object45.c
index 1de0e0f1..ba89d886 100644
--- a/src/object/object45.c
+++ b/src/object/object45.c
@@ -39,6 +39,6 @@ void sub_0808E448(Entity* this) {
}
if (this->type == 0) {
- this->z.WORD -= 0x8000;
+ this->z.WORD -= Q_16_16(0.5);
}
}
diff --git a/src/object/object49.c b/src/object/object49.c
index 75998481..b67a7b86 100644
--- a/src/object/object49.c
+++ b/src/object/object49.c
@@ -51,7 +51,7 @@ void sub_0808F0D0(Entity* this) {
void sub_0808F14C(Entity* this) {
sub_0808F2B0(this);
- if (GravityUpdate(this, 0x2000) == 0) {
+ if (GravityUpdate(this, Q_8_8(32.0)) == 0) {
this->action++;
SoundReq(SFX_WATER_SPLASH);
}
diff --git a/src/object/object4B.c b/src/object/object4B.c
index 94fd9943..42677c72 100644
--- a/src/object/object4B.c
+++ b/src/object/object4B.c
@@ -61,7 +61,7 @@ void Object4B_Action3(Object4BEntity* this) {
super->action++;
super->direction = 0;
super->speed = 0x100;
- super->zVelocity = 0x20000;
+ super->zVelocity = Q_16_16(2.0);
super->spriteOrientation.flipY = 0;
super->timer = 0;
InitializeAnimation(super, 3);
@@ -72,7 +72,7 @@ void Object4B_Action3(Object4BEntity* this) {
void Object4B_Action4(Object4BEntity* this) {
if ((super->frame & 0x10) != 0) {
LinearMoveUpdate(super);
- if (GravityUpdate(super, 0x2000) == 0) {
+ if (GravityUpdate(super, Q_8_8(32.0)) == 0) {
GetNextFrame(super);
}
} else {
@@ -86,7 +86,7 @@ void Object4B_Action4(Object4BEntity* this) {
InitializeAnimation(super, 2);
}
} else if ((super->frame & ANIM_DONE) != 0) {
- super->zVelocity = 0x20000;
+ super->zVelocity = Q_16_16(2.0);
InitializeAnimation(super, 3);
SoundReq(SFX_12B);
}
diff --git a/src/object/object53.c b/src/object/object53.c
index c4717fce..44f567f7 100644
--- a/src/object/object53.c
+++ b/src/object/object53.c
@@ -34,7 +34,7 @@ void sub_08091120(Entity* this) {
this->spriteIndex = gUnk_08122288[this->type].spriteIndex;
this->spriteSettings.draw = 1;
this->spriteRendering.b3 = 2;
- this->zVelocity = 0x2a000;
+ this->zVelocity = Q_16_16(2.625);
InitializeAnimation(this, gUnk_08122288[this->type].animationState);
sub_08004168(this);
}
@@ -44,7 +44,7 @@ void sub_08091198(Entity* this) {
this->spriteSettings.flipY = 1;
}
- if (GravityUpdate(this, 0x2000)) {
+ if (GravityUpdate(this, Q_8_8(32.0))) {
return;
}
diff --git a/src/object/object63.c b/src/object/object63.c
index 120adaf5..1cd03832 100644
--- a/src/object/object63.c
+++ b/src/object/object63.c
@@ -24,7 +24,7 @@ void sub_08093D88(Entity* this) {
this->action = 1;
this->z.HALF.HI -= 8;
- this->zVelocity = 0x2a000;
+ this->zVelocity = Q_16_16(2.625);
this->timer = 32;
switch (this->type) {
case 0:
diff --git a/src/object/object67.c b/src/object/object67.c
index dec36521..e73c7a0b 100644
--- a/src/object/object67.c
+++ b/src/object/object67.c
@@ -89,11 +89,11 @@ void sub_08094148(Object67Entity* this) {
super->spriteSettings.flipY = 1;
}
if (super->type2 < 4) {
- super->zVelocity = (Random() & 0x1ffff) | 0x28000;
+ super->zVelocity = (Random() & 0x1ffff) | Q_16_16(2.5);
super->speed = 0x100;
InitializeAnimation(super, 0x56);
} else {
- super->zVelocity = 0x28000;
+ super->zVelocity = Q_16_16(2.5);
super->speed = 0x100;
super->direction = (Random() & 3) | super->direction;
InitializeAnimation(super, 0x57);
@@ -166,7 +166,7 @@ void sub_08094398(Object67Entity* this) {
case 0:
GetNextFrame(super);
LinearMoveUpdate(super);
- if (GravityUpdate(super, 0x4000) == 0) {
+ if (GravityUpdate(super, Q_8_8(64.0)) == 0) {
if (super->type2 < 4) {
CreateFx(super, FX_LAVA_SPLASH, 0);
}
diff --git a/src/object/object68.c b/src/object/object68.c
index f08b1659..c0878931 100644
--- a/src/object/object68.c
+++ b/src/object/object68.c
@@ -89,7 +89,7 @@ void sub_080948D0(Object68Entity* this) {
void sub_080948E8(Object68Entity* this) {
if (super->timer < 0x3c) {
- super->z.WORD -= 0x4000;
+ super->z.WORD -= Q_16_16(0.25);
if ((super->timer & 3) == 0) {
super->child = CreateFx(super, FX_DASH, 0x40);
if (super->child != NULL) {
diff --git a/src/object/object6A.c b/src/object/object6A.c
index 83e29ec0..6fdfce59 100644
--- a/src/object/object6A.c
+++ b/src/object/object6A.c
@@ -162,7 +162,7 @@ void sub_08094B0C(Object6AEntity* this) {
}
void sub_08094B3C(Object6AEntity* this) {
- super->z.WORD += 0x8000;
+ super->z.WORD += Q_16_16(0.5);
if (super->z.HALF.HI >= -13)
super->z.HALF.HI = -13;
else
@@ -323,7 +323,7 @@ void sub_08094E30(Object6AEntity* this) {
switch (super->action) {
case 0:
super->action++;
- super->z.WORD = -0xA00000;
+ super->z.WORD = Q_16_16(-160.0);
super->zVelocity = 0;
SetDefaultPriority(super, PRIO_PLAYER_EVENT);
InitializeAnimation(super, 0);
@@ -1297,7 +1297,7 @@ void sub_0809629C(Object6AEntity* this, u32 type) {
}
ExecuteScriptForEntity(super, 0);
HandleEntity0x82Actions(super);
- GravityUpdate(super, 0x1000);
+ GravityUpdate(super, Q_8_8(16.0));
tmp = super->type;
super->type = type;
sub_08080CB4(super);
diff --git a/src/object/object79.c b/src/object/object79.c
index fdcf8824..19b4bd0d 100644
--- a/src/object/object79.c
+++ b/src/object/object79.c
@@ -108,6 +108,6 @@ void sub_08098130(Object79Entity* this) {
super->direction = this->objDir.HALF.HI;
super->speed = this->unk7a;
LinearMoveUpdate(super);
- super->y.WORD -= 0x140000;
+ super->y.WORD -= Q_16_16(20.0);
super->y.WORD += this->unk6c;
}
diff --git a/src/object/object96.c b/src/object/object96.c
index ab630662..114b748e 100644
--- a/src/object/object96.c
+++ b/src/object/object96.c
@@ -39,8 +39,8 @@ void Object96_Action2(Entity*, const struct_gUnk_08123FB0*);
void Object96_Action3(Entity*, const struct_gUnk_08123FB0*);
static const struct_gUnk_08123FB0 gUnk_08123FB0[] = {
- { sub_0809D91C, sub_0809D93C, 0, 0, 0x30, 0x30, 0x1, 0x3c, 0x3c, 0x13, 0x10000, 0x1800, 0x60, 0x40, 0x4021, 0x1,
- 0x0 },
+ { sub_0809D91C, sub_0809D93C, 0, 0, 0x30, 0x30, 0x1, 0x3c, 0x3c, 0x13, Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021,
+ 0x1, 0x0 },
{ sub_0809D91C, NULL, 0, 0, 0, 0, 0, 0x63, 0x63, 0x10, 0, 0x1800, 0, 0x18,
#if defined(JP) || defined(DEMO_JP) || defined(EU)
0xCD,
@@ -48,11 +48,11 @@ static const struct_gUnk_08123FB0 gUnk_08123FB0[] = {
0xd0,
#endif
0, 0 },
- { sub_0809D91C, NULL, 0, 0, 0, 0, 0, 0x3c, 0x3c, 0xf, 0x10000, 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 },
- { sub_0809D91C, NULL, 0, 0, 0, 0, 0, 0x3c, 0x3c, 0x2, 0x10000, 0x1800, 0x140, 0x40, 0x4021, 0x1, 0x0 },
- { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0xd, 0x10000, 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 },
- { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0x1a, 0x10000, 0x1800, 0x100, 0x40, 0x4021, 0x1, 0x0 },
- { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0x13, 0x10000, 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 },
+ { sub_0809D91C, NULL, 0, 0, 0, 0, 0, 0x3c, 0x3c, 0xf, Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 },
+ { sub_0809D91C, NULL, 0, 0, 0, 0, 0, 0x3c, 0x3c, 0x2, Q_16_16(1.0), 0x1800, 0x140, 0x40, 0x4021, 0x1, 0x0 },
+ { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0xd, Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 },
+ { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0x1a, Q_16_16(1.0), 0x1800, 0x100, 0x40, 0x4021, 0x1, 0x0 },
+ { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0x13, Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 },
{ NULL, NULL, 0, 0, 0, 0, 0x0, 0x5c, 0x5c, 0x81, 0, 0x1800, 0x100, 0x20, 0x0, 0x1, 0x0 },
};
diff --git a/src/object/objectA2.c b/src/object/objectA2.c
index 68a79fe4..1eb2fe12 100644
--- a/src/object/objectA2.c
+++ b/src/object/objectA2.c
@@ -98,7 +98,7 @@ void sub_0809F448(Entity* this) {
int rand = Random();
const struct_08124708* tmp2 = &gUnk_08124708[this->subtimer];
this->subtimer++;
- tmp = 0x280000 - this->x.WORD;
+ tmp = Q_16_16(40.0) - this->x.WORD;
switch (tmp2->unk_0) {
case 0:
tmp = rand % 0x180000;
diff --git a/src/object/objectA8.c b/src/object/objectA8.c
index 83f9d422..98baa343 100644
--- a/src/object/objectA8.c
+++ b/src/object/objectA8.c
@@ -67,7 +67,7 @@ void ObjectA8_Init(ObjectA8Entity* this) {
super->action = 1;
switch (super->type2) {
case 0:
- super->zVelocity = 0x1e000;
+ super->zVelocity = Q_16_16(1.875);
super->z.HALF.HI += 8;
break;
case 2:
@@ -88,7 +88,7 @@ void ObjectA8_Init(ObjectA8Entity* this) {
}
void ObjectA8_Action1(ObjectA8Entity* this) {
- super->z.WORD -= 0xe000;
+ super->z.WORD -= Q_16_16(0.875);
if (super->frame != 0) {
if (super->timer != 0) {
super->timer *= 0x1e;
diff --git a/src/object/objectB3.c b/src/object/objectB3.c
index de0313ee..49d5588c 100644
--- a/src/object/objectB3.c
+++ b/src/object/objectB3.c
@@ -63,7 +63,7 @@ void sub_080A0AC4(Entity* this) {
}
void sub_080A0AD0(Entity* this) {
- GravityUpdate(this, 0x80);
+ GravityUpdate(this, Q_8_8(0.5));
}
void sub_080A0ADC(Entity* this) {
@@ -79,7 +79,7 @@ void sub_080A0AF0(Entity* this) {
DeleteThisEntity();
}
}
- GravityUpdate(this, 0x80);
+ GravityUpdate(this, Q_8_8(0.5));
}
void sub_080A0B28(Entity* this, ScriptExecutionContext* context) {
@@ -102,5 +102,5 @@ void sub_080A0B60(Entity* this) {
}
void sub_080A0B80(Entity* this) {
- this->y.WORD -= 0x28000;
+ this->y.WORD -= Q_16_16(2.5);
}
diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c
index fe046591..e6a96a3c 100644
--- a/src/object/objectOnSpinyBeetle.c
+++ b/src/object/objectOnSpinyBeetle.c
@@ -84,7 +84,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) {
case 0xf:
case 0x1d:
super->action = 4;
- super->zVelocity = 0x2a000;
+ super->zVelocity = Q_16_16(2.625);
super->spriteOffsetY = 0;
super->spriteSettings.shadow = 1;
super->spritePriority.b1 = 3;
@@ -250,7 +250,7 @@ void ObjectOnSpinyBeetle_Action4(ObjectOnSpinyBeetleEntity* this) {
if (super->zVelocity < 0) {
super->spriteSettings.flipY = 1;
}
- if (GravityUpdate(super, 0x2000) == 0) {
+ if (GravityUpdate(super, Q_8_8(32.0)) == 0) {
sub_080989C0(this);
}
}
diff --git a/src/object/pot.c b/src/object/pot.c
index 18f69ed2..6f8744ca 100644
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -252,7 +252,7 @@ void sub_08082824(Entity* this) {
this->spriteSettings.flipY = 1;
}
- if (GravityUpdate(this, 0x2000) == 0) {
+ if (GravityUpdate(this, Q_8_8(32.0)) == 0) {
sub_08082850(this, NULL);
}
}
diff --git a/src/object/specialFx.c b/src/object/specialFx.c
index 9f00d303..a278428e 100644
--- a/src/object/specialFx.c
+++ b/src/object/specialFx.c
@@ -215,7 +215,7 @@ void sub_08084630(SpecialFxObject* this) {
}
void sub_08084680(SpecialFxObject* this) {
- super->z.WORD += 0x4000;
+ super->z.WORD += Q_16_16(0.25);
sub_080845DC(this);
}
@@ -273,12 +273,12 @@ void sub_0808471C(SpecialFxObject* this) {
}
void sub_08084770(SpecialFxObject* this) {
- super->z.WORD -= 0x4000;
+ super->z.WORD -= Q_16_16(0.25);
sub_080845DC(this);
}
void sub_08084784(SpecialFxObject* this) {
- super->z.WORD += 0x4000;
+ super->z.WORD += Q_16_16(0.25);
sub_080845DC(this);
}
@@ -290,7 +290,7 @@ void sub_08084798(SpecialFxObject* this) {
}
void sub_080847BC(SpecialFxObject* this) {
- super->z.WORD -= 0x2000;
+ super->z.WORD -= Q_16_16(0.125);
sub_080845DC(this);
}