diff options
author | Chris Robinson <[email protected]> | 2011-09-24 12:17:39 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-24 12:17:39 -0700 |
commit | cf56b0733b86019631c4b877ece6bcceb3b2b50a (patch) | |
tree | be8ecd14048eeafed8a1c0d493f840ba4329a0ae /Alc | |
parent | 2b0a63003fca82f1bc5d1e36cf44d0018dc1b257 (diff) |
Look for and use atan2f, log10f, and floorf
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 2 | ||||
-rw-r--r-- | Alc/alcReverb.c | 2 | ||||
-rw-r--r-- | Alc/hrtf.c | 6 |
3 files changed, 5 insertions, 5 deletions
@@ -717,7 +717,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) // the listener. This prevents +0 and -0 Z from producing // inconsistent panning. ev = aluAsin(Position[1]); - az = atan2(Position[0], -Position[2]*ZScale); + az = aluAtan2(Position[0], -Position[2]*ZScale); } // Check to see if the HRIR is already moving. diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c index 80439669..92a82a51 100644 --- a/Alc/alcReverb.c +++ b/Alc/alcReverb.c @@ -757,7 +757,7 @@ static __inline ALfloat CalcDecayCoeff(ALfloat length, ALfloat decayTime) // reaches -60 dB. static __inline ALfloat CalcDecayLength(ALfloat coeff, ALfloat decayTime) { - return log10(coeff) * decayTime / -3.0f/*log10(0.001)*/; + return aluLog10(coeff) * decayTime / aluLog10(0.001)/*-60 dB*/; } // Calculate the high frequency parameter for the I3DL2 coefficient @@ -85,7 +85,7 @@ static void CalcAzIndices(ALuint evidx, ALfloat az, ALuint *azidx, ALfloat *azmu az = (F_PI*2.0f + az) * azCount[evidx] / (F_PI*2.0f); azidx[0] = (ALuint)az % azCount[evidx]; azidx[1] = (azidx[0] + 1) % azCount[evidx]; - *azmu = az - floor(az); + *azmu = az - aluFloor(az); } // Calculates the normalized HRTF transition factor (delta) from the changes @@ -99,7 +99,7 @@ ALfloat CalcHrtfDelta(ALfloat oldGain, ALfloat newGain, const ALfloat olddir[3], // Calculate the normalized dB gain change. newGain = maxf(newGain, 0.0001f); oldGain = maxf(oldGain, 0.0001f); - gainChange = aluFabs(log10(newGain / oldGain) / log10(0.0001f)); + gainChange = aluFabs(aluLog10(newGain / oldGain) / aluLog10(0.0001f)); // Calculate the normalized listener to source angle change when there is // enough gain to notice it. @@ -231,7 +231,7 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a ridx[3] = evOffset[evidx[1]] + ((azCount[evidx[1]]-azidx[1]) % azCount[evidx[1]]); // Calculate the stepping parameters. - delta = maxf(floor(delta*(Hrtf->sampleRate*0.015f) + 0.5f), 1.0f); + delta = maxf(aluFloor(delta*(Hrtf->sampleRate*0.015f) + 0.5f), 1.0f); step = 1.0f / delta; // Calculate the normalized and attenuated target HRIR coefficients using |