diff options
author | Travis Howell | 2007-06-07 02:43:03 +0000 |
---|---|---|
committer | Travis Howell | 2007-06-07 02:43:03 +0000 |
commit | f0acfc0a28530c00eb285389e37428347a1ad57f (patch) | |
tree | ee65da6d9cffe98873014d3998d5ff84c9fad4e8 /engines/agos/agos.cpp | |
parent | 8bcf073444813366e15989e08941bd993914c85d (diff) | |
download | scummvm-rg350-f0acfc0a28530c00eb285389e37428347a1ad57f.tar.gz scummvm-rg350-f0acfc0a28530c00eb285389e37428347a1ad57f.tar.bz2 scummvm-rg350-f0acfc0a28530c00eb285389e37428347a1ad57f.zip |
Limit MIDI driver, to games using MIDI music only.
svn-id: r27158
Diffstat (limited to 'engines/agos/agos.cpp')
-rw-r--r-- | engines/agos/agos.cpp | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 5e2f40b17a..c9f4b6cb2c 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -318,7 +318,6 @@ AGOSEngine::AGOSEngine(OSystem *syst) _scrollUpHitArea = 0; _scrollDownHitArea = 0; - _noOverWrite = 0; _rejectBlock = false; @@ -472,6 +471,9 @@ AGOSEngine::AGOSEngine(OSystem *syst) _planarBuf = 0; + _midiEnabled = false; + _nativeMT32 = false; + _vgaTickCounter = 0; _moviePlay = 0; @@ -572,30 +574,33 @@ int AGOSEngine::init() { _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); - // Setup midi driver - MidiDriver *driver = 0; - if (getGameType() == GType_FF || getGameType() == GType_PP || getGameId() == GID_SIMON1CD32) { - driver = MidiDriver::createMidi(MD_NULL); - _native_mt32 = false; - } else { + if ((getGameType() == GType_SIMON2 && getPlatform() == Common::kPlatformWindows) || + (getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformWindows) || + ((getFeatures() & GF_TALKIE) && getPlatform() == Common::kPlatformAcorn) || + (getPlatform() == Common::kPlatformPC)) { + + // Setup midi driver int midiDriver = MidiDriver::detectMusicDriver(MDT_ADLIB | MDT_MIDI); - _native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); - driver = MidiDriver::createMidi(midiDriver); - if (_native_mt32) { + _nativeMT32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); + MidiDriver *driver = MidiDriver::createMidi(midiDriver); + if (_nativeMT32) { driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); } - } - _midi.mapMT32toGM (getGameType() != GType_SIMON2 && !_native_mt32); + _midi.mapMT32toGM (getGameType() != GType_SIMON2 && !_nativeMT32); + + _midi.setDriver(driver); + int ret = _midi.open(); + if (ret) + warning("MIDI Player init failed: \"%s\"", _midi.getErrorName (ret)); - _midi.setDriver(driver); - int ret = _midi.open(); - if (ret) - warning("MIDI Player init failed: \"%s\"", _midi.getErrorName (ret)); - _midi.setVolume(ConfMan.getInt("music_volume")); + _midi.setVolume(ConfMan.getInt("music_volume")); - if (ConfMan.hasKey("music_mute") && ConfMan.getBool("music_mute") == 1) - _midi.pause(_musicPaused ^= 1); + if (ConfMan.hasKey("music_mute") && ConfMan.getBool("music_mute") == 1) + _midi.pause(_musicPaused ^= 1); + + _midiEnabled = true; + } // allocate buffers _backGroundBuf = (byte *)calloc(_screenWidth * _screenHeight, 1); @@ -742,7 +747,7 @@ void AGOSEngine_Simon2::setupGame() { _itemMemSize = 20000; _tableMemSize = 100000; // Check whether to use MT-32 MIDI tracks in Simon the Sorcerer 2 - if ((getGameType() == GType_SIMON2) && _native_mt32) + if ((getGameType() == GType_SIMON2) && _nativeMT32) _musicIndexBase = (1128 + 612) / 4; else _musicIndexBase = 1128 / 4; |