diff options
Diffstat (limited to 'Alc/effects')
-rw-r--r-- | Alc/effects/chorus.c | 2 | ||||
-rw-r--r-- | Alc/effects/modulator.c | 2 | ||||
-rw-r--r-- | Alc/effects/reverb.c | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index 5ef82cb4..f4383aa5 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -91,7 +91,7 @@ static ALboolean ALchorusState_deviceUpdate(ALchorusState *state, ALCdevice *Dev ALsizei maxlen; ALsizei it; - maxlen = fastf2u(AL_CHORUS_MAX_DELAY * 2.0f * Device->Frequency) + 1; + maxlen = fastf2i(AL_CHORUS_MAX_DELAY * 2.0f * Device->Frequency) + 1; maxlen = NextPowerOf2(maxlen); if(maxlen != state->BufferLength) diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c index e9026a62..5de88fcd 100644 --- a/Alc/effects/modulator.c +++ b/Alc/effects/modulator.c @@ -127,7 +127,7 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCdevice * else /*if(Slot->Params.EffectProps.Modulator.Waveform == AL_RING_MODULATOR_SQUARE)*/ state->Process = ModulateSquare; - state->step = fastf2u(props->Modulator.Frequency*WAVEFORM_FRACONE / + state->step = fastf2i(props->Modulator.Frequency*WAVEFORM_FRACONE / Device->Frequency); if(state->step == 0) state->step = 1; diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index e0c0831a..44174b75 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -511,7 +511,7 @@ static ALuint CalcLineLength(const ALfloat length, const ptrdiff_t offset, const /* All line lengths are powers of 2, calculated from their lengths in * seconds, rounded up. */ - samples = fastf2u(ceilf(length*frequency)); + samples = fastf2i(ceilf(length*frequency)); samples = NextPowerOf2(samples + extra); /* All lines share a single sample buffer. */ @@ -627,7 +627,7 @@ static ALboolean ALreverbState_deviceUpdate(ALreverbState *State, ALCdevice *Dev /* The late feed taps are set a fixed position past the latest delay tap. */ for(i = 0;i < 4;i++) - State->LateFeedTap = fastf2u((AL_EAXREVERB_MAX_REFLECTIONS_DELAY + + State->LateFeedTap = fastf2i((AL_EAXREVERB_MAX_REFLECTIONS_DELAY + EARLY_TAP_LENGTHS[3]*multiplier) * frequency); @@ -1055,7 +1055,7 @@ static ALvoid UpdateModulator(const ALfloat modTime, const ALfloat modDepth, * (1 sample) and when the timing changes, the index is rescaled to the new * range to keep the sinus consistent. */ - range = maxu(fastf2u(modTime*frequency), 1); + range = maxi(fastf2i(modTime*frequency), 1); State->Mod.Index = (ALuint)(State->Mod.Index * (ALuint64)range / State->Mod.Range); State->Mod.Range = range; @@ -1094,13 +1094,13 @@ static ALvoid UpdateDelayLine(const ALfloat earlyDelay, const ALfloat lateDelay, for(i = 0;i < 4;i++) { length = earlyDelay + EARLY_TAP_LENGTHS[i]*multiplier; - State->EarlyDelayTap[i][1] = fastf2u(length * frequency); + State->EarlyDelayTap[i][1] = fastf2i(length * frequency); length = EARLY_TAP_LENGTHS[i]*multiplier; State->EarlyDelayCoeff[i] = CalcDecayCoeff(length, decayTime); length = lateDelay + (LATE_LINE_LENGTHS[i] - LATE_LINE_LENGTHS[0])*0.25f*multiplier; - State->LateDelayTap[i][1] = State->LateFeedTap + fastf2u(length * frequency); + State->LateDelayTap[i][1] = State->LateFeedTap + fastf2i(length * frequency); } } @@ -1124,7 +1124,7 @@ static ALvoid UpdateEarlyLines(const ALfloat density, const ALfloat decayTime, c length = EARLY_LINE_LENGTHS[i] * multiplier; /* Calculate the delay offset for each delay line. */ - State->Early.Offset[i][1] = fastf2u(length * frequency); + State->Early.Offset[i][1] = fastf2i(length * frequency); /* Calculate the gain (coefficient) for each line. */ State->Early.Coeff[i] = CalcDecayCoeff(length, decayTime); @@ -1181,7 +1181,7 @@ static ALvoid UpdateLateLines(const ALfloat density, const ALfloat diffusion, co length = lerp(LATE_LINE_LENGTHS[i] * multiplier, echoTime, echoDepth); /* Calculate the delay offset for each delay line. */ - State->Late.Offset[i][1] = fastf2u(length * frequency); + State->Late.Offset[i][1] = fastf2i(length * frequency); /* Approximate the absorption that the vector all-pass would exhibit * given the current diffusion so we don't have to process a full T60 |