mirror of
https://github.com/AxioDL/amuse.git
synced 2025-12-09 05:27:57 +00:00
Common: Replace amuse::clamp with std::clamp
We can use the standardized facility for this now with C++17
This commit is contained in:
@@ -37,7 +37,7 @@ static const float DLSVolumeTable[] = {
|
||||
0.892802f, 0.907744f, 0.922810f, 0.938000f, 0.953314f, 0.968752f, 0.984314f, 1.000000f, 1.000000f};
|
||||
|
||||
float LookupVolume(float vol) {
|
||||
vol = amuse::clamp(0.f, vol * 127.f, 127.f);
|
||||
vol = std::clamp(0.f, vol * 127.f, 127.f);
|
||||
float f = std::floor(vol);
|
||||
float c = std::ceil(vol);
|
||||
if (f == c)
|
||||
@@ -47,7 +47,7 @@ float LookupVolume(float vol) {
|
||||
}
|
||||
|
||||
float LookupDLSVolume(float vol) {
|
||||
vol = amuse::clamp(0.f, vol * 127.f, 127.f);
|
||||
vol = std::clamp(0.f, vol * 127.f, 127.f);
|
||||
float f = std::floor(vol);
|
||||
float c = std::ceil(vol);
|
||||
if (f == c)
|
||||
|
||||
Reference in New Issue
Block a user