[Scummvm-cvs-logs] SF.net SVN: scummvm:[46873] scummvm/trunk/engines/sci/sfx/soundcmd.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Jan 2 02:41:40 CET 2010
Revision: 46873
http://scummvm.svn.sourceforge.net/scummvm/?rev=46873&view=rev
Author: thebluegr
Date: 2010-01-02 01:41:39 +0000 (Sat, 02 Jan 2010)
Log Message:
-----------
SCI/new music code: Implemented cmdSetSoundPriority
Modified Paths:
--------------
scummvm/trunk/engines/sci/sfx/soundcmd.cpp
Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2010-01-02 01:40:10 UTC (rev 46872)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2010-01-02 01:41:39 UTC (rev 46873)
@@ -918,10 +918,25 @@
#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)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list