diff options
author | Chris Robinson <[email protected]> | 2019-03-23 13:55:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-03-23 13:55:07 -0700 |
commit | 12d4953a5fa3d21e7e77825816bb6c58443cf3ab (patch) | |
tree | e559fe93b6614cdd436ba2e7baeb156093d80bdd /Alc/alu.cpp | |
parent | 6df673e01c98b34deac49c703b2f5f1530f30855 (diff) |
Remove a couple redundant distance checks
Diffstat (limited to 'Alc/alu.cpp')
-rw-r--r-- | Alc/alu.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp index c7cf08f3..0e91844b 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -723,12 +723,8 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo if(Distance > std::numeric_limits<float>::epsilon()) { - ALfloat ev{0.0f}, az{0.0f}; - if(Distance > 0.0f) - { - ev = std::asin(clampf(ypos, -1.0f, 1.0f)); - az = std::atan2(xpos, -zpos); - } + const ALfloat ev{std::asin(clampf(ypos, -1.0f, 1.0f))}; + const ALfloat az{std::atan2(xpos, -zpos)}; /* Get the HRIR coefficients and delays just once, for the given * source direction. @@ -833,12 +829,8 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo CalcAmbiCoeffs(-xpos, ypos, -zpos, Spread, coeffs); else { - ALfloat ev{0.0f}, az{0.0f}; - if(Distance > 0.0f) - { - ev = std::asin(clampf(ypos, -1.0f, 1.0f)); - az = std::atan2(xpos, -zpos); - } + const ALfloat ev{std::asin(clampf(ypos, -1.0f, 1.0f))}; + const ALfloat az{std::atan2(xpos, -zpos)}; CalcAngleCoeffs(ScaleAzimuthFront(az, 1.5f), ev, Spread, coeffs); } |