diff options
author | Filippos Karapetis | 2008-04-05 14:06:50 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-04-05 14:06:50 +0000 |
commit | a52c6e0ba247bbdfda24248fd9cff4830d4e8300 (patch) | |
tree | 0f47ec0db94454438051c68e6fd5a4b4284576ed | |
parent | d0bd38115618f92d33036fe35919f4c209c7b15e (diff) | |
download | scummvm-rg350-a52c6e0ba247bbdfda24248fd9cff4830d4e8300.tar.gz scummvm-rg350-a52c6e0ba247bbdfda24248fd9cff4830d4e8300.tar.bz2 scummvm-rg350-a52c6e0ba247bbdfda24248fd9cff4830d4e8300.zip |
Added code to load (but NOT play) the external music files in the Macintosh version of IHNM. I believe that the music in the Mac version is in TFMX format, which is not supported yet
svn-id: r31408
-rw-r--r-- | engines/saga/music.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 237525dc44..e5264df43d 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -433,10 +433,6 @@ void Music::play(uint32 resourceId, MusicFlags flags) { return; } - if (_vm->getGameType() == GType_IHNM && _vm->isMacResources()) { - return; - } - if (isPlaying() && _trackNumber == resourceId) { return; } @@ -512,6 +508,9 @@ void Music::play(uint32 resourceId, MusicFlags flags) { if (context == NULL) { context = _vm->_resource->getContext(GAME_RESOURCEFILE); } + } else if (_vm->getGameType() == GType_IHNM && _vm->isMacResources()) { + // The music of the Mac version of IHNM is loaded from its + // associated external file later on } else { // I've listened to music from both the FM and the GM // file, and I've tentatively reached the conclusion @@ -547,7 +546,26 @@ void Music::play(uint32 resourceId, MusicFlags flags) { _player->setGM(true); - _vm->_resource->loadResource(context, resourceId, resourceData, resourceSize); + if (_vm->getGameType() == GType_IHNM && _vm->isMacResources()) { + // Load the external music file for Mac IHNM + Common::File musicFile; + char musicFileName[40]; + if (resourceId <= 16) // F in hex (1 char in hex) + sprintf(musicFileName, "Music/Music0%x", resourceId); + else + sprintf(musicFileName, "Music/Music%x", resourceId); + musicFile.open(musicFileName); + resourceSize = musicFile.size(); + resourceData = new byte[resourceSize]; + musicFile.read(resourceData, resourceSize); + musicFile.close(); + + // TODO: The Mac music format is unknown (probably TFMX?) + // so stop here + return; + } else { + _vm->_resource->loadResource(context, resourceId, resourceData, resourceSize); + } if (resourceSize < 4) { error("Music::play() wrong music resource size"); |