summaryrefslogtreecommitdiff
path: root/src/audio
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2021-06-28 13:31:35 +0200
committerwithmorten <morten.with@gmail.com>2021-06-28 13:31:35 +0200
commitcb3b3855b844c14c0e943c1a7614fc29820cf666 (patch)
tree8e9a6ae74e9c98515b813f412476058274d3fde4 /src/audio
parentcc235be3aa1ad97ac7067af0d619ee714d9d05eb (diff)
rename clamp macro to Clamp to fix compilation with g++11
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/AudioLogic.cpp4
-rw-r--r--src/audio/AudioManager.cpp2
-rw-r--r--src/audio/oal/stream.cpp10
-rw-r--r--src/audio/sampman_miles.cpp2
-rw-r--r--src/audio/sampman_oal.cpp4
5 files changed, 11 insertions, 11 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 8472cda6..fdc7305b 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -1220,7 +1220,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CAutomobile *
CurrentPretendGear = 1;
}
if (CReplay::IsPlayingBack())
- accelerateState = 255.f * clamp(automobile->m_fGasPedal, 0.0f, 1.0f);
+ accelerateState = 255.f * Clamp(automobile->m_fGasPedal, 0.0f, 1.0f);
else
accelerateState = Pads[0].GetAccelerate();
@@ -1229,7 +1229,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CAutomobile *
velocityChange = params.m_fVelocityChange;
relativeVelocityChange = 2.0f * velocityChange / transmission->fMaxVelocity;
- accelerationMultipler = clamp(relativeVelocityChange, 0.0f, 1.0f);
+ accelerationMultipler = Clamp(relativeVelocityChange, 0.0f, 1.0f);
gasPedalAudio = accelerationMultipler;
currentGear = params.m_pVehicle->m_nCurrentGear;
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index c49ce552..a3bc6a01 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -321,7 +321,7 @@ cAudioManager::Get3DProviderName(uint8 id) const
if (!m_bIsInitialised)
return nil;
#ifdef AUDIO_OAL
- id = clamp(id, 0, SampleManager.GetNum3DProvidersAvailable() - 1);
+ id = Clamp(id, 0, SampleManager.GetNum3DProvidersAvailable() - 1);
#else
// We don't want that either since it will crash the game, but skipping for now
if (id >= SampleManager.GetNum3DProvidersAvailable())
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp
index 44cc1c93..5d3ff08e 100644
--- a/src/audio/oal/stream.cpp
+++ b/src/audio/oal/stream.cpp
@@ -134,7 +134,7 @@ public:
else
StepIndex--;
- StepIndex = clamp(StepIndex, 0, 88);
+ StepIndex = Clamp(StepIndex, 0, 88);
int delta = step >> 3;
if (adpcm & 1) delta += step >> 2;
@@ -143,7 +143,7 @@ public:
if (adpcm & 8) delta = -delta;
int newSample = Sample + delta;
- Sample = clamp(newSample, -32768, 32767);
+ Sample = Clamp(newSample, -32768, 32767);
return Sample;
}
};
@@ -596,7 +596,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)
@@ -1086,10 +1086,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;
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp
index ddfaaa5f..362da433 100644
--- a/src/audio/sampman_miles.cpp
+++ b/src/audio/sampman_miles.cpp
@@ -1624,7 +1624,7 @@ cSampleManager::UpdateReverb(void)
}
}
- fRatio = clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f);
+ fRatio = Clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f);
if ( fRatio == _fPrevEaxRatioDestination )
return FALSE;
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index f2771885..31c27154 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -348,7 +348,7 @@ int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
{
int savedprovider = curprovider;
- nProvider = clamp(nProvider, 0, m_nNumberOfProviders - 1);
+ nProvider = Clamp(nProvider, 0, m_nNumberOfProviders - 1);
if ( set_new_provider(nProvider) )
return curprovider;
@@ -1424,7 +1424,7 @@ bool8 cSampleManager::UpdateReverb(void)
#undef CALCRATIO
#undef ZR
- fRatio = clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f);
+ fRatio = Clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f);
if ( fRatio == _fPrevEaxRatioDestination )
return FALSE;