[Scummvm-cvs-logs] SF.net SVN: scummvm:[47690] scummvm/trunk/engines/sci/sound/midiparser_sci. cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Jan 30 00:59:50 CET 2010
Revision: 47690
http://scummvm.svn.sourceforge.net/scummvm/?rev=47690&view=rev
Author: thebluegr
Date: 2010-01-29 23:59:50 +0000 (Fri, 29 Jan 2010)
Log Message:
-----------
Don't cripple setVolume(), but throw a warning when receiving invalid volumes and correct them for now - fixes the music in GK1
Modified Paths:
--------------
scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
Modified: scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/midiparser_sci.cpp 2010-01-29 23:52:58 UTC (rev 47689)
+++ scummvm/trunk/engines/sci/sound/midiparser_sci.cpp 2010-01-29 23:59:50 UTC (rev 47690)
@@ -524,8 +524,12 @@
}
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 @@
error("MidiParser_SCI::setVolume: Unsupported soundVersion");
}
}
-#endif
}
} // End of namespace Sci
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list