diff options
author | Robert Göffringmann | 2007-04-01 00:00:28 +0000 |
---|---|---|
committer | Robert Göffringmann | 2007-04-01 00:00:28 +0000 |
commit | 2edec11986c504e022e8f3e43e6259ad496c4f0f (patch) | |
tree | 8d4d6bbdcf75641e9946ea1bc04e42416d9ac3f5 /engines/sky/compact.cpp | |
parent | c0ca592d54813eab02deb3fbb6303f1db4559a3e (diff) | |
download | scummvm-rg350-2edec11986c504e022e8f3e43e6259ad496c4f0f.tar.gz scummvm-rg350-2edec11986c504e022e8f3e43e6259ad496c4f0f.tar.bz2 scummvm-rg350-2edec11986c504e022e8f3e43e6259ad496c4f0f.zip |
improved debugger a bit
svn-id: r26334
Diffstat (limited to 'engines/sky/compact.cpp')
-rw-r--r-- | engines/sky/compact.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index c431e1b37f..c3ba425c37 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -27,6 +27,8 @@ #include "sky/compact.h" #include "gui/message.h" +extern int gDebugLevel; + namespace Sky { #define SKY_CPT_SIZE 419427 @@ -263,6 +265,11 @@ Compact *SkyCompact::fetchCpt(uint16 cptId) { if (cptId == 0xFFFF) // is this really still necessary? return NULL; assert(((cptId >> 12) < _numDataLists) && ((cptId & 0xFFF) < _dataListLen[cptId >> 12])); + + if (gDebugLevel >= 8) { + debug(8, "Loading Compact %s [%s] (%04=%d,%d)", _cptNames[cptId >> 12][cptId & 0xFFF], nameForType(_cptTypes[cptId >> 12][cptId & 0xFFF]), cptId >> 12, cptId & 0xFFF); + } + return _compacts[cptId >> 12][cptId & 0xFFF]; } @@ -281,6 +288,13 @@ Compact *SkyCompact::fetchCptInfo(uint16 cptId, uint16 *elems, uint16 *type, cha return fetchCpt(cptId); } +const char *SkyCompact::nameForType(uint16 type) { + if (type >= NUM_CPT_TYPES) + return "unknown"; + else + return _typeNames[type]; +} + uint16 *SkyCompact::getSub(Compact *cpt, uint16 mode) { switch (mode) { case 0: @@ -458,4 +472,15 @@ uint16 SkyCompact::giveDataListLen(uint16 listNum) { return _dataListLen[listNum]; } +const char *SkyCompact::_typeNames[NUM_CPT_TYPES] = { + "null", + "COMPACT", + "TURNTABLE", + "ANIM SEQ", + "UNKNOWN", + "GETTOTABLE", + "AR BUFFER", + "MAIN LIST" +}; + } // End of namespace Sky |