summaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-22 11:17:01 -0700
committerChris Robinson <[email protected]>2011-09-22 11:17:01 -0700
commit470b506952c83580cfae5c3dc94a3b359c900dea (patch)
tree149d982293f816d6bf240f0491013573449f8f3d /Alc/ALu.c
parentde8a447ea50aba854df956716c6abdd846916d5f (diff)
Use macros for float-typed PI values, to avoid manual casts everywhere
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index a3e121e0..364c6093 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -211,8 +211,8 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
DryGain *= aluSqrt(2.0f/4.0f);
for(c = 0;c < 2;c++)
{
- pos = aluCart2LUTpos(aluCos((ALfloat)M_PI/180.0f * angles_Rear[c]),
- aluSin((ALfloat)M_PI/180.0f * angles_Rear[c]));
+ pos = aluCart2LUTpos(aluCos(F_PI/180.0f * angles_Rear[c]),
+ aluSin(F_PI/180.0f * angles_Rear[c]));
SpeakerGain = Device->PanningLUT[pos];
for(i = 0;i < (ALint)Device->NumChan;i++)
@@ -284,7 +284,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
/* Get the static HRIR coefficients and delays for this
* channel. */
GetLerpedHrtfCoeffs(ALContext->Device->Hrtf,
- 0.0f, (ALfloat)M_PI/180.0f * angles[c],
+ 0.0f, F_PI/180.0f * angles[c],
DryGain*ListenerGain,
ALSource->Params.HrtfCoeffs[c],
ALSource->Params.HrtfDelay[c]);
@@ -301,8 +301,8 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
SrcMatrix[c][LFE] += DryGain * ListenerGain;
continue;
}
- pos = aluCart2LUTpos(aluCos((ALfloat)M_PI/180.0f * angles[c]),
- aluSin((ALfloat)M_PI/180.0f * angles[c]));
+ pos = aluCart2LUTpos(aluCos(F_PI/180.0f * angles[c]),
+ aluSin(F_PI/180.0f * angles[c]));
SpeakerGain = Device->PanningLUT[pos];
for(i = 0;i < (ALint)Device->NumChan;i++)
@@ -321,7 +321,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
/* Update filter coefficients. Calculations based on the I3DL2
* spec. */
- cw = aluCos((ALfloat)M_PI*2.0f * LOWPASSFREQCUTOFF / Frequency);
+ cw = aluCos(F_PI*2.0f * LOWPASSFREQCUTOFF / Frequency);
/* We use two chained one-pole filters, so we need to take the
* square root of the squared gain, which is the same as the base
@@ -573,7 +573,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
}
//3. Apply directional soundcones
- Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * (180.0/M_PI);
+ Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * (180.0f/F_PI);
if(Angle >= InnerAngle && Angle <= OuterAngle)
{
ALfloat scale = (Angle-InnerAngle) / (OuterAngle-InnerAngle);
@@ -790,7 +790,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Send[i].WetGain = WetGain[i];
/* Update filter coefficients. */
- cw = aluCos((ALfloat)M_PI*2.0f * LOWPASSFREQCUTOFF / Frequency);
+ cw = aluCos(F_PI*2.0f * LOWPASSFREQCUTOFF / Frequency);
ALSource->Params.iirFilter.coeff = lpCoeffCalc(DryGainHF, cw);
for(i = 0;i < NumSends;i++)