summaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-22 01:00:44 -0700
committerChris Robinson <[email protected]>2011-09-22 01:00:44 -0700
commita4b1239f45daa29bb423077da60804d7bf9287eb (patch)
tree0a9f7025fe1d298f5de58fde0836af9541c3ed01 /Alc/ALu.c
parent43350f9066f0c28ac8ff6269783db222508dec45 (diff)
Use cosf and sinf when available
Also clear away a few more MSVC precision warnings
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 670df970..a3e121e0 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(cos(angles_Rear[c] * (M_PI/180.0)),
- sin(angles_Rear[c] * (M_PI/180.0)));
+ pos = aluCart2LUTpos(aluCos((ALfloat)M_PI/180.0f * angles_Rear[c]),
+ aluSin((ALfloat)M_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.0, angles[c] * (M_PI/180.0),
+ 0.0f, (ALfloat)M_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(cos(angles[c] * (M_PI/180.0)),
- sin(angles[c] * (M_PI/180.0)));
+ pos = aluCart2LUTpos(aluCos((ALfloat)M_PI/180.0f * angles[c]),
+ aluSin((ALfloat)M_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 = cos(2.0*M_PI * LOWPASSFREQCUTOFF / Frequency);
+ cw = aluCos((ALfloat)M_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
@@ -790,7 +790,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Send[i].WetGain = WetGain[i];
/* Update filter coefficients. */
- cw = cos(2.0*M_PI * LOWPASSFREQCUTOFF / Frequency);
+ cw = aluCos((ALfloat)M_PI*2.0f * LOWPASSFREQCUTOFF / Frequency);
ALSource->Params.iirFilter.coeff = lpCoeffCalc(DryGainHF, cw);
for(i = 0;i < NumSends;i++)