diff options
-rw-r--r-- | Alc/alu.cpp | 1 | ||||
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 2 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.cpp | 5 |
3 files changed, 8 insertions, 0 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp index 93aeff2a..b039f5af 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -371,6 +371,7 @@ bool CalcEffectSlotParams(ALeffectslot *slot, ALCcontext *context, bool force) { slot->Params.Gain = props->Gain; slot->Params.AuxSendAuto = props->AuxSendAuto; + slot->Params.Target = props->Target; slot->Params.EffectType = props->Type; slot->Params.EffectProps = props->Props; if(IsReverbEffect(props->Type)) diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index a3a308d9..1b14dd36 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -53,6 +53,7 @@ struct ALeffectslotArray { struct ALeffectslotProps { ALfloat Gain; ALboolean AuxSendAuto; + ALeffectslot *Target; ALenum Type; ALeffectProps Props; @@ -66,6 +67,7 @@ struct ALeffectslotProps { struct ALeffectslot { ALfloat Gain{1.0f}; ALboolean AuxSendAuto{AL_TRUE}; + ALeffectslot *Target{nullptr}; struct { ALenum Type{AL_EFFECT_NULL}; diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp index ca279aee..4add1668 100644 --- a/OpenAL32/alAuxEffectSlot.cpp +++ b/OpenAL32/alAuxEffectSlot.cpp @@ -589,6 +589,10 @@ ALenum InitEffectSlot(ALeffectslot *slot) ALeffectslot::~ALeffectslot() { + if(Target) + DecrementRef(&Target->ref); + Target = nullptr; + struct ALeffectslotProps *props{Update.load()}; if(props) { @@ -621,6 +625,7 @@ void UpdateEffectSlotProps(ALeffectslot *slot, ALCcontext *context) /* Copy in current property values. */ props->Gain = slot->Gain; props->AuxSendAuto = slot->AuxSendAuto; + props->Target = slot->Target; props->Type = slot->Effect.Type; props->Props = slot->Effect.Props; |