aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-02-15 10:28:06 +0100
committerWillem Jan Palenstijn2015-02-15 14:14:28 +0100
commitd0cb5f51fddcd74461914fb28ef4fbd685833eae (patch)
tree79af2b57ec281a246ac410339bfbb893cd072354 /engines/sci/sound
parent1c5722f014d1f5a34c79d8d1cb7f5ed86e0b822d (diff)
downloadscummvm-rg350-d0cb5f51fddcd74461914fb28ef4fbd685833eae.tar.gz
scummvm-rg350-d0cb5f51fddcd74461914fb28ef4fbd685833eae.tar.bz2
scummvm-rg350-d0cb5f51fddcd74461914fb28ef4fbd685833eae.zip
SCI: Only allow a single 'playBed' song in SCI1early
Diffstat (limited to 'engines/sci/sound')
-rw-r--r--engines/sci/sound/music.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 37bf6a7b1b..7156e3c099 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -410,8 +410,22 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
void SciMusic::soundPlay(MusicEntry *pSnd) {
_mutex.lock();
- // TODO: if pSnd->playBed, and version <= SCI1_EARLY, then kill
- // existing sounds with playBed enabled.
+ if (_soundVersion <= SCI_VERSION_1_EARLY && pSnd->playBed) {
+ // If pSnd->playBed, and version <= SCI1_EARLY, then kill
+ // existing sounds with playBed enabled.
+
+ uint playListCount = _playList.size();
+ for (uint i = 0; i < playListCount; i++) {
+ if (_playList[i] != pSnd && _playList[i]->playBed) {
+ debugC(2, kDebugLevelSound, "Automatically stopping old playBed song from soundPlay");
+ MusicEntry *old = _playList[i];
+ _mutex.unlock();
+ soundStop(old);
+ _mutex.lock();
+ break;
+ }
+ }
+ }
uint playListCount = _playList.size();
uint playListNo = playListCount;