From aa6ec62e9db78db12912d0e48025241c5d7ef4f7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 22 Feb 2004 14:11:16 +0000 Subject: Patch #885904 (Flac Support) with some tweaks by me svn-id: r12984 --- sword2/driver/animation.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'sword2/driver') diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp index 1cd2def9f5..31a008cab9 100644 --- a/sword2/driver/animation.cpp +++ b/sword2/driver/animation.cpp @@ -145,24 +145,14 @@ bool AnimationState::init(const char *name) { ticks = _vm->_system->get_msecs(); // Play audio - sndfile = new File; + sndfile = new File(); + bgSoundStream = AudioStream::openStreamFile( name, sndfile ); -#ifdef USE_VORBIS - sprintf(tempFile, "%s.ogg", name); - 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()); + if (bgSoundStream != NULL) { + _vm->_mixer->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false); + } else { + warning("Cutscene: Could not open Audio Track for %s", name); } -#endif - - if (sndfile->isOpen()) - _vm->_mixer->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false); return true; #else /* USE_MPEG2 */ -- cgit v1.2.3