aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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});
- }
}
}