aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/sound')
-rw-r--r--engines/sci/sound/drivers/midi.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp
index d119be32b3..52ddb5ab8a 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -628,12 +628,6 @@ void MidiPlayer_Midi::readMt32DrvData() {
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 @@ byte MidiPlayer_Midi::lookupGmInstrument(const char *iname) {
}
}
+ 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 @@ byte MidiPlayer_Midi::lookupGmRhythmKey(const char *iname) {
}
}
+ while (Mt32MemoryTimbreMaps[i].name) {
+ if (scumm_strnicmp(iname, Mt32MemoryTimbreMaps[i].name, 10) == 0)
+ return Mt32MemoryTimbreMaps[i].gmRhythmKey;
+ i++;
+ }
+
return MIDI_UNMAPPED;
}