[Scummvm-cvs-logs] SF.net SVN: scummvm: [31408] scummvm/trunk/engines/saga/music.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Apr 5 16:07:36 CEST 2008
Revision: 31408
http://scummvm.svn.sourceforge.net/scummvm/?rev=31408&view=rev
Author: thebluegr
Date: 2008-04-05 07:06:50 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
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
Modified Paths:
--------------
scummvm/trunk/engines/saga/music.cpp
Modified: scummvm/trunk/engines/saga/music.cpp
===================================================================
--- scummvm/trunk/engines/saga/music.cpp 2008-04-05 13:54:12 UTC (rev 31407)
+++ scummvm/trunk/engines/saga/music.cpp 2008-04-05 14:06:50 UTC (rev 31408)
@@ -433,10 +433,6 @@
return;
}
- if (_vm->getGameType() == GType_IHNM && _vm->isMacResources()) {
- return;
- }
-
if (isPlaying() && _trackNumber == resourceId) {
return;
}
@@ -512,6 +508,9 @@
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,8 +546,27 @@
_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");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list