diff options
author | Adrian Frühwirth | 2018-05-03 21:54:58 +0200 |
---|---|---|
committer | Adrian Frühwirth | 2018-05-05 17:57:31 +0200 |
commit | 49116b4ae7dd31fd736a33913a2969c0653a06cb (patch) | |
tree | 5bce268f0d8227d5a4767da23cb321aedc554063 /audio | |
parent | c4edac23b2bd8c4024785e8701b61fe1fad13724 (diff) | |
download | scummvm-rg350-49116b4ae7dd31fd736a33913a2969c0653a06cb.tar.gz scummvm-rg350-49116b4ae7dd31fd736a33913a2969c0653a06cb.tar.bz2 scummvm-rg350-49116b4ae7dd31fd736a33913a2969c0653a06cb.zip |
ALL: Use CLIP to clip volumes
Diffstat (limited to 'audio')
-rw-r--r-- | audio/mixer.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/audio/mixer.cpp b/audio/mixer.cpp index 16cf5640eb..274f8e9de6 100644 --- a/audio/mixer.cpp +++ b/audio/mixer.cpp @@ -471,10 +471,7 @@ void MixerImpl::setVolumeForSoundType(SoundType type, int volume) { assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings)); // Check range - if (volume > kMaxMixerVolume) - volume = kMaxMixerVolume; - else if (volume < 0) - volume = 0; + volume = CLIP<int>(volume, 0, kMaxMixerVolume); // TODO: Maybe we should do logarithmic (not linear) volume // scaling? See also Player_V2::setMasterVolume |