aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-29 23:59:50 +0000
committerFilippos Karapetis2010-01-29 23:59:50 +0000
commit694d30eb31f1c1a45168178cc7ee69d97df43057 (patch)
tree9ba4e6f4e88ba1c01d019a7a5f1c081ffbec1d0f /engines
parent8e69a2478381b5b0f000de04e5d9f9cdf2cb34d4 (diff)
downloadscummvm-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.cpp9
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