diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-03-21 17:12:29 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2018-06-05 22:58:35 +0200 |
commit | a8080f14a9c75a1175976ee8d0cd17c677b55119 (patch) | |
tree | dc57362c439d6958f01c680f8f538da28fd3bf4e /src/music/allegro_m.cpp | |
parent | 458e441a4ca5d451941958e056189a059f2eee76 (diff) | |
download | openttd-a8080f14a9c75a1175976ee8d0cd17c677b55119.tar.xz |
Change: DOS music loading for non-Windows music drivers
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() |