aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2015-07-05 01:09:55 +0200
committerTorbjörn Andersson2015-07-05 01:09:55 +0200
commitcc471ecd078c4a7f19c2794ac8a8479c1ad4d26b (patch)
treedb8f8ea8ceb14c556c5c70c58f0864f0f9209260 /engines
parent2104f41521a64913d88d1b26da51de5c0b899dc8 (diff)
downloadscummvm-rg350-cc471ecd078c4a7f19c2794ac8a8479c1ad4d26b.tar.gz
scummvm-rg350-cc471ecd078c4a7f19c2794ac8a8479c1ad4d26b.tar.bz2
scummvm-rg350-cc471ecd078c4a7f19c2794ac8a8479c1ad4d26b.zip
MADE: Cleanup AdLib driver initialization...
... as per m_kiewitz's suggestions.
Diffstat (limited to 'engines')
-rw-r--r--engines/made/made.cpp2
-rw-r--r--engines/made/music.cpp15
-rw-r--r--engines/made/music.h2
3 files changed, 11 insertions, 8 deletions
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index 5d3e6d7069..ab07ef757b 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, (getFeatures() & GF_CD_COMPRESSED) != 0);
+ _music = new MusicPlayer(getGameID() == GID_RTZ);
syncSoundSettings();
// Initialize backend
diff --git a/engines/made/music.cpp b/engines/made/music.cpp
index 7efa24f985..be66c08aaf 100644
--- a/engines/made/music.cpp
+++ b/engines/made/music.cpp
@@ -31,24 +31,27 @@
#include "audio/midiparser.h"
#include "audio/miles.h"
+#include "common/file.h"
#include "common/stream.h"
namespace Made {
-MusicPlayer::MusicPlayer(bool milesAudio, bool compressedCD) : _isGM(false),_milesAudioMode(false) {
+MusicPlayer::MusicPlayer(bool milesAudio) : _isGM(false),_milesAudioMode(false) {
MusicType musicType;
if (milesAudio) {
MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32);
musicType = MidiDriver::getMusicType(dev);
+ Common::SeekableReadStream *adLibInstrumentStream = nullptr;
switch (musicType) {
case MT_ADLIB:
_milesAudioMode = true;
- 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");
+ if (Common::File::exists("rtzcd.red")) {
+ // Installing Return to Zork produces both a SAMPLE.AD and
+ // a SAMPLE.OPL file, but they are identical. The resource
+ // file appears to only contain SAMPLE.AD.
+ adLibInstrumentStream = RedReader::loadFromRed("rtzcd.red", "SAMPLE.AD");
}
+ _driver = Audio::MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.OPL", adLibInstrumentStream);
break;
case MT_MT32:
_milesAudioMode = true;
diff --git a/engines/made/music.h b/engines/made/music.h
index 710805d2af..558b41c2e2 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, bool compressedCD);
+ MusicPlayer(bool milesAudio);
void playXMIDI(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL);
void playSMF(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL);