mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-07 05:29:13 -06:00
Replace MathUtil::Clamp with std::clamp
This commit is contained in:
@ -4,11 +4,12 @@
|
||||
|
||||
// Adapted from in_cube by hcs & destop
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "Core/HW/StreamADPCM.h"
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/MathUtil.h"
|
||||
|
||||
namespace StreamADPCM
|
||||
{
|
||||
@ -30,7 +31,7 @@ static s16 ADPDecodeSample(s32 bits, s32 q, s32& hist1, s32& hist2)
|
||||
hist = (hist1 * 0x62) - (hist2 * 0x37);
|
||||
break;
|
||||
}
|
||||
hist = MathUtil::Clamp((hist + 0x20) >> 6, -0x200000, 0x1fffff);
|
||||
hist = std::clamp((hist + 0x20) >> 6, -0x200000, 0x1fffff);
|
||||
|
||||
s32 cur = (((s16)(bits << 12) >> (q & 0xf)) << 6) + hist;
|
||||
|
||||
@ -38,7 +39,7 @@ static s16 ADPDecodeSample(s32 bits, s32 q, s32& hist1, s32& hist2)
|
||||
hist1 = cur;
|
||||
|
||||
cur >>= 6;
|
||||
cur = MathUtil::Clamp(cur, -0x8000, 0x7fff);
|
||||
cur = std::clamp(cur, -0x8000, 0x7fff);
|
||||
|
||||
return (s16)cur;
|
||||
}
|
||||
|
Reference in New Issue
Block a user