diff options
author | Boris I. Bendovsky <[email protected]> | 2022-07-15 10:08:04 +0300 |
---|---|---|
committer | Boris I. Bendovsky <[email protected]> | 2022-07-17 20:59:06 +0300 |
commit | 1f238a602f77bfc3f453b96b42372d082550b23d (patch) | |
tree | 9128f983c8dc99c636043656b91da75e12fa9595 /al | |
parent | f7b4dd002f6d87978f4f42f1a72aa2daa3aac43f (diff) |
[EAX_SOURCE] Fix Room and RoomHF contribution
Those properties should be taken into account only for environmental effect slot (see pp. 60-61 of "EAX® 4.0 Programmer’s Guide").
Diffstat (limited to 'al')
-rw-r--r-- | al/source.cpp | 5 |
1 files 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<float>(fx_slot_eax.lOcclusion) * fx_slot_eax.flOcclusionLFRatio) + - static_cast<float>(eax_.source.lRoom + send.lSend) + + static_cast<float>((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<float>(fx_slot_eax.lOcclusion) + - static_cast<float>(eax_.source.lRoomHF + send.lSendHF) + + static_cast<float>((is_environmental_fx ? eax_.source.lRoomHF : 0) + send.lSendHF) + (static_cast<float>(eax_.source.lOcclusion) * eax_.source.flOcclusionRoomRatio) + (static_cast<float>(send.lOcclusion) * send.flOcclusionRoomRatio) + static_cast<float>(eax_.source.lExclusion + send.lExclusion); |