diff options
author | Eugene Sandulenko | 2004-10-21 22:40:06 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-10-21 22:40:06 +0000 |
commit | 44bd54b476b192c403a9c9bed0a463b1d715d103 (patch) | |
tree | 4a0bd1c20a7f3a6ce1efcb2200faf6ea94055610 /saga/saga.cpp | |
parent | 9d0b746aaaaf78cfcc18e866e4375ad1de533bc4 (diff) | |
download | scummvm-rg350-44bd54b476b192c403a9c9bed0a463b1d715d103.tar.gz scummvm-rg350-44bd54b476b192c403a9c9bed0a463b1d715d103.tar.bz2 scummvm-rg350-44bd54b476b192c403a9c9bed0a463b1d715d103.zip |
Better support of MT-32.
svn-id: r15636
Diffstat (limited to 'saga/saga.cpp')
-rw-r--r-- | saga/saga.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/saga/saga.cpp b/saga/saga.cpp index 057762ca43..e25c8dd1d5 100644 --- a/saga/saga.cpp +++ b/saga/saga.cpp @@ -161,27 +161,31 @@ void SagaEngine::go() { _previousTicks = _system->getMillis(); - // On some platforms, graphics initialization also initializes sound - // ( Win32 DirectX )... Music must be initialized before sound for - // native midi support - MidiDriver *driver = GameDetector::createMidi(GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE)); + // Initialize graphics + R_GAME_DISPLAYINFO disp_info; + GAME_GetDisplayInfo(&disp_info); + _gfx = new Gfx(_system, disp_info.logical_w, disp_info.logical_h); + + // Graphics should be initialized before music + int midiDriver = GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE); + bool native_mt32 = (ConfMan.getBool("native_mt32") || (midiDriver == MD_MT32)); + + MidiDriver *driver = GameDetector::createMidi(midiDriver); if (!driver) driver = MidiDriver_ADLIB_create(_mixer); - else if (ConfMan.getBool("native_mt32")) + else if (native_mt32) driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); _music = new Music(_mixer, driver, _musicEnabled); - _music->hasNativeMT32(ConfMan.getBool("native_mt32")); + _music->hasNativeMT32(native_mt32); + + if (midiDriver == MD_MT32) + _music->setPassThrough(true); if (!_musicEnabled) { debug(0, "Music disabled."); } - // Initialize graphics - R_GAME_DISPLAYINFO disp_info; - GAME_GetDisplayInfo(&disp_info); - _gfx = new Gfx(_system, disp_info.logical_w, disp_info.logical_h); - _isoMap = new IsoMap(_gfx); _render = new Render(this, _system); |