aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-12 09:29:28 +0000
committerFilippos Karapetis2010-06-12 09:29:28 +0000
commitb97d7adc3b43c648e56738fc6e43736a74248961 (patch)
tree868e8ea7c6486688978eb6fd4f718fd65b798599
parenta8af267651c054bb45a0b5da77ea71b7100474ad (diff)
downloadscummvm-rg350-b97d7adc3b43c648e56738fc6e43736a74248961.tar.gz
scummvm-rg350-b97d7adc3b43c648e56738fc6e43736a74248961.tar.bz2
scummvm-rg350-b97d7adc3b43c648e56738fc6e43736a74248961.zip
Extended show_instruments to show the songs where each instrument is used in
svn-id: r49603
-rw-r--r--engines/sci/console.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 9d713cd2dd..bd597aaa19 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -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;