diff options
author | Chris Robinson <[email protected]> | 2011-09-29 06:55:00 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-29 06:55:00 -0700 |
commit | 9e2600cac4accf671382dad3add9ec1bad5bb2ca (patch) | |
tree | f32a63c941b3bf812f430db80f6f5c1366ef5b9b /Alc/alcEcho.c | |
parent | 3c27c24dec5cc6830a53b098d8e94cb3d28b4aeb (diff) |
Use fast float-to-int conversions for some mixer-related code
Diffstat (limited to 'Alc/alcEcho.c')
-rw-r--r-- | Alc/alcEcho.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index c77e185e..1d2afcf0 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -73,8 +73,8 @@ static ALboolean EchoDeviceUpdate(ALeffectState *effect, 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 = (ALuint)(AL_ECHO_MAX_DELAY * Device->Frequency) + 1; - maxlen += (ALuint)(AL_ECHO_MAX_LRDELAY * Device->Frequency) + 1; + maxlen = fastf2u(AL_ECHO_MAX_DELAY * Device->Frequency) + 1; + maxlen += fastf2u(AL_ECHO_MAX_LRDELAY * Device->Frequency) + 1; maxlen = NextPowerOf2(maxlen); if(maxlen != state->BufferLength) @@ -101,8 +101,8 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff ALfloat lrpan, cw, g, gain; ALuint i; - state->Tap[0].delay = (ALuint)(Slot->effect.Echo.Delay * frequency) + 1; - state->Tap[1].delay = (ALuint)(Slot->effect.Echo.LRDelay * frequency); + state->Tap[0].delay = fastf2u(Slot->effect.Echo.Delay * frequency) + 1; + state->Tap[1].delay = fastf2u(Slot->effect.Echo.LRDelay * frequency); state->Tap[1].delay += state->Tap[0].delay; lrpan = Slot->effect.Echo.Spread*0.5f + 0.5f; |