diff options
author | Travis Howell | 2004-08-09 00:58:21 +0000 |
---|---|---|
committer | Travis Howell | 2004-08-09 00:58:21 +0000 |
commit | dc476abe6021806a8cc30935c91ffabb8e766829 (patch) | |
tree | 9c00f1d47dc3ee75c213d2f309b481051c783f74 | |
parent | 809c3bd943df6a180ba40e015e01394a51a3da86 (diff) | |
download | scummvm-rg350-dc476abe6021806a8cc30935c91ffabb8e766829.tar.gz scummvm-rg350-dc476abe6021806a8cc30935c91ffabb8e766829.tar.bz2 scummvm-rg350-dc476abe6021806a8cc30935c91ffabb8e766829.zip |
Fix bug #780922 - SAM: Conroy doesn't stop singing when escaping cutscene
svn-id: r14524
-rw-r--r-- | scumm/sound.cpp | 14 | ||||
-rw-r--r-- | scumm/sound.h | 4 | ||||
-rw-r--r-- | scumm/string.cpp | 6 |
3 files changed, 9 insertions, 15 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index d3cb4341c8..a055aa44e8 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -64,6 +64,7 @@ Sound::Sound(ScummEngine *parent) _talk_sound_b1(0), _talk_sound_b2(0), _talk_sound_mode(0), + _talk_sound_channel(0), _mouthSyncMode(false), _endOfMouthSync(false), _curSoundPos(0), @@ -623,15 +624,9 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, PlayingSoundHandle // Some games frequently assume that starting one sound effect will // automatically stop any other that may be playing at that time. So // that is what we do here, but we make an exception for speech. - // - // Do any other games than these need this hack? - // - // HACK: Checking for script 99 in Sam & Max is to keep Conroy's song - // from being interrupted. - if (mode == 1 && (_vm->_gameId == GID_TENTACLE - || (_vm->_gameId == GID_SAMNMAX && !_vm->isScriptRunning(99)))) { - id = 777777; + if (mode == 1 && (_vm->_gameId == GID_TENTACLE || _vm->_gameId == GID_SAMNMAX)) { + id = 777777 + _talk_sound_channel; _vm->_mixer->stopID(id); } @@ -875,10 +870,11 @@ void Sound::soundKludge(int *list, int num) { } } -void Sound::talkSound(uint32 a, uint32 b, int mode) { +void Sound::talkSound(uint32 a, uint32 b, int mode, int channel) { if (mode == 1) { _talk_sound_a1 = a; _talk_sound_b1 = b; + _talk_sound_channel = channel; } else { _talk_sound_a2 = a; _talk_sound_b2 = b; diff --git a/scumm/sound.h b/scumm/sound.h index e1b9274aad..b354ac255c 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -64,7 +64,7 @@ protected: int _numSoundEffects; // For compressed audio uint32 _talk_sound_a1, _talk_sound_a2, _talk_sound_b1, _talk_sound_b2; - byte _talk_sound_mode; + byte _talk_sound_mode, _talk_sound_channel; bool _mouthSyncMode; bool _endOfMouthSync; uint16 _mouthSyncTimes[64]; @@ -97,7 +97,7 @@ public: void stopSound(int a); void stopAllSounds(); void soundKludge(int *list, int num); - void talkSound(uint32 a, uint32 b, int mode); + void talkSound(uint32 a, uint32 b, int mode, int channel = 0); void setupSound(); void pauseSounds(bool pause); diff --git a/scumm/string.cpp b/scumm/string.cpp index e7c67009e7..cd4029c4e4 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -52,10 +52,8 @@ void ScummEngine::unkMessage1(const byte *msg) { // Sam and Max uses a caching system, printing empty messages // and setting VAR_V6_SOUNDMODE beforehand. See patch 609791. - // FIXME: There are other VAR_V6_SOUNDMODE states, as - // mentioned in the patch. FIXME after iMUSE is done. - if (_gameId != GID_SAMNMAX || (VAR(VAR_V6_SOUNDMODE) != 2)) - _sound->talkSound(a, b, 1); + if (VAR(VAR_V6_SOUNDMODE) != 2) + _sound->talkSound(a, b, 1, VAR(VAR_V6_SOUNDMODE)); } } |