diff options
| author | Willem Jan Palenstijn | 2015-02-15 10:28:06 +0100 | 
|---|---|---|
| committer | Willem Jan Palenstijn | 2015-02-15 14:14:28 +0100 | 
| commit | d0cb5f51fddcd74461914fb28ef4fbd685833eae (patch) | |
| tree | 79af2b57ec281a246ac410339bfbb893cd072354 | |
| parent | 1c5722f014d1f5a34c79d8d1cb7f5ed86e0b822d (diff) | |
| download | scummvm-rg350-d0cb5f51fddcd74461914fb28ef4fbd685833eae.tar.gz scummvm-rg350-d0cb5f51fddcd74461914fb28ef4fbd685833eae.tar.bz2 scummvm-rg350-d0cb5f51fddcd74461914fb28ef4fbd685833eae.zip | |
SCI: Only allow a single 'playBed' song in SCI1early
| -rw-r--r-- | engines/sci/sound/music.cpp | 18 | 
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; | 
