aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alu.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-24 13:29:36 -0800
committerChris Robinson <[email protected]>2018-12-24 13:29:36 -0800
commitae86aef4db02675ec64d690556905ea034753c87 (patch)
tree9cfaf0b176150d2563ca62429ced1884c6db510d /Alc/alu.cpp
parentcd213fe6b731269caa484eb3cb9b830dac7f5c58 (diff)
Provide effect target parameters through a common struct
Diffstat (limited to 'Alc/alu.cpp')
-rw-r--r--Alc/alu.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index 1917dd9d..93aeff2a 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -412,7 +412,7 @@ bool CalcEffectSlotParams(ALeffectslot *slot, ALCcontext *context, bool force)
evt.u.mEffectState = slot->Params.mEffectState;
slot->Params.mEffectState = state;
- props->State = NULL;
+ props->State = nullptr;
if(LIKELY(ll_ringbuffer_write(context->AsyncEvents, &evt, 1) != 0))
context->EventSem.post();
@@ -430,7 +430,25 @@ bool CalcEffectSlotParams(ALeffectslot *slot, ALCcontext *context, bool force)
AtomicReplaceHead(context->FreeEffectslotProps, props);
}
- state->update(context, slot, &slot->Params.EffectProps);
+ MixParams params;
+ EffectTarget output;
+ if(ALeffectslot *target{slot->Params.Target})
+ {
+ auto iter = std::copy(std::begin(target->ChanMap), std::end(target->ChanMap),
+ std::begin(params.Ambi.Map));
+ std::fill(iter, std::end(params.Ambi.Map), BFChannelConfig{});
+ params.CoeffCount = 0;
+ params.Buffer = target->WetBuffer;
+ params.NumChannels = target->NumChannels;
+
+ output = EffectTarget{&params, &params, nullptr};
+ }
+ else
+ {
+ ALCdevice *device{context->Device};
+ output = EffectTarget{&device->Dry, &device->FOAOut, &device->RealOut};
+ }
+ state->update(context, slot, &slot->Params.EffectProps, output);
return true;
}