diff options
author | Filippos Karapetis | 2010-01-29 23:59:50 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-01-29 23:59:50 +0000 |
commit | 694d30eb31f1c1a45168178cc7ee69d97df43057 (patch) | |
tree | 9ba4e6f4e88ba1c01d019a7a5f1c081ffbec1d0f /engines | |
parent | 8e69a2478381b5b0f000de04e5d9f9cdf2cb34d4 (diff) | |
download | scummvm-rg350-694d30eb31f1c1a45168178cc7ee69d97df43057.tar.gz scummvm-rg350-694d30eb31f1c1a45168178cc7ee69d97df43057.tar.bz2 scummvm-rg350-694d30eb31f1c1a45168178cc7ee69d97df43057.zip |
Don't cripple setVolume(), but throw a warning when receiving invalid volumes and correct them for now - fixes the music in GK1
svn-id: r47690
Diffstat (limited to 'engines')
-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 |