patch #617419: SAM: sound fix

svn-id: r5075
This commit is contained in:
Max Horn 2002-10-02 17:30:26 +00:00
parent ba06eab0ce
commit f3281f93c5

View File

@ -461,6 +461,19 @@ int Sound::startTalkSound(uint32 offset, uint32 b, int mode) {
return -1;
}
// 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?
if (mode == 1 && (_scumm->_gameId == GID_TENTACLE || _scumm->_gameId == GID_SAMNMAX)) {
for (int i = 0; i < _scumm->_mixer->NUM_CHANNELS; i++) {
if (i != _talkChannel)
_scumm->_mixer->stop(i);
}
}
if (b > 8) {
num = (b - 8) >> 1;
}
@ -712,17 +725,6 @@ int Sound::startSfxSound(File *file, int file_size) {
int rate, comp;
byte *data;
// FIXME: Some games frequently assume that starting one sound effect
// will automatically stop any other that may be playing at that time.
// Do any other games need this?
if (_scumm->_gameId == GID_TENTACLE || _scumm->_gameId == GID_SAMNMAX) {
for (int i = 0; i < _scumm->_mixer->NUM_CHANNELS; i++) {
if (i != _talkChannel)
_scumm->_mixer->stop(i);
}
}
#ifdef COMPRESSED_SOUND_FILE
if (file_size > 0) {
data = (byte *)calloc(file_size + MAD_BUFFER_GUARD, 1);