diff options
author | Paul Gilbert | 2016-11-07 20:26:51 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-11-07 20:26:51 -0500 |
commit | f3d9d88f58d38fedbf6d65d825d6183013086898 (patch) | |
tree | f21472a36cdd874b1840e0f71e82874770920e22 | |
parent | d85f56e1fe66752a747b92c92a44161b2ff56349 (diff) | |
download | scummvm-rg350-f3d9d88f58d38fedbf6d65d825d6183013086898.tar.gz scummvm-rg350-f3d9d88f58d38fedbf6d65d825d6183013086898.tar.bz2 scummvm-rg350-f3d9d88f58d38fedbf6d65d825d6183013086898.zip |
TITANIC: Fix stopping all playing sounds when loading a savegame
-rw-r--r-- | engines/titanic/sound/qmixer.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/engines/titanic/sound/qmixer.cpp b/engines/titanic/sound/qmixer.cpp index ecc0bbcba4..b3910f846a 100644 --- a/engines/titanic/sound/qmixer.cpp +++ b/engines/titanic/sound/qmixer.cpp @@ -60,12 +60,19 @@ void QMixer::qsWaveMixFreeWave(Audio::SoundHandle &handle) { } void QMixer::qsWaveMixFlushChannel(int iChannel, uint flags) { - Common::List<SoundEntry>::iterator i; - Common::List<SoundEntry> &sounds = _channels[iChannel]._sounds; - for (i = sounds.begin(); i != sounds.end(); ++i) - _mixer->stopHandle((*i)._soundHandle); - - sounds.clear(); + if (flags & QMIX_OPENALL) { + // Ignore channel, and flush all the channels + for (uint idx = 0; idx < _channels.size(); ++idx) + qsWaveMixFlushChannel(idx, 0); + } else { + // Flush the specified channel + Common::List<SoundEntry>::iterator i; + Common::List<SoundEntry> &sounds = _channels[iChannel]._sounds; + for (i = sounds.begin(); i != sounds.end(); ++i) + _mixer->stopHandle((*i)._soundHandle); + + sounds.clear(); + } } void QMixer::qsWaveMixSetPanRate(int iChannel, uint flags, uint rate) { |