mirror of
https://github.com/zeldaret/tmc
synced 2026-08-15 12:59:16 -04:00
Use fixed point macros where possible
This commit is contained in:
@@ -182,7 +182,7 @@ void sub_080676E0(Entity* this, ScriptExecutionContext* context) {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (GravityUpdate(this, 0x1800) == 0) {
|
||||
if (GravityUpdate(this, Q_8_8(24.0)) == 0) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
+3
-3
@@ -51,16 +51,16 @@ void Cucco_Fly(Entity* this) {
|
||||
}
|
||||
|
||||
this->timer = (Random() & 1) + 1;
|
||||
this->zVelocity = 0x18000;
|
||||
this->zVelocity = Q_16_16(1.5);
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
}
|
||||
|
||||
if (GravityUpdate(this, 0x2800) == 0) {
|
||||
if (GravityUpdate(this, Q_8_8(40.0)) == 0) {
|
||||
if (--this->timer == 0) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
} else {
|
||||
this->zVelocity = 0x18000;
|
||||
this->zVelocity = Q_16_16(1.5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,15 +53,15 @@ void CuccoChick_Fly(Entity* this) {
|
||||
this->spriteSettings.flipX ^= 1;
|
||||
}
|
||||
this->timer = (Random() & 3) + 1;
|
||||
this->zVelocity = 0x10000;
|
||||
this->zVelocity = Q_16_16(1.0);
|
||||
this->frameIndex = 1;
|
||||
}
|
||||
if (GravityUpdate(this, 0x3000) == 0) {
|
||||
if (GravityUpdate(this, Q_8_8(48.0)) == 0) {
|
||||
if (--this->timer == 0) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
} else {
|
||||
this->zVelocity = 0x10000;
|
||||
this->zVelocity = Q_16_16(1.0);
|
||||
}
|
||||
}
|
||||
sub_0806E838(this);
|
||||
@@ -100,7 +100,7 @@ void CuccoChick_Fusion(Entity* this) {
|
||||
this->spriteSettings.draw = 1;
|
||||
this->frameIndex = 1;
|
||||
} else {
|
||||
if (GravityUpdate(this, 0x3000) == 0) {
|
||||
if (GravityUpdate(this, Q_8_8(48.0)) == 0) {
|
||||
this->zVelocity = Q_16_16(1.0);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ void sub_08060DFC(Entity* this) {
|
||||
|
||||
LinearMoveUpdate(this);
|
||||
sub_08060E94(this);
|
||||
uVar1 = GravityUpdate(this, 0x2000);
|
||||
uVar1 = GravityUpdate(this, Q_8_8(32.0));
|
||||
if (uVar1 == 0) {
|
||||
this->action = 7;
|
||||
this->collisionLayer = 1;
|
||||
|
||||
+2
-2
@@ -153,12 +153,12 @@ void sub_08060528(Entity* this) {
|
||||
this->field_0x6a.HWORD -= 1;
|
||||
}
|
||||
}
|
||||
GravityUpdate(this, 0x1800);
|
||||
GravityUpdate(this, Q_8_8(24.0));
|
||||
if (((this->field_0x6c.HALF.HI != 0) && (this->zVelocity == 0)) && this->z.WORD == 0) {
|
||||
this->field_0x6c.HALF.HI = 0;
|
||||
sub_080606C0(this);
|
||||
}
|
||||
if ((-1 < this->z.WORD) &&
|
||||
if (this->z.WORD >= 0 &&
|
||||
((gPlayerEntity.collisionLayer == 0 || (this->collisionLayer == gPlayerEntity.collisionLayer)))) {
|
||||
sub_0806ED78(this);
|
||||
}
|
||||
|
||||
+4
-4
@@ -416,17 +416,17 @@ void sub_0806AA50(Entity* this, ScriptExecutionContext* context) {
|
||||
case 0:
|
||||
gRoomVars.entities[0] = this;
|
||||
PrependEntityToList(this, NPC);
|
||||
this->zVelocity = 0x18000;
|
||||
this->zVelocity = Q_16_16(1.5);
|
||||
break;
|
||||
case 1:
|
||||
pEnt = FindNextDuplicateID(gRoomVars.entities[0], NPC);
|
||||
gRoomVars.entities[1] = pEnt;
|
||||
pEnt->zVelocity = 0x18000;
|
||||
pEnt->zVelocity = Q_16_16(1.5);
|
||||
break;
|
||||
case 2:
|
||||
pEnt = FindNextDuplicateID(gRoomVars.entities[1], NPC);
|
||||
gRoomVars.entities[2] = pEnt;
|
||||
pEnt->zVelocity = 0x18000;
|
||||
pEnt->zVelocity = Q_16_16(1.5);
|
||||
break;
|
||||
}
|
||||
if (messageIndex == 0x441e) {
|
||||
@@ -440,7 +440,7 @@ void sub_0806AA50(Entity* this, ScriptExecutionContext* context) {
|
||||
if (pEnt->z.HALF.HI < 0) {
|
||||
break;
|
||||
}
|
||||
pEnt->zVelocity = 0x18000;
|
||||
pEnt->zVelocity = Q_16_16(1.5);
|
||||
context->unk_18 = 2;
|
||||
break;
|
||||
case 2:
|
||||
|
||||
@@ -168,7 +168,7 @@ void sub_0806AEA8(Entity* this) {
|
||||
int old = this->field_0x82.HWORD;
|
||||
this->field_0x82.HWORD &= ~0x20;
|
||||
if (old & 0x20) {
|
||||
GravityUpdate(this, 0x4000);
|
||||
GravityUpdate(this, Q_8_8(64.0));
|
||||
}
|
||||
HandleEntity0x82Actions(this);
|
||||
this->field_0x82.HWORD = old;
|
||||
@@ -220,8 +220,8 @@ void sub_0806AF70(Entity* this, ScriptExecutionContext* context) {
|
||||
}
|
||||
|
||||
void sub_0806AF78(Entity* this, ScriptExecutionContext* context) {
|
||||
GravityUpdate(this, 0x1800);
|
||||
if (0 <= this->z.WORD && this->zVelocity < 1) {
|
||||
GravityUpdate(this, Q_8_8(24.0));
|
||||
if (0 <= this->z.WORD && this->zVelocity <= 0) {
|
||||
this->z.WORD = 0;
|
||||
sub_0806AF70(this, context);
|
||||
}
|
||||
|
||||
+2
-2
@@ -134,7 +134,7 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
|
||||
break;
|
||||
case 2:
|
||||
LinearMoveAngle(this, 0x100, 0x80);
|
||||
GravityUpdate(this, 0x2000);
|
||||
GravityUpdate(this, Q_8_8(32.0));
|
||||
if (!(this->frame & 1)) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
|
||||
case 3:
|
||||
LinearMoveAngle(this, 0x100, 0x80);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (GravityUpdate(this, 0x2000) == 0) {
|
||||
if (GravityUpdate(this, Q_8_8(32.0)) == 0) {
|
||||
context->unk_18++;
|
||||
InitAnimationForceUpdate(this, 0x1E);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user