[Scummvm-cvs-logs] SF.net SVN: scummvm:[46923] scummvm/trunk/engines/sci/sfx

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Jan 3 14:28:59 CET 2010


Revision: 46923
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46923&view=rev
Author:   thebluegr
Date:     2010-01-03 13:28:59 +0000 (Sun, 03 Jan 2010)

Log Message:
-----------
SCI/new music code:
- sounds are no longer stopped in cmdUpdateCues if their signal is set
- cmdSetSoundVolume no longer throws a warning if it can't find the associated sound (in some games, it's called before the actual sound is loaded)
- removed unused parameters to the SciMusic() class and to MusicEntry::onTimer()
- removed a hack to get the sound loop selector

Modified Paths:
--------------
    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/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.cpp	2010-01-03 13:13:13 UTC (rev 46922)
+++ scummvm/trunk/engines/sci/sfx/music.cpp	2010-01-03 13:28:59 UTC (rev 46923)
@@ -37,7 +37,7 @@
 
 namespace Sci {
 
-SciMusic::SciMusic(ResourceManager *resMan, SegManager *segMan, SciVersion soundVersion)
+SciMusic::SciMusic(SciVersion soundVersion)
 	: _soundVersion(soundVersion), _soundOn(true) {
 
 	// Reserve some space in the playlist, to avoid expensive insertion
@@ -365,7 +365,7 @@
 void SciMusic::onTimer() {
 	const MusicList::iterator end = _playList.end();
 	for (MusicList::iterator i = _playList.begin(); i != end; ++i)
-		(*i)->onTimer(_soundVersion);
+		(*i)->onTimer();
 }
 
 void SciMusic::soundPlay(MusicEntry *pSnd) {
@@ -383,11 +383,9 @@
 	_mutex.unlock();	// unlock to perform mixer-related calls
 
 	if (pSnd->pStreamAud && !_pMixer->isSoundHandleActive(pSnd->hCurrentAud)) {
-		SegManager *segMan = ((SciEngine *)g_engine)->getEngineState()->_segMan;	// HACK
-		uint16 loop = GET_SEL32V(segMan, pSnd->soundObj, loop);
 		// Are we supposed to loop the stream?
-		if (loop > 1)
-			pSnd->pStreamAud->setNumLoops(loop);
+		if (pSnd->loop > 1)
+			pSnd->pStreamAud->setNumLoops(pSnd->loop);
 		else
 			pSnd->pStreamAud->setNumLoops(1);
 		_pMixer->playInputStream(pSnd->soundType, &pSnd->hCurrentAud,
@@ -549,7 +547,7 @@
 MusicEntry::~MusicEntry() {
 }
 
-void MusicEntry::onTimer(SciVersion soundVersion) {
+void MusicEntry::onTimer() {
 	if (status != kSoundPlaying)
 		return;
 

Modified: scummvm/trunk/engines/sci/sfx/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h	2010-01-03 13:13:13 UTC (rev 46922)
+++ scummvm/trunk/engines/sci/sfx/music.h	2010-01-03 13:28:59 UTC (rev 46923)
@@ -112,7 +112,7 @@
 	~MusicEntry();
 
 	void doFade();
-	void onTimer(SciVersion soundVersion);
+	void onTimer();
 
 #ifndef USE_OLD_MUSIC_FUNCTIONS
 	virtual void saveLoadWithSerializer(Common::Serializer &ser);
@@ -128,7 +128,7 @@
 {
 
 public:
-	SciMusic(ResourceManager *resMan, SegManager *segMan, SciVersion soundVersion);
+	SciMusic(SciVersion soundVersion);
 	~SciMusic();
 
 	void init();

Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2010-01-03 13:13:13 UTC (rev 46922)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2010-01-03 13:28:59 UTC (rev 46923)
@@ -134,7 +134,7 @@
 #endif
 
 	#ifndef USE_OLD_MUSIC_FUNCTIONS
-		_music = new SciMusic(_resMan, _segMan, _soundVersion);
+		_music = new SciMusic(_soundVersion);
 		_music->init();
 	#endif
 
@@ -796,7 +796,7 @@
 				}
 				break;
 			case SIGNAL_OFFSET:
-				cmdStopSound(obj, 0);
+				PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
 				break;
 			default:
 				// Sync the signal of the sound object
@@ -885,7 +885,11 @@
 #ifndef USE_OLD_MUSIC_FUNCTIONS
 	MusicEntry *musicSlot = _music->getSlot(obj);
 	if (!musicSlot) {
-		warning("cmdSetSoundVolume: Slot not found (%04x:%04x)", PRINT_REG(obj));
+		// Do not throw a warning if the sound can't be found, as in some games 
+		// this is called before the actual sound is loaded (e.g. SQ4CD, with the
+		// drum sounds of the energizer bunny at the beginning), so this is normal
+		// behavior
+		//warning("cmdSetSoundVolume: Slot not found (%04x:%04x)", PRINT_REG(obj));
 		return;
 	}
 


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