diff --git a/src/EnemyEclInstr.cpp b/src/EnemyEclInstr.cpp index cb2f45a8..084ac315 100644 --- a/src/EnemyEclInstr.cpp +++ b/src/EnemyEclInstr.cpp @@ -774,7 +774,7 @@ void ExInsStage6XFunc6(Enemy *enemy, EclRawInstr *instr) effect->unk_11c.x = (g_Rng.GetRandomF32ZeroToOne() * 40.0f - 20.0f) / 60.0f; effect->unk_11c.y = (8.0f * baseAngleModifier) / 60.0f - (4.0f / 15.0f); effect->unk_11c.z = 0.0; - effect->unk_128 = -effect->unk_11c / RECIPROCAL(120.0f); + effect->unk_128 = -effect->unk_11c / 120.0f; particlePos = enemy->position; particlePos.x -= cosf(finalAngle) * distanceModifier; @@ -783,7 +783,7 @@ void ExInsStage6XFunc6(Enemy *enemy, EclRawInstr *instr) effect->unk_11c.x = (g_Rng.GetRandomF32ZeroToOne() * 40.0f - 20.0f) / 60.0f; effect->unk_11c.y = (8.0f * baseAngleModifier) / 60.0f - (4.0f / 15.0f); effect->unk_11c.z = 0.0; - effect->unk_128 = -effect->unk_11c / RECIPROCAL(120.0f); + effect->unk_128 = -effect->unk_11c / 120.0f; } enemy->exInsFunc6Timer.Tick(); diff --git a/src/Player.cpp b/src/Player.cpp index 4debf188..d53eec17 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -1319,8 +1319,8 @@ i32 Player::CalcLaserHitbox(D3DXVECTOR3 *laserCenter, D3DXVECTOR3 *laserSize, D3 playerRelativeTopLeft = laserTopLeft - this->hitboxSize; playerRelativeBottomRight = laserTopLeft + this->hitboxSize; - laserTopLeft = *laserCenter - *laserSize / RECIPROCAL(2.0f); - laserBottomRight = *laserCenter + *laserSize / RECIPROCAL(2.0f); + laserTopLeft = *laserCenter - *laserSize / 2.0f; + laserBottomRight = *laserCenter + *laserSize / 2.0f; if (!(playerRelativeTopLeft.x > laserBottomRight.x || playerRelativeBottomRight.x < laserTopLeft.x || playerRelativeTopLeft.y > laserBottomRight.y || playerRelativeBottomRight.y < laserTopLeft.y)) @@ -1399,7 +1399,7 @@ void Player::ScoreGraze(D3DXVECTOR3 *center) } } - particlePosition = (this->positionCenter + *center) / RECIPROCAL(2.0f); + particlePosition = (this->positionCenter + *center) / 2.0f; g_EffectManager.SpawnParticles(PARTICLE_EFFECT_UNK_8, &particlePosition, 1, COLOR_WHITE); g_GameManager.AddScore(500); g_GameManager.IncreaseSubrank(6); diff --git a/src/ZunMath.hpp b/src/ZunMath.hpp index a01656de..b475cddd 100644 --- a/src/ZunMath.hpp +++ b/src/ZunMath.hpp @@ -3,8 +3,6 @@ #include #include -#define RECIPROCAL(x) (1.0f / x) - struct ZunVec2 { f32 x; @@ -88,3 +86,8 @@ void __inline sincosmul(D3DXVECTOR3 *out_vel, f32 input, f32 multiplier) fstp [eax+4] } } + +f32 __inline invertf(f32 x) +{ + return 1.f / x; +}