aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2014-10-07 21:30:45 +0200
committerWillem Jan Palenstijn2015-02-15 13:57:11 +0100
commite42a5123572cabf435a90eee2f9c01ababbe8528 (patch)
tree5061caa0e7037df04ddb40fa825e7227b253b58e /engines/sci
parent5964cc239b920a4a5d3b8475cb6c0b111e968e03 (diff)
downloadscummvm-rg350-e42a5123572cabf435a90eee2f9c01ababbe8528.tar.gz
scummvm-rg350-e42a5123572cabf435a90eee2f9c01ababbe8528.tar.bz2
scummvm-rg350-e42a5123572cabf435a90eee2f9c01ababbe8528.zip
SCI: Don't remap channels from playBed songs
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sound/music.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 5b205c82d7..d58479f18e 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -397,6 +397,9 @@ 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.
+
uint playListCount = _playList.size();
uint playListNo = playListCount;
MusicEntry *alreadyPlaying = NULL;
@@ -1126,8 +1129,10 @@ ChannelRemapping *SciMusic::determineChannelMap() {
if (channel._mute)
continue;
+ bool dontRemap = channel._dontRemap || song->playBed;
+
#ifdef DEBUG_REMAP
- debug(" Channel %d: prio %d, %d voice%s%s", c, channel._prio, channel._voices, channel._voices == 1 ? "" : "s", channel._dontRemap ? ", dontRemap" : "" );
+ debug(" Channel %d: prio %d, %d voice%s%s", c, channel._prio, channel._voices, channel._voices == 1 ? "" : "s", dontRemap ? ", dontRemap" : "" );
#endif
DeviceChannelUsage dc = { song, c };
@@ -1135,7 +1140,7 @@ ChannelRemapping *SciMusic::determineChannelMap() {
// our target
int devChannel = -1;
- if (channel._dontRemap && map->_map[c]._song == 0) {
+ if (dontRemap && map->_map[c]._song == 0) {
// unremappable channel, with channel still free
devChannel = c;
}
@@ -1232,10 +1237,10 @@ ChannelRemapping *SciMusic::determineChannelMap() {
map->_map[devChannel] = dc;
map->_voices[devChannel] = neededVoices;
map->_prio[devChannel] = prio;
- map->_dontRemap[devChannel] = channel._dontRemap;
+ map->_dontRemap[devChannel] = dontRemap;
map->_freeVoices -= neededVoices;
- if (!channel._dontRemap || devChannel == c) {
+ if (!dontRemap || devChannel == c) {
// If this channel fits here, we're done.
#ifdef DEBUG_REMAP
debug(" OK");