diff options
author | Filippos Karapetis | 2010-01-02 01:41:39 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-01-02 01:41:39 +0000 |
commit | caf75e1bf59804a1f776f0931d82e799d1296e0d (patch) | |
tree | 827b331f510e8a799849fd342b529ef6096c0e81 /engines/sci | |
parent | a927cff2569ba78922639fd12a1ba7b91871e6af (diff) | |
download | scummvm-rg350-caf75e1bf59804a1f776f0931d82e799d1296e0d.tar.gz scummvm-rg350-caf75e1bf59804a1f776f0931d82e799d1296e0d.tar.bz2 scummvm-rg350-caf75e1bf59804a1f776f0931d82e799d1296e0d.zip |
SCI/new music code: Implemented cmdSetSoundPriority
svn-id: r46873
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/sfx/soundcmd.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp index b3f9609b12..7b4a74ec10 100644 --- a/engines/sci/sfx/soundcmd.cpp +++ b/engines/sci/sfx/soundcmd.cpp @@ -918,10 +918,25 @@ void SoundCommandParser::cmdSetSoundPriority(reg_t obj, int16 value) { #ifdef USE_OLD_MUSIC_FUNCTIONS script_set_priority(_resMan, _segMan, _state, obj, value); #else + MusicEntry *musicSlot = _music->getSlot(obj); + if (!musicSlot) { + warning("cmdSetSoundPriority: Slot not found (%04x:%04x)", PRINT_REG(obj)); + return; + } + if (value == -1) { + // Set priority from the song data + Resource *song = _resMan->findResource(ResourceId(kResourceTypeSound, musicSlot->resnum), 0); + if (song->data[0] == 0xf0) + _music->soundSetPriority(musicSlot, song->data[1]); + else + warning("cmdSetSoundPriority: Attempt to unset song priority when there is no built-in value"); + //pSnd->prio=0;field_15B=0 PUT_SEL32V(_segMan, obj, flags, GET_SEL32V(_segMan, obj, flags) & 0xFD); } else { + // Scripted priority + //pSnd->field_15B=1; PUT_SEL32V(_segMan, obj, flags, GET_SEL32V(_segMan, obj, flags) | 2); //DoSOund(0xF,hobj,w) |