aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2015-09-27 11:53:23 +0200
committerTorbjörn Andersson2015-09-27 11:53:23 +0200
commitc8b8a2c9ee3420c0f36acde345737cee226ba845 (patch)
tree4e8393cd79abb634eeb064d14db7173117ae42f7 /engines
parent51e5baa4d19e4c963780e1e09105fbd041783485 (diff)
downloadscummvm-rg350-c8b8a2c9ee3420c0f36acde345737cee226ba845.tar.gz
scummvm-rg350-c8b8a2c9ee3420c0f36acde345737cee226ba845.tar.bz2
scummvm-rg350-c8b8a2c9ee3420c0f36acde345737cee226ba845.zip
TUCKER: Fix overflow in volume calculation
This affected Bud's line, "Is that the great mystery invention you had hidden away?" in the intro, making it very hard to hear, and possibly other sounds as well. I don't know if this was a bug in the original game, but it's much closer to the English version I own now.
Diffstat (limited to 'engines')
-rw-r--r--engines/tucker/tucker.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h
index a423915a5f..3bbf6a57f5 100644
--- a/engines/tucker/tucker.h
+++ b/engines/tucker/tucker.h
@@ -246,6 +246,15 @@ private:
};
inline int scaleMixerVolume(int volume, int max = 100) {
+ if (volume > max) {
+ // This happens for instance for Bud's line, "Is that the
+ // great mystery invention you had hidden away?" in the intro,
+ // which is played at volume 110 out of 100. This made it very
+ // hard to hear. I'm not sure if this was a bug in the original
+ // game, or if it had the ability to amplify sounds.
+ warning("scaleMixerVolume: Adjusting volume %d to %d", volume, max);
+ volume = max;
+ }
return volume * Audio::Mixer::kMaxChannelVolume / max;
}