diff options
author | m-kiewitz | 2013-09-21 14:27:16 +0200 |
---|---|---|
committer | m-kiewitz | 2013-09-21 14:27:16 +0200 |
commit | 4443793b97761ab1dc1fb312a4092211356b008e (patch) | |
tree | e80857bd0a8cc7eb03a8c59ab5a7ec64472c6011 /engines/sci/sound | |
parent | ac0c890bccfb0a15cd739be60228c4de5a7afeab (diff) | |
download | scummvm-rg350-4443793b97761ab1dc1fb312a4092211356b008e.tar.gz scummvm-rg350-4443793b97761ab1dc1fb312a4092211356b008e.tar.bz2 scummvm-rg350-4443793b97761ab1dc1fb312a4092211356b008e.zip |
SCI: sfx/music priority int16 fixes bug #3615038
it seems that sound system up till SCI0_LATE uses int16, afterwards it seems they changed to byte
main music object (conMusic) in Laura Bow 1 uses -1 as priority. This was truncated to 255 till now, which resulted in many sound effects not getting played, because those used priority 0
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/music.h | 2 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h index 5924a0fd12..b582e7f1a9 100644 --- a/engines/sci/sound/music.h +++ b/engines/sci/sound/music.h @@ -70,7 +70,7 @@ public: uint16 dataInc; uint16 ticker; uint16 signal; - byte priority; + int16 priority; // must be int16, at least in Laura Bow 1, main music (object conMusic) uses priority -1 uint16 loop; int16 volume; int16 hold; diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index b0102a002b..90ad51b5d8 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -116,7 +116,10 @@ void SoundCommandParser::processInitSound(reg_t obj) { newSound->resourceId = resourceId; newSound->soundObj = obj; newSound->loop = readSelectorValue(_segMan, obj, SELECTOR(loop)); - newSound->priority = readSelectorValue(_segMan, obj, SELECTOR(priority)) & 0xFF; + if (_soundVersion <= SCI_VERSION_0_LATE) + newSound->priority = readSelectorValue(_segMan, obj, SELECTOR(priority)); + else + newSound->priority = readSelectorValue(_segMan, obj, SELECTOR(priority)) & 0xFF; if (_soundVersion >= SCI_VERSION_1_EARLY) newSound->volume = CLIP<int>(readSelectorValue(_segMan, obj, SELECTOR(vol)), 0, MUSIC_VOLUME_MAX); newSound->reverb = -1; // initialize to SCI invalid, it'll be set correctly in soundInitSnd() below @@ -428,7 +431,7 @@ reg_t SoundCommandParser::kDoSoundUpdate(int argc, reg_t *argv, reg_t acc) { int16 objVol = CLIP<int>(readSelectorValue(_segMan, obj, SELECTOR(vol)), 0, 255); if (objVol != musicSlot->volume) _music->soundSetVolume(musicSlot, objVol); - uint32 objPrio = readSelectorValue(_segMan, obj, SELECTOR(priority)); + int32 objPrio = readSelectorValue(_segMan, obj, SELECTOR(priority)); if (objPrio != musicSlot->priority) _music->soundSetPriority(musicSlot, objPrio); return acc; |