aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-02-18 07:02:38 -0800
committerChris Robinson <[email protected]>2022-02-18 07:02:38 -0800
commit39708f9831926d5eaa90e5451adf27fe124d4153 (patch)
tree3d894400efe28977b40d475b4898906e5ff1da2e /al/source.cpp
parenta9974d3aa8ae225610302f221bd0a154c110ccbc (diff)
Avoid a variable limit on EAX filters
I'll assume for now that the limits for the EAX properties will keep the filter gain from getting out of hand. The filter's gainhf is relative to the gain and is limited to 0dB max.
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/al/source.cpp b/al/source.cpp
index 59ce5549..4be5045b 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -3894,12 +3894,10 @@ EaxAlLowPassParam ALsource::eax_create_direct_filter_param() const noexcept
}
}
- const auto max_gain = eax_al_context_->eax_get_max_filter_gain();
-
const auto al_low_pass_param = EaxAlLowPassParam
{
- clamp(level_mb_to_gain(gain_mb), 0.0F, max_gain),
- clamp(level_mb_to_gain(gain_hf_mb), 0.0F, max_gain)
+ level_mb_to_gain(gain_mb),
+ minf(level_mb_to_gain(gain_hf_mb), 1.0f)
};
return al_low_pass_param;
@@ -3947,12 +3945,10 @@ EaxAlLowPassParam ALsource::eax_create_room_filter_param(
0.0F;
- const auto max_gain = eax_al_context_->eax_get_max_filter_gain();
-
const auto al_low_pass_param = EaxAlLowPassParam
{
- clamp(level_mb_to_gain(gain_mb), 0.0F, max_gain),
- clamp(level_mb_to_gain(gain_hf_mb), 0.0F, max_gain)
+ level_mb_to_gain(gain_mb),
+ minf(level_mb_to_gain(gain_hf_mb), 1.0f)
};
return al_low_pass_param;