aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/animation.cpp22
1 files changed, 6 insertions, 16 deletions
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 */