diff options
-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)); } } |