diff options
author | Torbjörn Andersson | 2015-07-04 23:34:08 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2015-07-05 00:08:15 +0200 |
commit | 672bdeff1f4a0e73d4565ab596af4833e9b7075a (patch) | |
tree | b883abe3250264726b430d40f739b8d95e52bcf9 /engines/made | |
parent | 0800d67f6568a67925f7fcda115dfcc6d6aec98c (diff) | |
download | scummvm-rg350-672bdeff1f4a0e73d4565ab596af4833e9b7075a.tar.gz scummvm-rg350-672bdeff1f4a0e73d4565ab596af4833e9b7075a.tar.bz2 scummvm-rg350-672bdeff1f4a0e73d4565ab596af4833e9b7075a.zip |
MADE: Allow loading of sample.ad from rtzcd.red
At the moment, AdLib music doesn't work yet though. At least not
for this particular case.
Diffstat (limited to 'engines/made')
-rw-r--r-- | engines/made/made.cpp | 2 | ||||
-rw-r--r-- | engines/made/music.cpp | 25 | ||||
-rw-r--r-- | engines/made/music.h | 2 |
3 files changed, 20 insertions, 9 deletions
diff --git a/engines/made/made.cpp b/engines/made/made.cpp index ab07ef757b..5d3e6d7069 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -275,7 +275,7 @@ void MadeEngine::handleEvents() { } Common::Error MadeEngine::run() { - _music = new MusicPlayer(getGameID() == GID_RTZ); + _music = new MusicPlayer(getGameID() == GID_RTZ, (getFeatures() & GF_CD_COMPRESSED) != 0); syncSoundSettings(); // Initialize backend diff --git a/engines/made/music.cpp b/engines/made/music.cpp index 6e5acb88b0..7efa24f985 100644 --- a/engines/made/music.cpp +++ b/engines/made/music.cpp @@ -25,21 +25,30 @@ // MIDI and digital music class #include "made/music.h" +#include "made/redreader.h" #include "made/resource.h" #include "audio/midiparser.h" #include "audio/miles.h" +#include "common/stream.h" + namespace Made { -MusicPlayer::MusicPlayer(bool milesAudio) : _isGM(false),_milesAudioMode(false) { +MusicPlayer::MusicPlayer(bool milesAudio, bool compressedCD) : _isGM(false),_milesAudioMode(false) { + MusicType musicType; if (milesAudio) { MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32); - MusicType musicType = MidiDriver::getMusicType(dev); + musicType = MidiDriver::getMusicType(dev); switch (musicType) { case MT_ADLIB: _milesAudioMode = true; - _driver = Audio::MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.AD"); + if (compressedCD) { + Common::SeekableReadStream *adLibInstrumentStream = RedReader::loadFromRed("rtzcd.red", "sample.ad"); + _driver = Audio::MidiDriver_Miles_AdLib_create("", "", adLibInstrumentStream); + } else { + _driver = Audio::MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.AD"); + } break; case MT_MT32: _milesAudioMode = true; @@ -56,10 +65,12 @@ MusicPlayer::MusicPlayer(bool milesAudio) : _isGM(false),_milesAudioMode(false) int ret = _driver->open(); if (ret == 0) { - if (_nativeMT32) - _driver->sendMT32Reset(); - else - _driver->sendGMReset(); + if (musicType != MT_ADLIB) { + if (_nativeMT32) + _driver->sendMT32Reset(); + else + _driver->sendGMReset(); + } _driver->setTimerCallback(this, &timerCallback); } diff --git a/engines/made/music.h b/engines/made/music.h index 558b41c2e2..710805d2af 100644 --- a/engines/made/music.h +++ b/engines/made/music.h @@ -38,7 +38,7 @@ enum MusicFlags { class MusicPlayer : public Audio::MidiPlayer { public: - MusicPlayer(bool milesAudio); + MusicPlayer(bool milesAudio, bool compressedCD); void playXMIDI(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL); void playSMF(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL); |