aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/echo.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/echo.c
parentd8a659c6f2db425729a33b0649f467c14ef18a9b (diff)
Add a specific function for truncating float-to-int conversions
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r--Alc/effects/echo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index a98ed933..676b17e8 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -92,8 +92,8 @@ static ALboolean ALechoState_deviceUpdate(ALechoState *state, ALCdevice *Device)
// Use the next power of 2 for the buffer length, so the tap offsets can be
// wrapped using a mask instead of a modulo
- maxlen = fastf2i(AL_ECHO_MAX_DELAY*Device->Frequency + 0.5f) +
- fastf2i(AL_ECHO_MAX_LRDELAY*Device->Frequency + 0.5f);
+ maxlen = float2int(AL_ECHO_MAX_DELAY*Device->Frequency + 0.5f) +
+ float2int(AL_ECHO_MAX_LRDELAY*Device->Frequency + 0.5f);
maxlen = NextPowerOf2(maxlen);
if(maxlen <= 0) return AL_FALSE;
@@ -120,8 +120,8 @@ static ALvoid ALechoState_update(ALechoState *state, const ALCcontext *context,
ALfloat coeffs[MAX_AMBI_COEFFS];
ALfloat gainhf, lrpan, spread;
- state->Tap[0].delay = maxi(fastf2i(props->Echo.Delay*frequency + 0.5f), 1);
- state->Tap[1].delay = fastf2i(props->Echo.LRDelay*frequency + 0.5f);
+ state->Tap[0].delay = maxi(float2int(props->Echo.Delay*frequency + 0.5f), 1);
+ state->Tap[1].delay = float2int(props->Echo.LRDelay*frequency + 0.5f);
state->Tap[1].delay += state->Tap[0].delay;
spread = props->Echo.Spread;