diff options
author | Chris Robinson <[email protected]> | 2017-09-21 05:42:35 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-09-21 05:42:35 -0700 |
commit | 90cedbea49e9756d97033962f6c1145991bc7095 (patch) | |
tree | df6c91ac4c7f17b33b9153994ccf3fbaf3ce9a70 /Alc/effects/distortion.c | |
parent | 0b243f1aaf5251823bb0fda7fbb9cf30706fdf33 (diff) |
Pass the context to the auxiliary effect update method
Diffstat (limited to 'Alc/effects/distortion.c')
-rw-r--r-- | Alc/effects/distortion.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c index 4619894d..546750d2 100644 --- a/Alc/effects/distortion.c +++ b/Alc/effects/distortion.c @@ -45,7 +45,7 @@ typedef struct ALdistortionState { static ALvoid ALdistortionState_Destruct(ALdistortionState *state); static ALboolean ALdistortionState_deviceUpdate(ALdistortionState *state, ALCdevice *device); -static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCdevice *Device, const ALeffectslot *Slot, const ALeffectProps *props); +static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props); static ALvoid ALdistortionState_process(ALdistortionState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels); DECLARE_DEFAULT_ALLOCATORS(ALdistortionState) @@ -71,9 +71,10 @@ static ALboolean ALdistortionState_deviceUpdate(ALdistortionState *UNUSED(state) return AL_TRUE; } -static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCdevice *Device, const ALeffectslot *Slot, const ALeffectProps *props) +static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) { - ALfloat frequency = (ALfloat)Device->Frequency; + const ALCdevice *device = context->Device; + ALfloat frequency = (ALfloat)device->Frequency; ALfloat bandwidth; ALfloat cutoff; ALfloat edge; @@ -103,7 +104,7 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCdevice cutoff / (frequency*4.0f), calc_rcpQ_from_bandwidth(cutoff / (frequency*4.0f), bandwidth) ); - ComputeAmbientGains(Device->Dry, Slot->Params.Gain, state->Gain); + ComputeAmbientGains(device->Dry, slot->Params.Gain, state->Gain); } static ALvoid ALdistortionState_process(ALdistortionState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) |