diff options
-rw-r--r-- | saga/ihnm_introproc.cpp | 3 | ||||
-rw-r--r-- | saga/music.cpp | 22 | ||||
-rw-r--r-- | saga/music.h | 3 | ||||
-rw-r--r-- | saga/saga.cpp | 8 | ||||
-rw-r--r-- | saga/scene.h | 9 |
5 files changed, 26 insertions, 19 deletions
diff --git a/saga/ihnm_introproc.cpp b/saga/ihnm_introproc.cpp index c16f3a1046..4feca57834 100644 --- a/saga/ihnm_introproc.cpp +++ b/saga/ihnm_introproc.cpp @@ -31,6 +31,7 @@ #include "saga/cvar_mod.h" #include "saga/events.h" #include "saga/rscfile_mod.h" +#include "saga/music.h" #include "saga/scene.h" @@ -258,7 +259,7 @@ int Scene::IHNMIntroMovieProc3(int param, SCENE_INFO *scene_info) { event.type = ONESHOT_EVENT; event.code = SCENE_EVENT; event.op = EVENT_END; - event.time = IHNM_TITLE_TIME; + event.time = _vm->_music->hasAdlib() ? IHNM_TITLE_TIME_ADLIB : IHNM_TITLE_TIME_GM; q_event = _vm->_events->chain(q_event, &event); break; diff --git a/saga/music.cpp b/saga/music.cpp index bb44ca9916..881bfc68a2 100644 --- a/saga/music.cpp +++ b/saga/music.cpp @@ -296,7 +296,7 @@ void MusicPlayer::stopMusic() { } } -Music::Music(SoundMixer *mixer, MidiDriver *driver, int enabled) : _mixer(mixer), _enabled(enabled) { +Music::Music(SoundMixer *mixer, MidiDriver *driver, int enabled) : _mixer(mixer), _enabled(enabled), _adlib(false) { _player = new MusicPlayer(driver); _musicInitialized = 1; _mixer->setMusicVolume(ConfMan.getInt("music_volume")); @@ -454,20 +454,18 @@ int Music::play(uint32 music_rn, uint16 flags) { } else { // Load MIDI/XMI resource data - bool isGM = false; - if (GAME_GetGameType() == GID_ITE) { rsc_ctxt = GAME_GetFileContext(GAME_RESOURCEFILE, 0); } else { - // TODO: Someone else will have to verify that the "FM" - // music is really the appropriate choice for MT-32. Is - // either of them the best choice for Adlib, or will - // they both sound equally wimpy? - if (!hasNativeMT32()) { - isGM = true; - rsc_ctxt = GAME_GetFileContext(GAME_MUSICFILE_GM, 0); - } else { + // TODO: I'm not sure if this is right, but the FM file + // sounds better with Adlib than the AM file does. On + // the other hand, it doesn't sound like quite the same + // music, which is strange. + + if (hasAdlib()) { rsc_ctxt = GAME_GetFileContext(GAME_MUSICFILE_FM, 0); + } else { + rsc_ctxt = GAME_GetFileContext(GAME_MUSICFILE_GM, 0); } } @@ -477,7 +475,7 @@ int Music::play(uint32 music_rn, uint16 flags) { return FAILURE; } - _player->setGM(isGM); + _player->setGM(true); parser = MidiParser::createParser_XMIDI(); } diff --git a/saga/music.h b/saga/music.h index 853592f4ee..d97b69fc85 100644 --- a/saga/music.h +++ b/saga/music.h @@ -108,6 +108,8 @@ public: ~Music(void); void setNativeMT32(bool b) { _player->setNativeMT32(b); } bool hasNativeMT32() { return _player->hasNativeMT32(); } + void setAdlib(bool b) { _adlib = b; } + bool hasAdlib() { return _adlib; } void setPassThrough(bool b) { _player->setPassThrough(b); } int play(uint32 music_rn, uint16 flags = MUSIC_DEFAULT); @@ -128,6 +130,7 @@ private: int _musicInitialized; int _enabled; bool _hasDigiMusic; + bool _adlib; RSCFILE_CONTEXT *_musicContext; const char *_musicFname; diff --git a/saga/saga.cpp b/saga/saga.cpp index de4a66ff1d..82d47cae92 100644 --- a/saga/saga.cpp +++ b/saga/saga.cpp @@ -193,14 +193,18 @@ void SagaEngine::go() { int midiDriver = GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE); bool native_mt32 = (ConfMan.getBool("native_mt32") || (midiDriver == MD_MT32)); + bool adlib = false; + MidiDriver *driver = GameDetector::createMidi(midiDriver); - if (!driver) + if (!driver) { driver = MidiDriver_ADLIB_create(_mixer); - else if (native_mt32) + adlib = true; + } else if (native_mt32) driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); _music = new Music(_mixer, driver, _musicEnabled); _music->setNativeMT32(native_mt32); + _music->setAdlib(adlib); if (midiDriver == MD_MT32) _music->setPassThrough(true); diff --git a/saga/scene.h b/saga/scene.h index e605a8313e..1e6664e0cb 100644 --- a/saga/scene.h +++ b/saga/scene.h @@ -155,10 +155,11 @@ struct SCENE_QUEUE { }; ///// IHNM-specific stuff -#define IHNM_PALFADE_TIME 1000 -#define IHNM_INTRO_FRAMETIME 80 -#define IHNM_DGLOGO_TIME 8000 -#define IHNM_TITLE_TIME 28750 +#define IHNM_PALFADE_TIME 1000 +#define IHNM_INTRO_FRAMETIME 80 +#define IHNM_DGLOGO_TIME 8000 +#define IHNM_TITLE_TIME_GM 28750 +#define IHNM_TITLE_TIME_ADLIB 20000 ///// ITE-specific stuff #define INTRO_STRMAX 256 |