Extended show_instruments to show the songs where each instrument is used in

svn-id: r49603
This commit is contained in:
Filippos Karapetis 2010-06-12 09:29:28 +00:00
parent a8af267651
commit b97d7adc3b

View File

@ -866,9 +866,15 @@ bool Console::cmdShowInstruments(int argc, const char **argv) {
sort(resources->begin(), resources->end(), ResourceIdLess());
Common::List<ResourceId>::iterator itr = resources->begin();
int instruments[128];
bool instrumentsSongs[128][1000];
for (int i = 0; i < 128; i++)
instruments[i] = 0;
for (int i = 0; i < 128; i++)
for (int j = 0; j < 1000; j++)
instrumentsSongs[i][j] = false;
if (songNumber == -1) {
DebugPrintf("%d sounds found, checking their instrument mappings...\n", resources->size());
DebugPrintf("Instruments:\n");
@ -930,6 +936,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) {
DebugPrintf(" %d", instrument);
instruments[instrument]++;
instrumentsSongs[instrument][itr->number] = true;
}
break;
case 0xD:
@ -984,6 +991,20 @@ bool Console::cmdShowInstruments(int argc, const char **argv) {
DebugPrintf("%d, ", i);
}
DebugPrintf("\n\n");
DebugPrintf("Used instruments in songs:\n");
for (int i = 0; i < 128; i++) {
if (instruments[i] > 0) {
DebugPrintf("Instrument %d: ", i);
for (int j = 0; j < 1000; j++) {
if (instrumentsSongs[i][j])
DebugPrintf("%d, ", j);
}
DebugPrintf("\n");
}
}
DebugPrintf("\n\n");
}
return true;