aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-12-11 13:43:52 +0000
committerJohannes Schickel2008-12-11 13:43:52 +0000
commit9a3a04f6dd8456f20298f157f7ea9c0f36e8127d (patch)
treecf75297c8b64c6123bc3294e1819bd9c918e44fb
parent7c05e9e72303718ebe7b39046a715c186279f9c6 (diff)
downloadscummvm-rg350-9a3a04f6dd8456f20298f157f7ea9c0f36e8127d.tar.gz
scummvm-rg350-9a3a04f6dd8456f20298f157f7ea9c0f36e8127d.tar.bz2
scummvm-rg350-9a3a04f6dd8456f20298f157f7ea9c0f36e8127d.zip
Added a HACK/FIXME to prevent tinsel games from crashing, when for example the music volume is set to 256 via the launcher.
svn-id: r35301
-rw-r--r--engines/tinsel/config.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/tinsel/config.cpp b/engines/tinsel/config.cpp
index c6d774de7a..bec286a96b 100644
--- a/engines/tinsel/config.cpp
+++ b/engines/tinsel/config.cpp
@@ -98,9 +98,14 @@ void ReadConfig(void) {
if (ConfMan.hasKey("dclick_speed"))
dclickSpeed = ConfMan.getInt("dclick_speed");
- volMusic = ConfMan.getInt("music_volume");
- volSound = ConfMan.getInt("sfx_volume");
- volVoice = ConfMan.getInt("speech_volume");
+ // HACK/FIXME:
+ // We need to clip the volumes from [0, 256] to [0, 255]
+ // here, since for example Tinsel's internal options dialog
+ // and also the midi playback code rely on the volumes to be
+ // in [0, 255]
+ volMusic = CLIP(ConfMan.getInt("music_volume"), 0, 255);
+ volSound = CLIP(ConfMan.getInt("sfx_volume"), 0, 255);
+ volVoice = CLIP(ConfMan.getInt("speech_volume"), 0, 255);
if (ConfMan.hasKey("talkspeed"))
speedText = (ConfMan.getInt("talkspeed") * 100) / 255;