From 71ac63e5a86f1516e19fc1ddd2d4f2f3cd4a9f9e Mon Sep 17 00:00:00 2001 From: "Boris I. Bendovsky" Date: Fri, 15 Jul 2022 10:17:35 +0300 Subject: [EAX_SOURCE] Skip occlusion calculation if occlusion property is zero --- al/source.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'al/source.cpp') diff --git a/al/source.cpp b/al/source.cpp index f1f1fe7d..6483473d 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -3996,6 +3996,9 @@ float ALsource::eax_calculate_dst_occlusion_mb( float path_ratio, float lf_ratio) noexcept { + if(src_occlusion_mb == 0) + return 0.0f; + const auto ratio_1 = path_ratio + lf_ratio - 1.0F; const auto ratio_2 = path_ratio * lf_ratio; const auto ratio = (ratio_2 > ratio_1) ? ratio_2 : ratio_1; @@ -4020,13 +4023,14 @@ EaxAlLowPassParam ALsource::eax_create_direct_filter_param() const noexcept for (auto i = std::size_t{}; i < EAX_MAX_FXSLOTS; ++i) { - if (!eax_active_fx_slots_[i]) - { + if(!eax_active_fx_slots_[i]) continue; - } const auto& send = eax_.sends[i]; + if(send.lOcclusion == 0) + continue; + gain_mb += eax_calculate_dst_occlusion_mb( send.lOcclusion, send.flOcclusionDirectRatio, -- cgit v1.2.3