aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-03-13 10:38:36 -0700
committerChris Robinson <[email protected]>2022-03-13 10:38:36 -0700
commitf903c1ea11d9b3175c3075bbbf3e6c636adea2f9 (patch)
tree62031fdd17fdae490753d0ce6c43e44ab5c818bb /al/source.cpp
parente28937d1f6704bcdc3f0a194744905906b106cdd (diff)
Make sure FX slots that aren't made active are disabled
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/al/source.cpp b/al/source.cpp
index f985da7a..f46b24fb 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -3966,14 +3966,13 @@ void ALsource::eax_set_fx_slots()
{
eax_uses_primary_id_ = false;
eax_has_active_fx_slots_ = false;
+ eax_active_fx_slots_.fill(false);
- for (auto i = 0; i < EAX_MAX_FXSLOTS; ++i)
+ for(const auto& eax_active_fx_slot_id : eax_.active_fx_slots.guidActiveFXSlots)
{
- const auto& eax_active_fx_slot_id = eax_.active_fx_slots.guidActiveFXSlots[i];
-
auto fx_slot_index = EaxFxSlotIndex{};
- if (eax_active_fx_slot_id == EAX_PrimaryFXSlotID)
+ if(eax_active_fx_slot_id == EAX_PrimaryFXSlotID)
{
eax_uses_primary_id_ = true;
fx_slot_index = eax_al_context_->eax_get_primary_fx_slot_index();
@@ -3983,19 +3982,17 @@ void ALsource::eax_set_fx_slots()
fx_slot_index = eax_active_fx_slot_id;
}
- if (fx_slot_index.has_value())
+ if(fx_slot_index.has_value())
{
eax_has_active_fx_slots_ = true;
eax_active_fx_slots_[*fx_slot_index] = true;
}
}
- for (auto i = 0u; i < EAX_MAX_FXSLOTS; ++i)
+ for(auto i = 0u;i < eax_active_fx_slots_.size();++i)
{
- if (!eax_active_fx_slots_[i])
- {
+ if(!eax_active_fx_slots_[i])
eax_set_al_source_send(nullptr, i, EaxAlLowPassParam{1.0f, 1.0f});
- }
}
}