aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alu.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-01-06 04:16:51 -0800
committerChris Robinson <[email protected]>2019-01-06 04:16:51 -0800
commitda3a916042a7ba9426af1d6f03e689dbd7760191 (patch)
treeab6cfc0d2fd26504a013989af7ecd399a4034914 /Alc/alu.cpp
parent98f3e6a16295029129193a073680a70c034703dd (diff)
Replace macros with constexpr inline functions
Diffstat (limited to 'Alc/alu.cpp')
-rw-r--r--Alc/alu.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index 58247631..e5fa0c89 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -1390,7 +1390,7 @@ void CalcAttnSourceParams(ALvoice *voice, const ALvoicePropsBase *props, const A
ALfloat spread{0.0f};
if(props->Radius > Distance)
- spread = F_TAU - Distance/props->Radius*F_PI;
+ spread = al::MathDefs<float>::Tau() - Distance/props->Radius*al::MathDefs<float>::Pi();
else if(Distance > 0.0f)
spread = std::asin(props->Radius/Distance) * 2.0f;
@@ -1571,8 +1571,10 @@ void ApplyStablizer(FrontStablizer *Stablizer, ALfloat (*RESTRICT Buffer)[BUFFER
* frequency sum is 1/4th toward center (3/4ths on left/right). These
* values can be tweaked.
*/
- ALfloat m{lfsum*std::cos(1.0f/3.0f * F_PI_2) + hfsum*std::cos(1.0f/4.0f * F_PI_2)};
- ALfloat c{lfsum*std::sin(1.0f/3.0f * F_PI_2) + hfsum*std::sin(1.0f/4.0f * F_PI_2)};
+ ALfloat m{lfsum*std::cos(1.0f/3.0f * (al::MathDefs<float>::Pi()*0.5f)) +
+ hfsum*std::cos(1.0f/4.0f * (al::MathDefs<float>::Pi()*0.5f))};
+ ALfloat c{lfsum*std::sin(1.0f/3.0f * (al::MathDefs<float>::Pi()*0.5f)) +
+ hfsum*std::sin(1.0f/4.0f * (al::MathDefs<float>::Pi()*0.5f))};
/* The generated center channel signal adds to the existing signal,
* while the modified left and right channels replace.