[Scummvm-cvs-logs] CVS: scummvm/sword1 animation.cpp,1.9,1.10

Nicolas Bacca arisme at users.sourceforge.net
Thu Feb 12 17:01:12 CET 2004


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

Modified Files:
	animation.cpp 
Log Message:
Check for MP3 file in Broken Sword cutscenes - useful for WinCE backend as Tremor crashes for no specific reason (help appreciated :p) here

Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/animation.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- animation.cpp	12 Feb 2004 17:16:38 -0000	1.9
+++ animation.cpp	13 Feb 2004 00:54:58 -0000	1.10
@@ -22,6 +22,7 @@
 #include "common/stdafx.h"
 #include "common/file.h"
 #include "sound/vorbis.h"
+#include "sound/mp3.h"
 
 #include "sword1/animation.h"
 
@@ -130,20 +131,25 @@
 	ticks = _sys->get_msecs();
 
 	/* Play audio - TODO: Sync with video?*/
+	sndfile = new File;
 
 #ifdef USE_VORBIS
-	// Another TODO: There is no reason that this only allows OGG, and not
-	// MP3, or any other format the mixer might support one day... is
-	// there?
-	sndfile = new File;
 	sprintf(tempFile, "%s.ogg", basename);
-	if (sndfile->open(tempFile)) {
-		bgSoundStream = makeVorbisStream(sndfile, sndfile->size());
-		_snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false);
-	}
+	if (sndfile->open(tempFile)) 
+		bgSoundStream = makeVorbisStream(sndfile, sndfile->size());				
+#endif
 
+#ifdef USE_MAD
+	if (!sndfile->isOpen()) {
+		sprintf(tempFile, "%s.mp3", basename);
+		if (sndfile->open(tempFile)) 
+			bgSoundStream = makeMP3Stream(sndfile, sndfile->size());
+	}
 #endif
 
+	if (sndfile->isOpen())
+		_snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false);	
+
 	return true;
 #else /* USE_MPEG2 */
 	return false;





More information about the Scummvm-git-logs mailing list