From 2edec11986c504e022e8f3e43e6259ad496c4f0f Mon Sep 17 00:00:00 2001 From: Robert Göffringmann Date: Sun, 1 Apr 2007 00:00:28 +0000 Subject: improved debugger a bit svn-id: r26334 --- engines/sky/compact.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'engines/sky/compact.cpp') 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 -- cgit v1.2.3