aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-10-31 01:35:01 -0700
committerChris Robinson <[email protected]>2015-10-31 01:35:01 -0700
commit0644ebbaa2c3cbbe08c3aaaa41abe79fcfb6f2d4 (patch)
treea195115b5a50ba499aa7879cf671cc877d4aa6a4 /Alc/effects
parent19c437de6d88b30e9c55b886caee260eb3514db1 (diff)
Use modff to split the modulation delay components
Diffstat (limited to 'Alc/effects')
-rw-r--r--Alc/effects/reverb.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c
index fac639b8..6c3f2691 100644
--- a/Alc/effects/reverb.c
+++ b/Alc/effects/reverb.c
@@ -242,7 +242,7 @@ static inline ALvoid DelayLineIn(DelayLine *Delay, ALuint offset, ALfloat in)
// reverb.
static inline ALfloat EAXModulation(ALreverbState *State, ALuint offset, ALfloat in)
{
- ALfloat sinus, frac;
+ ALfloat sinus, frac, fdelay;
ALfloat out0, out1;
ALuint delay;
@@ -261,9 +261,8 @@ static inline ALfloat EAXModulation(ALreverbState *State, ALuint offset, ALfloat
State->Mod.Coeff);
// Calculate the read offset and fraction between it and the next sample.
- frac = (1.0f + (State->Mod.Filter * sinus));
- delay = fastf2u(frac);
- frac -= delay;
+ frac = modff(State->Mod.Filter*sinus + 1.0f, &fdelay);
+ delay = fastf2u(fdelay);
// Get the two samples crossed by the offset, and feed the delay line
// with the next input sample.