diff options
author | Chris Robinson <[email protected]> | 2013-05-25 22:07:31 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-25 22:07:31 -0700 |
commit | d1c5599c8ead4905d46e5d86f3f0547d3a925d44 (patch) | |
tree | 28ae38a4b174dd3d96d9046901bee0408c76857a /Alc/effects/echo.c | |
parent | 6571d805400f018b51835a8e37752409af9b1c4d (diff) |
Use an ALeffectProps union to store the effect properties
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r-- | Alc/effects/echo.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c index 533461ac..d1f734bf 100644 --- a/Alc/effects/echo.c +++ b/Alc/effects/echo.c @@ -96,16 +96,16 @@ static ALvoid ALechoState_Update(ALechoState *state, ALCdevice *Device, const AL ALfloat dirGain; ALuint i; - state->Tap[0].delay = fastf2u(Slot->effect.Echo.Delay * frequency) + 1; - state->Tap[1].delay = fastf2u(Slot->effect.Echo.LRDelay * frequency); + state->Tap[0].delay = fastf2u(Slot->EffectProps.Echo.Delay * frequency) + 1; + state->Tap[1].delay = fastf2u(Slot->EffectProps.Echo.LRDelay * frequency); state->Tap[1].delay += state->Tap[0].delay; - lrpan = Slot->effect.Echo.Spread; + lrpan = Slot->EffectProps.Echo.Spread; - state->FeedGain = Slot->effect.Echo.Feedback; + state->FeedGain = Slot->EffectProps.Echo.Feedback; cw = cosf(F_PI*2.0f * LOWPASSFREQREF / frequency); - g = 1.0f - Slot->effect.Echo.Damping; + g = 1.0f - Slot->EffectProps.Echo.Damping; state->iirFilter.coeff = lpCoeffCalc(g, cw); gain = Slot->Gain; @@ -229,39 +229,40 @@ void ALecho_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, cons } void ALecho_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val) { + ALeffectProps *props = &effect->Props; switch(param) { case AL_ECHO_DELAY: if(val >= AL_ECHO_MIN_DELAY && val <= AL_ECHO_MAX_DELAY) - effect->Echo.Delay = val; + props->Echo.Delay = val; else alSetError(context, AL_INVALID_VALUE); break; case AL_ECHO_LRDELAY: if(val >= AL_ECHO_MIN_LRDELAY && val <= AL_ECHO_MAX_LRDELAY) - effect->Echo.LRDelay = val; + props->Echo.LRDelay = val; else alSetError(context, AL_INVALID_VALUE); break; case AL_ECHO_DAMPING: if(val >= AL_ECHO_MIN_DAMPING && val <= AL_ECHO_MAX_DAMPING) - effect->Echo.Damping = val; + props->Echo.Damping = val; else alSetError(context, AL_INVALID_VALUE); break; case AL_ECHO_FEEDBACK: if(val >= AL_ECHO_MIN_FEEDBACK && val <= AL_ECHO_MAX_FEEDBACK) - effect->Echo.Feedback = val; + props->Echo.Feedback = val; else alSetError(context, AL_INVALID_VALUE); break; case AL_ECHO_SPREAD: if(val >= AL_ECHO_MIN_SPREAD && val <= AL_ECHO_MAX_SPREAD) - effect->Echo.Spread = val; + props->Echo.Spread = val; else alSetError(context, AL_INVALID_VALUE); break; @@ -284,26 +285,27 @@ void ALecho_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALin } void ALecho_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val) { + const ALeffectProps *props = &effect->Props; switch(param) { case AL_ECHO_DELAY: - *val = effect->Echo.Delay; + *val = props->Echo.Delay; break; case AL_ECHO_LRDELAY: - *val = effect->Echo.LRDelay; + *val = props->Echo.LRDelay; break; case AL_ECHO_DAMPING: - *val = effect->Echo.Damping; + *val = props->Echo.Damping; break; case AL_ECHO_FEEDBACK: - *val = effect->Echo.Feedback; + *val = props->Echo.Feedback; break; case AL_ECHO_SPREAD: - *val = effect->Echo.Spread; + *val = props->Echo.Spread; break; default: |