Music works now in the IHNM demo

svn-id: r28332
This commit is contained in:
Filippos Karapetis 2007-07-30 18:26:56 +00:00
parent 012f16d5c3
commit 2b2af8ab5e
4 changed files with 20 additions and 6 deletions

View File

@ -713,6 +713,7 @@ static const SAGAGameDescription gameDescriptions[] = {
"ihnm",
"Demo",
{
{"music.res", GAME_MUSICFILE_FM, "0439083e3dfdc51b486071d45872ae52", -1},
{"scream.res", GAME_RESOURCEFILE, "46bbdc65d164ba7e89836a0935eec8e6", -1},
{"scripts.res", GAME_SCRIPTFILE, "9626bda8978094ff9b29198bc1ed5f9a", -1},
{"sfx.res", GAME_SOUNDFILE, "1c610d543f32ec8b525e3f652536f269", -1},

View File

@ -225,6 +225,16 @@ int Scene::IHNMIntroMovieProc1(int param) {
q_event = _vm->_events->chain(q_event, &event);
} else {
// Start playing the intro music for the demo version
event.type = kEvTOneshot;
event.code = kMusicEvent;
event.param = 1;
event.param2 = MUSIC_NORMAL;
event.op = kEventPlay;
event.time = 0;
q_event = _vm->_events->chain(q_event, &event);
// The IHNM demo doesn't have an animation at the
// Cyberdreans logo screen
@ -232,7 +242,7 @@ int Scene::IHNMIntroMovieProc1(int param) {
event.type = kEvTOneshot;
event.code = kSceneEvent;
event.op = kEventEnd;
event.time = 4000;
event.time = 8000;
q_event = _vm->_events->chain(q_event, &event);
}
@ -360,8 +370,6 @@ int Scene::IHNMIntroMovieProc3(int param) {
// In the GM file, this music also appears as tracks 7, 13, 19,
// 25 and 31, but only track 1 sounds right with the FM music.
// FIXME: MIDI music in the demo is problematic right now, so music is
// disabled in this part
if (_vm->getGameId() != GID_IHNM_DEMO) {
event.type = kEvTOneshot;
event.code = kMusicEvent;
@ -411,7 +419,7 @@ int Scene::IHNMIntroMovieProc3(int param) {
if (_vm->getGameId() != GID_IHNM_DEMO)
event.time = _vm->_music->hasAdlib() ? IHNM_TITLE_TIME_FM : IHNM_TITLE_TIME_GM;
else
event.time = 10000;
event.time = 12000;
q_event = _vm->_events->chain(q_event, &event);
break;

View File

@ -517,8 +517,10 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
// Oddly enough, the intro music (song 1) is very
// different in the two files. I have no idea why.
// Note that the IHNM demo has only got one music file
// (music.rsc). It is assumed that it contains FM music
if (hasAdlib()) {
if (hasAdlib() || _vm->getGameId() == GID_IHNM_DEMO) {
context = _vm->_resource->getContext(GAME_MUSICFILE_FM);
} else {
context = _vm->_resource->getContext(GAME_MUSICFILE_GM);

View File

@ -683,7 +683,7 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) {
_vm->_anim->loadCutawayList(resourcePointer, resourceLength);
if (_metaResource.songTableID > 0) {
if (_vm->getGameId() != GID_IHNM_DEMO) {
_vm->_resource->loadResource(resourceContext, _metaResource.songTableID, resourcePointer, resourceLength);
if (resourceLength == 0) {
@ -700,6 +700,9 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) {
for (i = 0; i < _vm->_music->_songTableLen; i++)
_vm->_music->_songTable[i] = songS.readSint32LE();
free(resourcePointer);
} else {
// The IHNM demo has a fixed music track and doesn't load a song table
_vm->_music->play(3, MUSIC_NORMAL);
}
int voiceLUTResourceID = 0;