aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathrxx2011-06-05 18:28:05 +0200
committerathrxx2011-06-05 18:29:16 +0200
commit920c3bb17236e013b0e135886fa37521ceffd086 (patch)
treeb8e64cb7a783622999509cd1df8900175303431d
parent43075248aaef68ab9eef39c8988854f00eb694b0 (diff)
downloadscummvm-rg350-920c3bb17236e013b0e135886fa37521ceffd086.tar.gz
scummvm-rg350-920c3bb17236e013b0e135886fa37521ceffd086.tar.bz2
scummvm-rg350-920c3bb17236e013b0e135886fa37521ceffd086.zip
KYRA: fix audio detection
Don't attempt to detect PC devices for non-PC versions of the game, because this might trigger unnecessary detection failure messages.
-rw-r--r--engines/kyra/kyra_v1.cpp77
1 files changed, 39 insertions, 38 deletions
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index f108082e13..f79fabf9eb 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -93,15 +93,6 @@ Common::Error KyraEngine_v1::init() {
syncSoundSettings();
if (!_flags.useDigSound) {
- // In Kyra 1 users who have specified a default MT-32 device in the launcher settings
- // will get MT-32 music, otherwise AdLib. In Kyra 2 and LoL users who have specified a
- // default GM device in the launcher will get GM music, otherwise AdLib. Users who want
- // MT-32 music in Kyra2 or LoL have to select this individually (since we assume that
- // most users rather have a GM device than a MT-32 device).
- // Users who want PC speaker sound always have to select this individually for all
- // Kyra games.
- MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_PCSPK | MDT_MIDI | MDT_ADLIB | ((_flags.gameID == GI_KYRA2 || _flags.gameID == GI_LOL) ? MDT_PREFER_GM : MDT_PREFER_MT32));
-
if (_flags.platform == Common::kPlatformFMTowns) {
if (_flags.gameID == GI_KYRA1)
_sound = new SoundTowns(this, _mixer);
@@ -114,43 +105,53 @@ Common::Error KyraEngine_v1::init() {
_sound = new SoundTownsPC98_v2(this, _mixer);
} else if (_flags.platform == Common::kPlatformAmiga) {
_sound = new SoundAmiga(this, _mixer);
- } else if (MidiDriver::getMusicType(dev) == MT_ADLIB) {
- _sound = new SoundAdLibPC(this, _mixer);
} else {
- Sound::kType type;
- const MusicType midiType = MidiDriver::getMusicType(dev);
+ // In Kyra 1 users who have specified a default MT-32 device in the launcher settings
+ // will get MT-32 music, otherwise AdLib. In Kyra 2 and LoL users who have specified a
+ // default GM device in the launcher will get GM music, otherwise AdLib. Users who want
+ // MT-32 music in Kyra2 or LoL have to select this individually (since we assume that
+ // most users rather have a GM device than a MT-32 device).
+ // Users who want PC speaker sound always have to select this individually for all
+ // Kyra games.
+ MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_PCSPK | MDT_MIDI | MDT_ADLIB | ((_flags.gameID == GI_KYRA2 || _flags.gameID == GI_LOL) ? MDT_PREFER_GM : MDT_PREFER_MT32));
+ if (MidiDriver::getMusicType(dev) == MT_ADLIB) {
+ _sound = new SoundAdLibPC(this, _mixer);
+ } else {
+ Sound::kType type;
+ const MusicType midiType = MidiDriver::getMusicType(dev);
- if (midiType == MT_PCSPK || midiType == MT_NULL)
- type = Sound::kPCSpkr;
- else if (midiType == MT_MT32 || ConfMan.getBool("native_mt32"))
- type = Sound::kMidiMT32;
- else
- type = Sound::kMidiGM;
+ if (midiType == MT_PCSPK || midiType == MT_NULL)
+ type = Sound::kPCSpkr;
+ else if (midiType == MT_MT32 || ConfMan.getBool("native_mt32"))
+ type = Sound::kMidiMT32;
+ else
+ type = Sound::kMidiGM;
- MidiDriver *driver = 0;
+ MidiDriver *driver = 0;
- if (MidiDriver::getMusicType(dev) == MT_PCSPK) {
- driver = new MidiDriver_PCSpeaker(_mixer);
- } else {
- driver = MidiDriver::createMidi(dev);
- if (type == Sound::kMidiMT32)
- driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
- }
+ if (MidiDriver::getMusicType(dev) == MT_PCSPK) {
+ driver = new MidiDriver_PCSpeaker(_mixer);
+ } else {
+ driver = MidiDriver::createMidi(dev);
+ if (type == Sound::kMidiMT32)
+ driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
+ }
- assert(driver);
+ assert(driver);
- SoundMidiPC *soundMidiPc = new SoundMidiPC(this, _mixer, driver, type);
- _sound = soundMidiPc;
- assert(_sound);
+ SoundMidiPC *soundMidiPc = new SoundMidiPC(this, _mixer, driver, type);
+ _sound = soundMidiPc;
+ assert(_sound);
- // Unlike some SCUMM games, it's not that the MIDI sounds are
- // missing. It's just that at least at the time of writing they
- // are decidedly inferior to the AdLib ones.
- if (ConfMan.getBool("multi_midi")) {
- SoundAdLibPC *adlib = new SoundAdLibPC(this, _mixer);
- assert(adlib);
+ // Unlike some SCUMM games, it's not that the MIDI sounds are
+ // missing. It's just that at least at the time of writing they
+ // are decidedly inferior to the AdLib ones.
+ if (ConfMan.getBool("multi_midi")) {
+ SoundAdLibPC *adlib = new SoundAdLibPC(this, _mixer);
+ assert(adlib);
- _sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);
+ _sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);
+ }
}
}