mirror of
https://github.com/halpz/re3.git
synced 2025-06-28 22:06:28 +00:00
rename clamp macro to Clamp to fix compilation with g++11 (and clamp2 for consistency sake)
This commit is contained in:
@ -162,7 +162,7 @@ public:
|
||||
else
|
||||
StepIndex--;
|
||||
|
||||
StepIndex = clamp(StepIndex, 0, 88);
|
||||
StepIndex = Clamp(StepIndex, 0, 88);
|
||||
|
||||
int delta = step >> 3;
|
||||
if (adpcm & 1) delta += step >> 2;
|
||||
@ -171,7 +171,7 @@ public:
|
||||
if (adpcm & 8) delta = -delta;
|
||||
|
||||
int newSample = Sample + delta;
|
||||
Sample = clamp(newSample, -32768, 32767);
|
||||
Sample = Clamp(newSample, -32768, 32767);
|
||||
return Sample;
|
||||
}
|
||||
};
|
||||
@ -716,7 +716,7 @@ public:
|
||||
static short quantize(double sample)
|
||||
{
|
||||
int a = int(sample + 0.5);
|
||||
return short(clamp(a, -32768, 32767));
|
||||
return short(Clamp(a, -32768, 32767));
|
||||
}
|
||||
|
||||
void Decode(void* _inbuf, int16* _outbuf, size_t size)
|
||||
@ -1448,10 +1448,10 @@ void CStream::SetVolume(uint32 nVol)
|
||||
|
||||
void CStream::SetPan(uint8 nPan)
|
||||
{
|
||||
m_nPan = clamp((int8)nPan - 63, 0, 63);
|
||||
m_nPan = Clamp((int8)nPan - 63, 0, 63);
|
||||
SetPosition(0, (m_nPan - 63) / 64.0f, 0.0f, Sqrt(1.0f - SQR((m_nPan - 63) / 64.0f)));
|
||||
|
||||
m_nPan = clamp((int8)nPan + 64, 64, 127);
|
||||
m_nPan = Clamp((int8)nPan + 64, 64, 127);
|
||||
SetPosition(1, (m_nPan - 63) / 64.0f, 0.0f, Sqrt(1.0f - SQR((m_nPan - 63) / 64.0f)));
|
||||
|
||||
m_nPan = nPan;
|
||||
|
Reference in New Issue
Block a user