aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/distortion.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-05-13 18:28:01 -0700
committerChris Robinson <[email protected]>2016-05-13 18:28:01 -0700
commit93a94d177c4bb0b9c8feb85420a388d32df4cc8f (patch)
tree9a395a1ce06ed8e6057c6b74ae520f8140fa977e /Alc/effects/distortion.c
parent59cd6230a661d5cee69c0a44c4dde152eed9f865 (diff)
Get rid of an unnecessary copy of ALeffectProps
Diffstat (limited to 'Alc/effects/distortion.c')
-rw-r--r--Alc/effects/distortion.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c
index 534a817c..deec6092 100644
--- a/Alc/effects/distortion.c
+++ b/Alc/effects/distortion.c
@@ -53,7 +53,7 @@ static ALboolean ALdistortionState_deviceUpdate(ALdistortionState *UNUSED(state)
return AL_TRUE;
}
-static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCdevice *Device, const ALeffectslot *Slot)
+static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCdevice *Device, const ALeffectslot *Slot, const ALeffectProps *props)
{
ALfloat frequency = (ALfloat)Device->Frequency;
ALfloat bandwidth;
@@ -61,15 +61,15 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCdevice
ALfloat edge;
/* Store distorted signal attenuation settings */
- state->attenuation = Slot->Params.EffectProps.Distortion.Gain;
+ state->attenuation = props->Distortion.Gain;
/* Store waveshaper edge settings */
- edge = sinf(Slot->Params.EffectProps.Distortion.Edge * (F_PI_2));
+ edge = sinf(props->Distortion.Edge * (F_PI_2));
edge = minf(edge, 0.99f);
state->edge_coeff = 2.0f * edge / (1.0f-edge);
/* Lowpass filter */
- cutoff = Slot->Params.EffectProps.Distortion.LowpassCutoff;
+ cutoff = props->Distortion.LowpassCutoff;
/* Bandwidth value is constant in octaves */
bandwidth = (cutoff / 2.0f) / (cutoff * 0.67f);
ALfilterState_setParams(&state->lowpass, ALfilterType_LowPass, 1.0f,
@@ -77,9 +77,9 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCdevice
);
/* Bandpass filter */
- cutoff = Slot->Params.EffectProps.Distortion.EQCenter;
+ cutoff = props->Distortion.EQCenter;
/* Convert bandwidth in Hz to octaves */
- bandwidth = Slot->Params.EffectProps.Distortion.EQBandwidth / (cutoff * 0.67f);
+ bandwidth = props->Distortion.EQBandwidth / (cutoff * 0.67f);
ALfilterState_setParams(&state->bandpass, ALfilterType_BandPass, 1.0f,
cutoff / (frequency*4.0f), calc_rcpQ_from_bandwidth(cutoff / (frequency*4.0f), bandwidth)
);