aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-05-29 22:49:45 -0700
committerChris Robinson <[email protected]>2018-05-29 22:49:45 -0700
commit46c59f382f5d417a8e95a58a8e2156b9c4b35f1a (patch)
tree147baf988ee9b416ea291f59d9dae7994033fd70 /Alc/effects
parent8854720e8a83ccb25221b085612b9a47c36bfa16 (diff)
Use fastf2i instead of manual rounding in another place
Diffstat (limited to 'Alc/effects')
-rw-r--r--Alc/effects/modulator.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c
index 7f1a2cad..db771103 100644
--- a/Alc/effects/modulator.c
+++ b/Alc/effects/modulator.c
@@ -137,7 +137,8 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCcontext
else /*if(Slot->Params.EffectProps.Modulator.Waveform == AL_RING_MODULATOR_SQUARE)*/
state->GetSamples = ModulateSquare;
- state->step = float2int(props->Modulator.Frequency*WAVEFORM_FRACONE/device->Frequency + 0.5f);
+ state->step = fastf2i(props->Modulator.Frequency / (ALfloat)device->Frequency *
+ WAVEFORM_FRACONE);
state->step = clampi(state->step, 1, WAVEFORM_FRACONE-1);
/* Custom filter coeffs, which match the old version instead of a low-shelf. */