[Scummvm-cvs-logs] CVS: scummvm/simon sound.cpp,1.98,1.99

kirben kirben at users.sourceforge.net
Tue Jan 10 20:29:12 CET 2006


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23104/simon

Modified Files:
	sound.cpp 
Log Message:

Cleanup FF sound.


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.cpp,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- sound.cpp	19 Nov 2005 10:45:41 -0000	1.98
+++ sound.cpp	11 Jan 2006 04:28:31 -0000	1.99
@@ -462,8 +462,13 @@
 	byte flags;
 	int rate;
 
-	if (ambient) {
-		if (_ambientPaused || sound == _ambientPlaying)
+	if (ambient == true) {
+		if (sound == _ambientPlaying)
+			return;
+
+		_ambientPlaying = sound;
+
+		if (_ambientPaused)
 			return;
 	} else {
 		if (_effectsPaused)
@@ -480,10 +485,11 @@
 	byte *buffer = (byte *)malloc(size);
 	memcpy(buffer, soundData + stream.pos(), size);
 
-	if (ambient && sound == _ambientPlaying) {
-		_mixer->playRaw(&_effectsHandle, buffer, size, rate, flags);
-	} else {
+	if (ambient == true) {
+		_mixer->stopHandle(_ambientHandle);
 		_mixer->playRaw(&_ambientHandle, buffer, size, rate, Audio::Mixer::FLAG_LOOP|flags);
+	} else {
+		_mixer->playRaw(&_effectsHandle, buffer, size, rate, flags);
 	}
 }
 





More information about the Scummvm-git-logs mailing list