Propagate an effectslot target property
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user