diff options
author | Filippos Karapetis | 2010-10-21 13:13:56 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-10-21 13:13:56 +0000 |
commit | d251521f63b0d3d0e8dbaf16a867b043e6ddfedb (patch) | |
tree | bc681138a55b0cd317f7d89b94574c73bbf38f85 /engines | |
parent | 89fc06d87880ff541292488bac94c03642188d8b (diff) | |
download | scummvm-rg350-d251521f63b0d3d0e8dbaf16a867b043e6ddfedb.tar.gz scummvm-rg350-d251521f63b0d3d0e8dbaf16a867b043e6ddfedb.tar.bz2 scummvm-rg350-d251521f63b0d3d0e8dbaf16a867b043e6ddfedb.zip |
SCI: Added the ability to filter out results of the "class_table" command
svn-id: r53673
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/console.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 4bbbb88b56..77a7684713 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1141,14 +1141,18 @@ bool Console::cmdRestartGame(int argc, const char **argv) { } bool Console::cmdClassTable(int argc, const char **argv) { - DebugPrintf("Available classes:\n"); + DebugPrintf("Available classes (parse a parameter to filter the table by a specific class):\n"); + for (uint i = 0; i < _engine->_gamestate->_segMan->classTableSize(); i++) { Class temp = _engine->_gamestate->_segMan->_classTable[i]; if (temp.reg.segment) { - DebugPrintf(" Class 0x%x (%s) at %04x:%04x (script 0x%x)\n", i, - _engine->_gamestate->_segMan->getObjectName(temp.reg), - PRINT_REG(temp.reg), - temp.script); + const char *className = _engine->_gamestate->_segMan->getObjectName(temp.reg); + if (argc == 1 || (argc == 2 && !strcmp(className, argv[1]))) { + DebugPrintf(" Class 0x%x (%s) at %04x:%04x (script %d)\n", i, + className, + PRINT_REG(temp.reg), + temp.script); + } } } |