diff options
author | Boris I. Bendovsky <[email protected]> | 2022-07-15 10:17:35 +0300 |
---|---|---|
committer | Boris I. Bendovsky <[email protected]> | 2022-07-17 20:59:06 +0300 |
commit | 71ac63e5a86f1516e19fc1ddd2d4f2f3cd4a9f9e (patch) | |
tree | aa737335be1827a24c4a686bb1ea1886f3cc636f /al/source.cpp | |
parent | 1f238a602f77bfc3f453b96b42372d082550b23d (diff) |
[EAX_SOURCE] Skip occlusion calculation if occlusion property is zero
Diffstat (limited to 'al/source.cpp')
-rw-r--r-- | al/source.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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, |