[Scummvm-cvs-logs] SF.net SVN: scummvm:[46886] scummvm/trunk/engines/sci/sfx
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Jan 2 16:37:18 CET 2010
Revision: 46886
http://scummvm.svn.sourceforge.net/scummvm/?rev=46886&view=rev
Author: thebluegr
Date: 2010-01-02 15:37:17 +0000 (Sat, 02 Jan 2010)
Log Message:
-----------
SCI/new music code: Properly implemented cmdSetSoundHold, with the help of wjp and waltervn
Modified Paths:
--------------
scummvm/trunk/engines/sci/sfx/midiparser.cpp
scummvm/trunk/engines/sci/sfx/music.cpp
scummvm/trunk/engines/sci/sfx/music.h
scummvm/trunk/engines/sci/sfx/soundcmd.cpp
Modified: scummvm/trunk/engines/sci/sfx/midiparser.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/midiparser.cpp 2010-01-02 15:02:41 UTC (rev 46885)
+++ scummvm/trunk/engines/sci/sfx/midiparser.cpp 2010-01-02 15:37:17 UTC (rev 46886)
@@ -135,8 +135,11 @@
switch (info.basic.param1) {
case 0x50: // set reverb
break;
- case 0x52: // set hold
- _pSnd->hold = info.basic.param2;
+ case 0x52: // hold ID marker
+ // Check if the hold ID marker is the same as the hold ID marker set for that song by
+ // cmdSetSoundHold. If it is, set the loop position
+ if (info.basic.param2 == _pSnd->hold)
+ _loopTick = _position._play_tick;
break;
case 0x60: // update dataInc
switch (_soundVersion) {
Modified: scummvm/trunk/engines/sci/sfx/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.cpp 2010-01-02 15:02:41 UTC (rev 46885)
+++ scummvm/trunk/engines/sci/sfx/music.cpp 2010-01-02 15:37:17 UTC (rev 46886)
@@ -433,13 +433,6 @@
sortPlayList();
}
-void SciMusic::soundSetHold(MusicEntry *pSnd, byte hold) {
- Common::StackLock lock(_mutex);
-
- pSnd->hold = hold;
- pSnd->pMidiParser->hangAllnotes(hold);
-}
-
void SciMusic::soundKill(MusicEntry *pSnd) {
pSnd->status = kSoundStopped;
Modified: scummvm/trunk/engines/sci/sfx/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h 2010-01-02 15:02:41 UTC (rev 46885)
+++ scummvm/trunk/engines/sci/sfx/music.h 2010-01-02 15:37:17 UTC (rev 46886)
@@ -146,7 +146,6 @@
void soundResume(MusicEntry *pSnd);
void soundSetVolume(MusicEntry *pSnd, byte volume);
void soundSetPriority(MusicEntry *pSnd, byte prio);
- void soundSetHold(MusicEntry *pSnd, byte hold);
uint16 soundGetMasterVolume();
void soundSetMasterVolume(uint16 vol);
uint16 soundGetSoundOn() const { return _soundOn; }
Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2010-01-02 15:02:41 UTC (rev 46885)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2010-01-02 15:37:17 UTC (rev 46886)
@@ -853,10 +853,12 @@
return;
}
- // Hold the sound before it ends for the specified amount of time. The
- // engine will signal when to stop it, by setting hold to 0, in which
- // case stop the sound
- _music->soundSetHold(musicSlot, value);
+ // Set the special hold marker ID where the song should be looped at.
+ // If the hold marker is 0, stop the song, as songs with a hold marker
+ // embedded don't have an end of track signal at the end, so that they
+ // loop instead of stopping
+ musicSlot->hold = value;
+
if (!value)
cmdStopSound(obj, 0);
#endif
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