diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-03-14 15:55:40 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2018-06-05 22:58:35 +0200 |
commit | 2ae9df7248923c286e00dd1bf009275034137a7e (patch) | |
tree | 748cd2162311172f893838b84c6e723780b3e622 /src/music/win32_m.cpp | |
parent | f946b3da56b22c1fc32a9ffc9008374e4fb4f8c8 (diff) | |
download | openttd-2ae9df7248923c286e00dd1bf009275034137a7e.tar.xz |
Feature: Decoder for DOS version music
This is based on reverse-engineering the TTD DOS driver for General MIDI music.
Diffstat (limited to 'src/music/win32_m.cpp')
-rw-r--r-- | src/music/win32_m.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/music/win32_m.cpp b/src/music/win32_m.cpp index 8e5adeab2..51528133b 100644 --- a/src/music/win32_m.cpp +++ b/src/music/win32_m.cpp @@ -307,12 +307,14 @@ void CALLBACK TimerCallback(UINT uTimerID, UINT, DWORD_PTR dwUser, DWORD_PTR, DW void MusicDriver_Win32::PlaySong(const MusicSongInfo &song) { - if (song.filetype != MTT_STANDARDMIDI) return; - DEBUG(driver, 2, "Win32-MIDI: PlaySong: entry"); EnterCriticalSection(&_midi.lock); - _midi.next_file.LoadFile(song.filename); + if (!_midi.next_file.LoadSong(song)) { + LeaveCriticalSection(&_midi.lock); + return; + } + _midi.next_segment.start = 0; _midi.next_segment.end = 0; _midi.next_segment.loop = false; |