Use fixed point macros where possible

This commit is contained in:
Tal Hayon
2022-04-01 18:19:56 +03:00
parent 9233701a5d
commit d6d7916a46
90 changed files with 223 additions and 223 deletions
+5 -5
View File
@@ -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;
+2 -2
View File
@@ -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);
}
}
+2 -2
View File
@@ -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) {
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -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;
}
}
+1 -1
View File
@@ -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);
+4 -4
View File
@@ -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);
}
+2 -2
View File
@@ -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)) {
+6 -6
View File
@@ -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;
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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);
}
}
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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);
+7 -7
View File
@@ -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) {
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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) {
+9 -9
View File
@@ -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);
}
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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);
}
}
+1 -1
View File
@@ -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);
}
+3 -3
View File
@@ -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);
}
+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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:
+3 -3
View File
@@ -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);
}
+1 -1
View File
@@ -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) {
+3 -3
View File
@@ -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);
+1 -1
View File
@@ -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;
}
+7 -7
View File
@@ -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 },
};
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -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);
}
+2 -2
View File
@@ -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);
}
}
+1 -1
View File
@@ -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);
}
}
+4 -4
View File
@@ -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);
}