diff options
author | Chris Robinson <[email protected]> | 2022-07-06 23:44:35 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-07-06 23:44:35 -0700 |
commit | e2f5ceba7b3cbf40662576e6a49c219faf8097e0 (patch) | |
tree | e93745ac5efc335786299b98750fa0a0c73361e5 | |
parent | 74b2e3b349ac42186a6359ee766482fb4283a331 (diff) |
Don't always activate the EAX primary effect slot for sources
The context's primary effect slot should only be considered when the source's
active slot IDs include the primary effect slot.
-rw-r--r-- | al/source.cpp | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/al/source.cpp b/al/source.cpp index e68c5b1e..88eeba99 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -4858,28 +4858,36 @@ void ALsource::eax_set_al_source_send(ALeffectslot *slot, size_t sendidx, const void ALsource::eax_commit_active_fx_slots() { - // Mark all slots as non-active. + // Clear all slots to an inactive state. eax_active_fx_slots_.fill(false); - // Mark primary FX slot as active. - if (eax_primary_fx_slot_id_.has_value()) - eax_active_fx_slots_[*eax_primary_fx_slot_id_] = true; - - // Mark the other FX slots as active. - for (const auto& slot_id : eax_.active_fx_slots.guidActiveFXSlots) { - if (slot_id == EAXPROPERTYID_EAX50_FXSlot0) + // Mark the set slots as active. + for(const auto& slot_id : eax_.active_fx_slots.guidActiveFXSlots) + { + if(slot_id == EAX_NULL_GUID) + { + } + else if(slot_id == EAX_PrimaryFXSlotID) + { + // Mark primary FX slot as active. + if(eax_primary_fx_slot_id_.has_value()) + eax_active_fx_slots_[*eax_primary_fx_slot_id_] = true; + } + else if(slot_id == EAXPROPERTYID_EAX50_FXSlot0) eax_active_fx_slots_[0] = true; - else if (slot_id == EAXPROPERTYID_EAX50_FXSlot1) + else if(slot_id == EAXPROPERTYID_EAX50_FXSlot1) eax_active_fx_slots_[1] = true; - else if (slot_id == EAXPROPERTYID_EAX50_FXSlot2) + else if(slot_id == EAXPROPERTYID_EAX50_FXSlot2) eax_active_fx_slots_[2] = true; - else if (slot_id == EAXPROPERTYID_EAX50_FXSlot3) + else if(slot_id == EAXPROPERTYID_EAX50_FXSlot3) eax_active_fx_slots_[3] = true; } - // Deactivate EFX auxiliary effect slots. - for (auto i = size_t{}; i < EAX_MAX_FXSLOTS; ++i) { - if (!eax_active_fx_slots_[i]) + // Deactivate EFX auxiliary effect slots for inactive slots. Active slots + // will be updated with the room filters. + for(auto i = size_t{}; i < EAX_MAX_FXSLOTS; ++i) + { + if(!eax_active_fx_slots_[i]) eax_set_al_source_send(nullptr, i, EaxAlLowPassParam{1.0f, 1.0f}); } } |