From 7e9c0285b45d9f7b3af9c72fc62fb1e00d18fe70 Mon Sep 17 00:00:00 2001 From: "Boris I. Bendovsky" Date: Fri, 15 Jul 2022 15:14:55 +0300 Subject: [EAX_SOURCE] Fix source's occlusion and exclusion contribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Source's oclussion and exclusion properties should be taken into account only for listener's environment (see p. 16, p. 56, pp. 62-63 and p. 64 of "EAX® 4.0 Programmer’s Guide"). --- al/auxeffectslot.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'al/auxeffectslot.cpp') diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index 9da8824b..0cfd6636 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -1379,6 +1379,19 @@ void ALeffectslot::eax5_fx_slot_set_all(const EaxCall& call) dst = src; } +bool ALeffectslot::eax_fx_slot_should_update_sources() const noexcept +{ + const auto dirty_bits = + eax_occlusion_dirty_bit | + eax_occlusion_lf_ratio_dirty_bit | + eax_flags_dirty_bit; + + if((eax_df_ & dirty_bits) != EaxDirtyFlags{}) + return true; + + return false; +} + // Returns `true` if all sources should be updated, or `false` otherwise. bool ALeffectslot::eax4_fx_slot_set(const EaxCall& call) { @@ -1409,7 +1422,7 @@ bool ALeffectslot::eax4_fx_slot_set(const EaxCall& call) eax_fail_unknown_property_id(); } - return (eax_df_ & (eax_occlusion_dirty_bit | eax_occlusion_lf_ratio_dirty_bit)) != EaxDirtyFlags{}; + return eax_fx_slot_should_update_sources(); } // Returns `true` if all sources should be updated, or `false` otherwise. @@ -1446,7 +1459,7 @@ bool ALeffectslot::eax5_fx_slot_set(const EaxCall& call) eax_fail_unknown_property_id(); } - return (eax_df_ & (eax_occlusion_dirty_bit | eax_occlusion_lf_ratio_dirty_bit)) != EaxDirtyFlags{}; + return eax_fx_slot_should_update_sources(); } // Returns `true` if all sources should be updated, or `false` otherwise. -- cgit v1.2.3