From c8b8a2c9ee3420c0f36acde345737cee226ba845 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 27 Sep 2015 11:53:23 +0200 Subject: 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. --- engines/tucker/tucker.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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; } -- cgit v1.2.3