From 4e760bbecc6ac4031dca45b4882c6faa71842e90 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 7 Nov 2020 08:36:49 -0800 Subject: Use a separate structure for the active effect slot properties --- al/source.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'al/source.cpp') diff --git a/al/source.cpp b/al/source.cpp index 64a7afc1..d089f24c 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -149,8 +149,8 @@ void UpdateSourceProps(const ALsource *source, Voice *voice, ALCcontext *context auto copy_send = [](const ALsource::SendData &srcsend) noexcept -> VoiceProps::SendData { - VoiceProps::SendData ret; - ret.Slot = srcsend.Slot; + VoiceProps::SendData ret{}; + ret.Slot = srcsend.Slot ? &srcsend.Slot->mSlot : nullptr; ret.Gain = srcsend.Gain; ret.GainHF = srcsend.GainHF; ret.HFReference = srcsend.HFReference; @@ -159,6 +159,8 @@ void UpdateSourceProps(const ALsource *source, Voice *voice, ALCcontext *context return ret; }; std::transform(source->Send.cbegin(), source->Send.cend(), props->Send, copy_send); + if(!props->Send[0].Slot && context->mDefaultSlot) + props->Send[0].Slot = &context->mDefaultSlot->mSlot; /* Set the new container for updating internal parameters. */ props = voice->mUpdate.exchange(props, std::memory_order_acq_rel); -- cgit v1.2.3