aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/modulator.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-05-03 21:43:53 -0700
committerChris Robinson <[email protected]>2018-05-03 22:02:32 -0700
commitac8dbd7a56e4ca0ccfbef61b89bdb55775abea6a (patch)
treed4b67b98a59bb7812460df8c2426e3dfccefff84 /Alc/effects/modulator.c
parentd8a659c6f2db425729a33b0649f467c14ef18a9b (diff)
Add a specific function for truncating float-to-int conversions
Diffstat (limited to 'Alc/effects/modulator.c')
-rw-r--r--Alc/effects/modulator.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c
index f97f7572..7f1a2cad 100644
--- a/Alc/effects/modulator.c
+++ b/Alc/effects/modulator.c
@@ -137,8 +137,7 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCcontext
else /*if(Slot->Params.EffectProps.Modulator.Waveform == AL_RING_MODULATOR_SQUARE)*/
state->GetSamples = ModulateSquare;
- state->step = fastf2i(props->Modulator.Frequency*WAVEFORM_FRACONE /
- device->Frequency);
+ state->step = float2int(props->Modulator.Frequency*WAVEFORM_FRACONE/device->Frequency + 0.5f);
state->step = clampi(state->step, 1, WAVEFORM_FRACONE-1);
/* Custom filter coeffs, which match the old version instead of a low-shelf. */