From 1f238a602f77bfc3f453b96b42372d082550b23d Mon Sep 17 00:00:00 2001 From: "Boris I. Bendovsky" Date: Fri, 15 Jul 2022 10:08:04 +0300 Subject: [EAX_SOURCE] Fix Room and RoomHF contribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Those properties should be taken into account only for environmental effect slot (see pp. 60-61 of "EAX® 4.0 Programmer’s Guide"). --- al/source.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/al/source.cpp b/al/source.cpp index 3d3c80b1..f1f1fe7d 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -4047,10 +4047,11 @@ EaxAlLowPassParam ALsource::eax_create_room_filter_param( const EAXSOURCEALLSENDPROPERTIES& send) const noexcept { const auto& fx_slot_eax = fx_slot.eax_get_eax_fx_slot(); + const auto is_environmental_fx = ((fx_slot_eax.ulFlags & EAXFXSLOTFLAGS_ENVIRONMENT) != 0); const auto gain_mb = (static_cast(fx_slot_eax.lOcclusion) * fx_slot_eax.flOcclusionLFRatio) + - static_cast(eax_.source.lRoom + send.lSend) + + static_cast((is_environmental_fx ? eax_.source.lRoom : 0) + send.lSend) + eax_calculate_dst_occlusion_mb( eax_.source.lOcclusion, eax_.source.flOcclusionRoomRatio, @@ -4064,7 +4065,7 @@ EaxAlLowPassParam ALsource::eax_create_room_filter_param( const auto gain_hf_mb = static_cast(fx_slot_eax.lOcclusion) + - static_cast(eax_.source.lRoomHF + send.lSendHF) + + static_cast((is_environmental_fx ? eax_.source.lRoomHF : 0) + send.lSendHF) + (static_cast(eax_.source.lOcclusion) * eax_.source.flOcclusionRoomRatio) + (static_cast(send.lOcclusion) * send.flOcclusionRoomRatio) + static_cast(eax_.source.lExclusion + send.lExclusion); -- cgit v1.2.3