aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alcModulator.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/alcModulator.c
parent43350f9066f0c28ac8ff6269783db222508dec45 (diff)
Use cosf and sinf when available
Also clear away a few more MSVC precision warnings
Diffstat (limited to 'Alc/alcModulator.c')
-rw-r--r--Alc/alcModulator.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Alc/alcModulator.c b/Alc/alcModulator.c
index 1a2ffd64..e6f94737 100644
--- a/Alc/alcModulator.c
+++ b/Alc/alcModulator.c
@@ -52,19 +52,19 @@ typedef struct ALmodulatorState {
#define WAVEFORM_FRACBITS 16
#define WAVEFORM_FRACMASK ((1<<WAVEFORM_FRACBITS)-1)
-static __inline ALdouble Sin(ALuint index)
+static __inline ALfloat Sin(ALuint index)
{
- return sin(index * (M_PI*2.0 / (1<<WAVEFORM_FRACBITS)));
+ return aluSin(index * ((ALfloat)M_PI*2.0f / (1<<WAVEFORM_FRACBITS)));
}
-static __inline ALdouble Saw(ALuint index)
+static __inline ALfloat Saw(ALuint index)
{
- return index*(2.0/(1<<WAVEFORM_FRACBITS)) - 1.0;
+ return index*(2.0f/(1<<WAVEFORM_FRACBITS)) - 1.0f;
}
-static __inline ALdouble Square(ALuint index)
+static __inline ALfloat Square(ALuint index)
{
- return (index&(1<<(WAVEFORM_FRACBITS-1))) ? -1.0 : 1.0;
+ return (index&(1<<(WAVEFORM_FRACBITS-1))) ? -1.0f : 1.0f;
}
@@ -151,8 +151,8 @@ static ALvoid ModulatorUpdate(ALeffectState *effect, ALCcontext *Context, const
if(!state->step)
state->step = 1;
- cw = cos(2.0*M_PI * Slot->effect.Modulator.HighPassCutoff /
- Device->Frequency);
+ cw = aluCos((ALfloat)M_PI*2.0f * Slot->effect.Modulator.HighPassCutoff /
+ Device->Frequency);
a = (2.0f-cw) - aluSqrt(aluPow(2.0f-cw, 2.0f) - 1.0f);
state->iirFilter.coeff = a;