From 6ff151b9ef704ae76fa9a4284f6ad7a9c75e1d14 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 15 Aug 2010 11:37:57 +0000 Subject: SCUMM: Fix bug #3024173 - LOOM-PCE: Music stops prematurely Apparently, the original interpreter hard-coded the lengths of the audio tracks on the CD, and in this particular case it makes a difference that one of the tracks is slightly longer on the disc than the scripts assume it is. Thanks to hennymcc for doing all the hard work in figuring this out. svn-id: r52098 --- engines/scumm/sound.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'engines/scumm') diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 61445b21eb..28f1372746 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -170,7 +170,18 @@ void Sound::playSound(int soundID) { static const char tracks[20] = {3, 4, 5, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 19, 20, 21}; _currentCDSound = soundID; - playCDTrack(tracks[soundID - 13], 1, 0, 0); + + // The original game had hard-coded lengths for all + // tracks, but this one track is the only one (as far + // as we know) where this actually matters. See bug + // #3024173 - LOOM-PCE: Music stops prematurely. + + int track = tracks[soundID - 13]; + if (track == 6) { + playCDTrack(track, 1, 0, 260); + } else { + playCDTrack(track, 1, 0, 0); + } } else { if (_vm->_musicEngine) { _vm->_musicEngine->startSound(soundID); -- cgit v1.2.3