aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
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/scumm
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/scumm')
-rw-r--r--engines/scumm/players/player_nes.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/engines/scumm/players/player_nes.cpp b/engines/scumm/players/player_nes.cpp
index 3b5adc4550..b2f6eb0d40 100644
--- a/engines/scumm/players/player_nes.cpp
+++ b/engines/scumm/players/player_nes.cpp
@@ -1029,11 +1029,7 @@ top:
}
_mchan[x].volume += _mchan[x].voldelta;
-
- if (_mchan[x].volume < 0)
- _mchan[x].volume = 0;
- if (_mchan[x].volume > MAXVOLUME)
- _mchan[x].volume = MAXVOLUME;
+ _mchan[x].volume = CLIP(_mchan[x].volume, 0, MAXVOLUME);
APU_writeChannel(x, 0, (_mchan[x].volume >> 3) | _mchan[x].envflags);
}