[Scummvm-cvs-logs] SF.net SVN: scummvm:[53903] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Oct 28 15:00:21 CEST 2010


Revision: 53903
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53903&view=rev
Author:   thebluegr
Date:     2010-10-28 13:00:21 +0000 (Thu, 28 Oct 2010)

Log Message:
-----------
SCI: Improved the description of the "map_instrument" console command a bit. Also, the dynamic mappings are now checked before the static ones

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/sound/drivers/midi.cpp

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-10-28 12:48:51 UTC (rev 53902)
+++ scummvm/trunk/engines/sci/console.cpp	2010-10-28 13:00:21 UTC (rev 53903)
@@ -1046,8 +1046,12 @@
 	if (argc != 4) {
 		DebugPrintf("Maps an MT-32 custom instrument to a GM instrument on the fly\n\n");
 		DebugPrintf("Usage %s <MT-32 instrument name> <GM instrument> <GM rhythm key>\n", argv[0]);
-		DebugPrintf("Each MT-32 instrument is mapped to either a GM instrument, or a GM rhythm key\n");
+		DebugPrintf("Each MT-32 instrument is always 10 characters and is mapped to either a GM instrument, or a GM rhythm key\n");
+		DebugPrintf("A value of 255 (0xff) signifies an unmapped instrument\n");
 		DebugPrintf("Please replace the spaces in the instrument name with underscores (\"_\"). They'll be converted to spaces afterwards\n\n");
+		DebugPrintf("Example: %s test_0__XX 1 255\n", argv[0]);
+		DebugPrintf("The above example will map the MT-32 instument \"test 0  XX\" to GM instrument 1\n\n");
+		Example
 	} else {
 		if (Mt32dynamicMappings != NULL) {
 			Mt32ToGmMap newMapping;

Modified: scummvm/trunk/engines/sci/sound/drivers/midi.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/drivers/midi.cpp	2010-10-28 12:48:51 UTC (rev 53902)
+++ scummvm/trunk/engines/sci/sound/drivers/midi.cpp	2010-10-28 13:00:21 UTC (rev 53903)
@@ -628,12 +628,6 @@
 byte MidiPlayer_Midi::lookupGmInstrument(const char *iname) {
 	int i = 0;
 
-	while (Mt32MemoryTimbreMaps[i].name) {
-		if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0)
-			return getGmInstrument(Mt32MemoryTimbreMaps[i]);
-		i++;
-	}
-
 	if (Mt32dynamicMappings != NULL) {
 		const Mt32ToGmMapList::iterator end = Mt32dynamicMappings->end();
 		for (Mt32ToGmMapList::iterator it = Mt32dynamicMappings->begin(); it != end; ++it) {
@@ -642,18 +636,18 @@
 		}
 	}
 
+	while (Mt32MemoryTimbreMaps[i].name) {
+		if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0)
+			return getGmInstrument(Mt32MemoryTimbreMaps[i]);
+		i++;
+	}
+
 	return MIDI_UNMAPPED;
 }
 
 byte MidiPlayer_Midi::lookupGmRhythmKey(const char *iname) {
 	int i = 0;
 
-	while (Mt32MemoryTimbreMaps[i].name) {
-		if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0)
-			return Mt32MemoryTimbreMaps[i].gmRhythmKey;
-		i++;
-	}
-
 	if (Mt32dynamicMappings != NULL) {
 		const Mt32ToGmMapList::iterator end = Mt32dynamicMappings->end();
 		for (Mt32ToGmMapList::iterator it = Mt32dynamicMappings->begin(); it != end; ++it) {
@@ -662,6 +656,12 @@
 		}
 	}
 
+	while (Mt32MemoryTimbreMaps[i].name) {
+		if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0)
+			return Mt32MemoryTimbreMaps[i].gmRhythmKey;
+		i++;
+	}
+
 	return MIDI_UNMAPPED;
 }
 


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