diff options
author | Filippos Karapetis | 2010-06-12 09:29:28 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-12 09:29:28 +0000 |
commit | b97d7adc3b43c648e56738fc6e43736a74248961 (patch) | |
tree | 868e8ea7c6486688978eb6fd4f718fd65b798599 | |
parent | a8af267651c054bb45a0b5da77ea71b7100474ad (diff) | |
download | scummvm-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.cpp | 21 |
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; |