From d173491acc2133497bc22b9728686b6b997ae505 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 19 Nov 2004 07:41:59 +0000 Subject: Added music to the partial IHNM intro. I think I picked the correct tune, but I can't be absolutely sure. I'm also not sure if I'm using the correct music data. I'm fairly sure that the MUSICGM.RES file is the appropriate choice for "General MIDI", but I have no way of verifying that the MUSICFM.RES is really the right choice for MT-32. (Is either of them a good choice for Adlib, or are they both equally bad?) svn-id: r15831 --- saga/game.cpp | 4 ++-- saga/game_mod.h | 4 +++- saga/ihnm_introproc.cpp | 13 +++++++++++++ saga/music.cpp | 21 ++++++++++++++++++--- saga/music.h | 8 +++++--- saga/saga.cpp | 2 +- saga/scene.h | 2 +- 7 files changed, 43 insertions(+), 11 deletions(-) (limited to 'saga') diff --git a/saga/game.cpp b/saga/game.cpp index 99b0bfd2ea..e54fd58551 100644 --- a/saga/game.cpp +++ b/saga/game.cpp @@ -129,8 +129,8 @@ GAME_FILEDESC IHNMDEMO_GameFiles[] = { // I Have No Mouth and I Must Scream - Retail CD version GAME_FILEDESC IHNMCD_GameFiles[] = { - {"MUSICFM.RES", GAME_MUSICFILE}, - {"MUSICGM.RES", GAME_MUSICFILE}, + {"MUSICFM.RES", GAME_MUSICFILE_FM}, + {"MUSICGM.RES", GAME_MUSICFILE_GM}, {"SCREAM.RES", GAME_RESOURCEFILE}, {"SCRIPTS.RES", GAME_SCRIPTFILE}, {"SFX.RES", GAME_SOUNDFILE}, diff --git a/saga/game_mod.h b/saga/game_mod.h index 0d69ab83e7..3a8ba044e5 100644 --- a/saga/game_mod.h +++ b/saga/game_mod.h @@ -45,7 +45,9 @@ enum GAME_FILETYPES { GAME_SOUNDFILE = 0x04, GAME_VOICEFILE = 0x08, GAME_DEMOFILE = 0x10, - GAME_MUSICFILE = 0x20 + GAME_MUSICFILE = 0x20, + GAME_MUSICFILE_GM = 0x40, + GAME_MUSICFILE_FM = 0x80 }; enum GAME_SOUNDINFO_TYPES { diff --git a/saga/ihnm_introproc.cpp b/saga/ihnm_introproc.cpp index 241a457d7e..c16f3a1046 100644 --- a/saga/ihnm_introproc.cpp +++ b/saga/ihnm_introproc.cpp @@ -217,6 +217,16 @@ int Scene::IHNMIntroMovieProc3(int param, SCENE_INFO *scene_info) { q_event = _vm->_events->queue(&event); + // Music, maestro + event.type = ONESHOT_EVENT; + event.code = MUSIC_EVENT; + event.param = 1; + event.param2 = 0; + event.op = EVENT_PLAY; + event.time = 0; + + q_event = _vm->_events->queue(&event); + // Background for intro scene is the first frame of the // intro animation; display it but don't set palette event.type = ONESHOT_EVENT; @@ -242,6 +252,9 @@ int Scene::IHNMIntroMovieProc3(int param, SCENE_INFO *scene_info) { _vm->_anim->play(0, 0); // Queue end of scene after a while + // TODO: I've increased the delay so the speech won't start + // until the music has ended. Could someone verify if that's + // the correct behaviour? event.type = ONESHOT_EVENT; event.code = SCENE_EVENT; event.op = EVENT_END; diff --git a/saga/music.cpp b/saga/music.cpp index d8ab563e65..bb44ca9916 100644 --- a/saga/music.cpp +++ b/saga/music.cpp @@ -452,9 +452,24 @@ int Music::play(uint32 music_rn, uint16 flags) { _player->setGM(true); parser = MidiParser::createParser_SMF(); } else { - // Load XMI resource data + // Load MIDI/XMI resource data - rsc_ctxt = GAME_GetFileContext(GAME_RESOURCEFILE, 0); + 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 { + rsc_ctxt = GAME_GetFileContext(GAME_MUSICFILE_FM, 0); + } + } if (RSC_LoadResource(rsc_ctxt, music_rn, &resource_data, &resource_size) != SUCCESS ) { @@ -462,7 +477,7 @@ int Music::play(uint32 music_rn, uint16 flags) { return FAILURE; } - _player->setGM(false); + _player->setGM(isGM); parser = MidiParser::createParser_XMIDI(); } diff --git a/saga/music.h b/saga/music.h index f7249628de..853592f4ee 100644 --- a/saga/music.h +++ b/saga/music.h @@ -55,7 +55,8 @@ public: void setVolume(int volume); int getVolume() { return _masterVolume; } - void hasNativeMT32(bool b) { _nativeMT32 = b; } + void setNativeMT32(bool b) { _nativeMT32 = b; } + bool hasNativeMT32() { return _nativeMT32; } void playMusic(); void stopMusic(); void setLoop(bool loop) { _looping = loop; } @@ -105,8 +106,9 @@ public: Music(SoundMixer *mixer, MidiDriver *driver, int enabled); ~Music(void); - void hasNativeMT32(bool b) { _player->hasNativeMT32(b); } - void setPassThrough(bool b) { _player->setPassThrough(b); } + void setNativeMT32(bool b) { _player->setNativeMT32(b); } + bool hasNativeMT32() { return _player->hasNativeMT32(); } + void setPassThrough(bool b) { _player->setPassThrough(b); } int play(uint32 music_rn, uint16 flags = MUSIC_DEFAULT); int pause(void); diff --git a/saga/saga.cpp b/saga/saga.cpp index 3c2c5dca91..03f8be3555 100644 --- a/saga/saga.cpp +++ b/saga/saga.cpp @@ -197,7 +197,7 @@ void SagaEngine::go() { driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); _music = new Music(_mixer, driver, _musicEnabled); - _music->hasNativeMT32(native_mt32); + _music->setNativeMT32(native_mt32); if (midiDriver == MD_MT32) _music->setPassThrough(true); diff --git a/saga/scene.h b/saga/scene.h index 44ed469127..e605a8313e 100644 --- a/saga/scene.h +++ b/saga/scene.h @@ -158,7 +158,7 @@ struct SCENE_QUEUE { #define IHNM_PALFADE_TIME 1000 #define IHNM_INTRO_FRAMETIME 80 #define IHNM_DGLOGO_TIME 8000 -#define IHNM_TITLE_TIME 16000 +#define IHNM_TITLE_TIME 28750 ///// ITE-specific stuff #define INTRO_STRMAX 256 -- cgit v1.2.3