From 12d4953a5fa3d21e7e77825816bb6c58443cf3ab Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 23 Mar 2019 13:55:07 -0700 Subject: Remove a couple redundant distance checks --- Alc/alu.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'Alc') 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::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); } -- cgit v1.2.3