diff options
-rw-r--r-- | engines/sci/sound/midiparser_sci.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 13ff8dc1b8..2068ea9a33 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -524,8 +524,12 @@ byte *MidiParser_SCI::midiFilterChannels(int channelMask) { } void MidiParser_SCI::setVolume(byte volume) { - // FIXME: This receives values > 127, so it has been disabled for now -#if 0 + // FIXME: This receives values > 127... throw a warning for now and clip the variable + if (volume > MUSIC_VOLUME_MAX) { + warning("attempted to set an invalid volume(%d)", volume); + volume = MUSIC_VOLUME_MAX; // reset + } + assert(volume <= MUSIC_VOLUME_MAX); if (_volume != volume) { _volume = volume; @@ -550,7 +554,6 @@ void MidiParser_SCI::setVolume(byte volume) { error("MidiParser_SCI::setVolume: Unsupported soundVersion"); } } -#endif } } // End of namespace Sci |