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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jan 19 21:02:17 CET 2010


Revision: 47392
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47392&view=rev
Author:   thebluegr
Date:     2010-01-19 20:02:17 +0000 (Tue, 19 Jan 2010)

Log Message:
-----------
- Removed the resetDriver() hack. The reason why notes stopped being played sometimes was actually mixer->stopAll(), which stopped the music stream as well (spotted by waltervn)
- Hooked setReverb() to actually set music reverb

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/sound/music.cpp
    scummvm/trunk/engines/sci/sound/music.h
    scummvm/trunk/engines/sci/sound/soundcmd.cpp
    scummvm/trunk/engines/sci/sound/soundcmd.h

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2010-01-19 19:58:36 UTC (rev 47391)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-01-19 20:02:17 UTC (rev 47392)
@@ -1885,8 +1885,6 @@
 			game_init(s);
 #ifdef USE_OLD_MUSIC_FUNCTIONS
 			s->_sound.sfx_reset_player();
-#else
-			s->_soundCmd->resetDriver();
 #endif
 			_init_stack_base_with_selector(s, s->_kernel->_selectorCache.play);
 

Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp	2010-01-19 19:58:36 UTC (rev 47391)
+++ scummvm/trunk/engines/sci/sound/music.cpp	2010-01-19 20:02:17 UTC (rev 47392)
@@ -91,8 +91,6 @@
 }
 
 void SciMusic::clearPlayList() {
-	_pMixer->stopAll();
-
 	_mutex.lock();
 	while (!_playList.empty()) {
 		soundStop(_playList[0]);
@@ -134,25 +132,12 @@
 }
 
 void SciMusic::setReverb(byte reverb) {
+	Common::StackLock lock(_mutex);
 	_reverb = reverb;
 
-	// TODO: actually set reverb for MT-32
-
-	// A good test case for this are the first two rooms in Longbow:
-	// reverb is set for the first room (the cave) and is subsequently
-	// cleared when Robin exits the cave
+	_pMidiDrv->setReverb(reverb);
 }
 
-void SciMusic::resetDriver() {
-	Common::StackLock lock(_mutex);
-
-	// TODO/FIXME: is there any better way to reset the driver?
-
-	_pMidiDrv->close();
-	_pMidiDrv->open();
-	_pMidiDrv->setTimerCallback(this, &miditimerCallback);
-}
-
 static int f_compare(const void *arg1, const void *arg2) {
 	return ((const MusicEntry *)arg2)->prio - ((const MusicEntry *)arg1)->prio;
 }

Modified: scummvm/trunk/engines/sci/sound/music.h
===================================================================
--- scummvm/trunk/engines/sci/sound/music.h	2010-01-19 19:58:36 UTC (rev 47391)
+++ scummvm/trunk/engines/sci/sound/music.h	2010-01-19 20:02:17 UTC (rev 47392)
@@ -187,8 +187,6 @@
 
 	void setReverb(byte reverb);
 
-	void resetDriver();
-
 #ifndef USE_OLD_MUSIC_FUNCTIONS
 	virtual void saveLoadWithSerializer(Common::Serializer &ser);
 #endif

Modified: scummvm/trunk/engines/sci/sound/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-01-19 19:58:36 UTC (rev 47391)
+++ scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-01-19 20:02:17 UTC (rev 47392)
@@ -1065,8 +1065,6 @@
 #ifndef USE_OLD_MUSIC_FUNCTIONS
 	Common::StackLock lock(_music->_mutex);
 
-	_music->resetDriver();
-
 	const MusicList::iterator end = _music->getPlayListEnd();
 	for (MusicList::iterator i = _music->getPlayListStart(); i != end; ++i) {
 		if (savegame_version < 14) {
@@ -1096,12 +1094,6 @@
 #endif
 }
 
-void SoundCommandParser::resetDriver() {
-#ifndef USE_OLD_MUSIC_FUNCTIONS
-	_music->resetDriver();
-#endif
-}
-
 void SoundCommandParser::setMasterVolume(int vol) {
 #ifndef USE_OLD_MUSIC_FUNCTIONS
 	_music->soundSetMasterVolume(vol);

Modified: scummvm/trunk/engines/sci/sound/soundcmd.h
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.h	2010-01-19 19:58:36 UTC (rev 47391)
+++ scummvm/trunk/engines/sci/sound/soundcmd.h	2010-01-19 20:02:17 UTC (rev 47392)
@@ -62,7 +62,6 @@
 	void syncPlayList(Common::Serializer &s);
 	void reconstructPlayList(int savegame_version);
 	void printPlayList(Console *con);
-	void resetDriver();
 	void setMasterVolume(int vol);
 
 #ifndef USE_OLD_MUSIC_FUNCTIONS


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