Common: Replace amuse::clamp with std::clamp

We can use the standardized facility for this now with C++17
This commit is contained in:
Lioncash
2019-08-26 05:02:26 -04:00
parent 88c017926b
commit eaf62288a2
20 changed files with 106 additions and 110 deletions

View File

@@ -57,14 +57,14 @@ void ReverbDelayLine::setdelay(int32_t delay) {
}
EffectReverbStd::EffectReverbStd(float coloration, float mix, float time, float damping, float preDelay)
: x140_x1c8_coloration(clamp(0.f, coloration, 1.f))
, x144_x1cc_mix(clamp(0.f, mix, 1.f))
, x148_x1d0_time(clamp(0.01f, time, 10.f))
, x14c_x1d4_damping(clamp(0.f, damping, 1.f))
, x150_x1d8_preDelay(clamp(0.f, preDelay, 0.1f)) {}
: x140_x1c8_coloration(std::clamp(0.f, coloration, 1.f))
, x144_x1cc_mix(std::clamp(0.f, mix, 1.f))
, x148_x1d0_time(std::clamp(0.01f, time, 10.f))
, x14c_x1d4_damping(std::clamp(0.f, damping, 1.f))
, x150_x1d8_preDelay(std::clamp(0.f, preDelay, 0.1f)) {}
EffectReverbHi::EffectReverbHi(float coloration, float mix, float time, float damping, float preDelay, float crosstalk)
: EffectReverbStd(coloration, mix, time, damping, preDelay), x1dc_crosstalk(clamp(0.f, crosstalk, 1.0f)) {}
: EffectReverbStd(coloration, mix, time, damping, preDelay), x1dc_crosstalk(std::clamp(0.f, crosstalk, 1.0f)) {}
template <typename T>
EffectReverbStdImp<T>::EffectReverbStdImp(float coloration, float mix, float time, float damping, float preDelay,