aboutsummaryrefslogtreecommitdiffstats
path: root/al/auxeffectslot.cpp
diff options
context:
space:
mode:
authorBoris I. Bendovsky <[email protected]>2022-07-15 15:14:55 +0300
committerBoris I. Bendovsky <[email protected]>2022-07-17 21:06:41 +0300
commit7e9c0285b45d9f7b3af9c72fc62fb1e00d18fe70 (patch)
treec49490b1c783285412229a54dee300303a1453cd /al/auxeffectslot.cpp
parent6f3500f458bdcce254d65095ed949119302b6c38 (diff)
[EAX_SOURCE] Fix source's occlusion and exclusion contribution
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").
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r--al/auxeffectslot.cpp17
1 files changed, 15 insertions, 2 deletions
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.