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 /engines/kyra | |
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 'engines/kyra')
-rw-r--r-- | engines/kyra/sound_digital.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp index a1600f6464..551d79cc55 100644 --- a/engines/kyra/sound_digital.cpp +++ b/engines/kyra/sound_digital.cpp @@ -30,6 +30,8 @@ #include "audio/decoders/vorbis.h" #include "audio/decoders/flac.h" +#include "common/util.h" + namespace Kyra { class KyraAudioStream : public Audio::SeekableAudioStream { @@ -203,11 +205,7 @@ int AUDStream::readBuffer(int16 *buffer, const int numSamples) { } inline int16 clip8BitSample(int16 sample) { - if (sample > 255) - return 255; - if (sample < 0) - return 0; - return sample; + return CLIP<int16>(sample, 0, 255); } int AUDStream::readChunk(int16 *buffer, const int maxSamples) { |