diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2018-12-24 13:29:36 -0800 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2018-12-24 13:29:36 -0800 |
commit | ae86aef4db02675ec64d690556905ea034753c87 (patch) | |
tree | 9cfaf0b176150d2563ca62429ced1884c6db510d /Alc/effects/modulator.cpp | |
parent | cd213fe6b731269caa484eb3cb9b830dac7f5c58 (diff) |
Provide effect target parameters through a common struct
Diffstat (limited to 'Alc/effects/modulator.cpp')
-rw-r--r-- | Alc/effects/modulator.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/Alc/effects/modulator.cpp b/Alc/effects/modulator.cpp index 84aa0e2c..2b62d66a 100644 --- a/Alc/effects/modulator.cpp +++ b/Alc/effects/modulator.cpp @@ -89,7 +89,7 @@ struct ALmodulatorState final : public EffectState { ALboolean deviceUpdate(const ALCdevice *device) override; - void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override; + void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props, const EffectTarget target) override; void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override; DEF_NEWDEL(ALmodulatorState) @@ -105,7 +105,7 @@ ALboolean ALmodulatorState::deviceUpdate(const ALCdevice *UNUSED(device)) return AL_TRUE; } -void ALmodulatorState::update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) +void ALmodulatorState::update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props, const EffectTarget target) { const ALCdevice *device = context->Device; ALfloat f0norm; @@ -131,22 +131,11 @@ void ALmodulatorState::update(const ALCcontext *context, const ALeffectslot *slo for(i = 1;i < MAX_EFFECT_CHANNELS;i++) mChans[i].Filter.copyParamsFrom(mChans[0].Filter); - if(ALeffectslot *target{slot->Params.Target}) - { - mOutBuffer = target->WetBuffer; - mOutChannels = target->NumChannels; - for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputePanGains(target, alu::Matrix::Identity()[i].data(), slot->Params.Gain, - mChans[i].TargetGains); - } - else - { - mOutBuffer = device->FOAOut.Buffer; - mOutChannels = device->FOAOut.NumChannels; - for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputePanGains(&device->FOAOut, alu::Matrix::Identity()[i].data(), slot->Params.Gain, - mChans[i].TargetGains); - } + mOutBuffer = target.FOAOut->Buffer; + mOutChannels = target.FOAOut->NumChannels; + for(i = 0;i < MAX_EFFECT_CHANNELS;i++) + ComputePanGains(target.FOAOut, alu::Matrix::Identity()[i].data(), slot->Params.Gain, + mChans[i].TargetGains); } void ALmodulatorState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels) |