diff options
| author | Nicolas Bacca | 2004-02-13 00:54:58 +0000 | 
|---|---|---|
| committer | Nicolas Bacca | 2004-02-13 00:54:58 +0000 | 
| commit | 3c6114bd9cf2ff5655879688ad06a19e5bef3a9f (patch) | |
| tree | 1757f003586943971f5759ead9d6fa1bbfcb9424 | |
| parent | 85e417bb11be57f48820454da8f47d34b43c0b46 (diff) | |
| download | scummvm-rg350-3c6114bd9cf2ff5655879688ad06a19e5bef3a9f.tar.gz scummvm-rg350-3c6114bd9cf2ff5655879688ad06a19e5bef3a9f.tar.bz2 scummvm-rg350-3c6114bd9cf2ff5655879688ad06a19e5bef3a9f.zip | |
Check for MP3 file in Broken Sword cutscenes - useful for WinCE backend as Tremor crashes for no specific reason (help appreciated :p) here
svn-id: r12837
| -rw-r--r-- | sword1/animation.cpp | 22 | ||||
| -rw-r--r-- | sword2/driver/animation.cpp | 21 | 
2 files changed, 28 insertions, 15 deletions
| diff --git a/sword1/animation.cpp b/sword1/animation.cpp index 0a07acd627..46d8c59006 100644 --- a/sword1/animation.cpp +++ b/sword1/animation.cpp @@ -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 @@ bool AnimationState::init(const char *basename) {  	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; diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp index f6f74cd3d7..d0840c691e 100644 --- a/sword2/driver/animation.cpp +++ b/sword2/driver/animation.cpp @@ -31,6 +31,7 @@  #include "common/file.h"  #include "sound/vorbis.h" +#include "sound/mp3.h"  namespace Sword2 { @@ -136,19 +137,25 @@ bool AnimationState::init(const char *name) {  	ticks = _vm->_system->get_msecs();  	// Play audio +	sndfile = new File;  #ifdef USE_VORBIS -	// 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", name); -	if (sndfile->open(tempFile)) { -		bgSoundStream = makeVorbisStream(sndfile, sndfile->size()); -		_vm->_mixer->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", name); +		if (sndfile->open(tempFile))  +			bgSoundStream = makeMP3Stream(sndfile, sndfile->size()); +	}  #endif +	if (sndfile->isOpen()) +		_vm->_mixer->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false);	 +  	return true;  #else /* USE_MPEG2 */  	return false; | 
