aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorAdrian Frühwirth2018-05-03 21:54:58 +0200
committerAdrian Frühwirth2018-05-05 17:57:31 +0200
commit49116b4ae7dd31fd736a33913a2969c0653a06cb (patch)
tree5bce268f0d8227d5a4767da23cb321aedc554063 /engines/agos
parentc4edac23b2bd8c4024785e8701b61fe1fad13724 (diff)
downloadscummvm-rg350-49116b4ae7dd31fd736a33913a2969c0653a06cb.tar.gz
scummvm-rg350-49116b4ae7dd31fd736a33913a2969c0653a06cb.tar.bz2
scummvm-rg350-49116b4ae7dd31fd736a33913a2969c0653a06cb.zip
ALL: Use CLIP to clip volumes
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/midi.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 3a7158a203..5e28654c41 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -482,20 +482,14 @@ void MidiPlayer::pause(bool b) {
}
void MidiPlayer::setVolume(int musicVol, int sfxVol) {
- if (musicVol < 0)
- musicVol = 0;
- else if (musicVol > 255)
- musicVol = 255;
- if (sfxVol < 0)
- sfxVol = 0;
- else if (sfxVol > 255)
- sfxVol = 255;
+ musicVol = CLIP(musicVol, 0, 255);
+ sfxVol = CLIP(sfxVol, 0, 255);
if (_musicVolume == musicVol && _sfxVolume == sfxVol)
return;
_musicVolume = musicVol;
- _sfxVolume = sfxVol;
+ _sfxVolume = sfxVol;
// Now tell all the channels this.
Common::StackLock lock(_mutex);