Propagate an effectslot target property

This commit is contained in:
Chris Robinson
2018-12-24 15:17:38 -08:00
parent ae86aef4db
commit bbf9e6931c
3 changed files with 8 additions and 0 deletions
+1
View File
@@ -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))
+2
View File
@@ -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};
+5
View File
@@ -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;