diff options
Diffstat (limited to 'src/music/allegro_m.cpp')
-rw-r--r-- | src/music/allegro_m.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/music/allegro_m.cpp b/src/music/allegro_m.cpp index fee5bf8a0..906aec84f 100644 --- a/src/music/allegro_m.cpp +++ b/src/music/allegro_m.cpp @@ -14,6 +14,7 @@ #include "../stdafx.h" #include "../debug.h" #include "allegro_m.h" +#include "midifile.hpp" #include <allegro.h> #include "../safeguards.h" @@ -60,11 +61,15 @@ void MusicDriver_Allegro::Stop() void MusicDriver_Allegro::PlaySong(const MusicSongInfo &song) { - if (song.filetype != MTT_STANDARDMIDI) return; + std::string filename = MidiFile::GetSMFFile(song); if (_midi != NULL) destroy_midi(_midi); - _midi = load_midi(song.filename); - play_midi(_midi, false); + if (!filename.empty()) { + _midi = load_midi(filename.c_str()); + play_midi(_midi, false); + } else { + _midi = NULL; + } } void MusicDriver_Allegro::StopSong() |