summaryrefslogtreecommitdiff
path: root/src/music/extmidi.cpp
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2018-03-21 17:12:29 +0100
committerMichael Lutz <michi@icosahedron.de>2018-06-05 22:58:35 +0200
commita8080f14a9c75a1175976ee8d0cd17c677b55119 (patch)
treedc57362c439d6958f01c680f8f538da28fd3bf4e /src/music/extmidi.cpp
parent458e441a4ca5d451941958e056189a059f2eee76 (diff)
downloadopenttd-a8080f14a9c75a1175976ee8d0cd17c677b55119.tar.xz
Change: DOS music loading for non-Windows music drivers
Diffstat (limited to 'src/music/extmidi.cpp')
-rw-r--r--src/music/extmidi.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/music/extmidi.cpp b/src/music/extmidi.cpp
index c532e9d44..9d07761b7 100644
--- a/src/music/extmidi.cpp
+++ b/src/music/extmidi.cpp
@@ -18,6 +18,7 @@
#include "../gfx_func.h"
#include "extmidi.h"
#include "../base_media_base.h"
+#include "midifile.hpp"
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -86,10 +87,11 @@ void MusicDriver_ExtMidi::Stop()
void MusicDriver_ExtMidi::PlaySong(const MusicSongInfo &song)
{
- if (song.filetype != MTT_STANDARDMIDI) return;
-
- strecpy(this->song, song.filename, lastof(this->song));
- this->DoStop();
+ std::string filename = MidiFile::GetSMFFile(song);
+ if (!filename.empty()) {
+ strecpy(this->song, filename.c_str(), lastof(this->song));
+ this->DoStop();
+ }
}
void MusicDriver_ExtMidi::StopSong()