From d17d437de319ca4c388dc724cffea91702d3a699 Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 28 Jun 2021 13:57:05 +0200 Subject: rename clamp macro to Clamp to fix compilation with g++11 (and clamp2 for consistency sake) --- src/audio/AudioManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/audio/AudioManager.cpp') diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index aa6a0653..360a2275 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -331,7 +331,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()) @@ -531,7 +531,7 @@ cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, if (dist != 0.0f) { float speedOfSource = (dist / m_nTimeSpent) * speedMultiplier; if (m_fSpeedOfSound > Abs(speedOfSource)) { - speedOfSource = clamp2(speedOfSource, 0.0f, 1.5f); + speedOfSource = Clamp2(speedOfSource, 0.0f, 1.5f); newFreq = (oldFreq * m_fSpeedOfSound) / (speedOfSource + m_fSpeedOfSound); } } @@ -895,11 +895,11 @@ cAudioManager::ProcessActiveQueues() sample.m_fSpeedMultiplier); if (sample.m_nFrequency != m_asActiveSamples[j].m_nFrequency) { - m_asActiveSamples[j].m_nFrequency = clamp2((int32)sample.m_nFrequency, (int32)m_asActiveSamples[j].m_nFrequency, 6000); + m_asActiveSamples[j].m_nFrequency = Clamp2((int32)sample.m_nFrequency, (int32)m_asActiveSamples[j].m_nFrequency, 6000); SampleManager.SetChannelFrequency(j, m_asActiveSamples[j].m_nFrequency); } if (sample.m_nEmittingVolume != m_asActiveSamples[j].m_nEmittingVolume) { - vol = clamp2((int8)sample.m_nEmittingVolume, (int8)m_asActiveSamples[j].m_nEmittingVolume, 10); + vol = Clamp2((int8)sample.m_nEmittingVolume, (int8)m_asActiveSamples[j].m_nEmittingVolume, 10); if (field_4) { emittingVol = 2 * Min(63, vol); -- cgit v1.2.3