diff options
author | Colin Snover | 2016-12-17 18:50:23 -0600 |
---|---|---|
committer | Colin Snover | 2016-12-17 18:55:22 -0600 |
commit | 07919b79baca911dcda4708406f5dee85d22b655 (patch) | |
tree | c3c84f3fa32a6d597630ad77a637a1de1291fd5c /engines/sci | |
parent | 7e9ae90abd094fc836e7d9c9497eaa6ec138b7b0 (diff) | |
download | scummvm-rg350-07919b79baca911dcda4708406f5dee85d22b655.tar.gz scummvm-rg350-07919b79baca911dcda4708406f5dee85d22b655.tar.bz2 scummvm-rg350-07919b79baca911dcda4708406f5dee85d22b655.zip |
SCI32: Improve SciBitmap segment table debugging output
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/console.cpp | 20 | ||||
-rw-r--r-- | engines/sci/engine/segment.h | 10 |
2 files changed, 21 insertions, 9 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index cfbc2f3a34..63a1f0c2ec 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -2216,9 +2216,17 @@ bool Console::segmentInfo(int nr) { case SEG_TYPE_ARRAY: debugPrintf("SCI32 arrays\n"); break; - case SEG_TYPE_BITMAP: - debugPrintf("SCI32 bitmaps\n"); + + case SEG_TYPE_BITMAP: { + BitmapTable &table = *(BitmapTable *)mobj; + debugPrintf("SCI32 bitmaps (total %d)\n", table.entries_used); + for (uint i = 0; i < table.size(); ++i) { + if (table.isValidEntry(i)) { + debugPrintf(" [%04x] %s", i, table[i].toString().c_str()); + } + } break; + } #endif default : @@ -4663,13 +4671,7 @@ void Console::printBitmap(reg_t reg) { const SciBitmap &bitmap = table->at(reg.getOffset()); - debugPrintf("SCI32 bitmap (%dx%d; res %dx%d; origin %dx%d; skip color %u; %s; %s):\n", - bitmap.getWidth(), bitmap.getHeight(), - bitmap.getXResolution(), bitmap.getYResolution(), - bitmap.getOrigin().x, bitmap.getOrigin().y, - bitmap.getSkipColor(), - bitmap.getRemap() ? "remap" : "no remap", - bitmap.getShouldGC() ? "GC" : "no GC"); + debugPrintf("SCI32 bitmap (%s):\n", bitmap.toString().c_str()); Common::hexdump((const byte *) bitmap.getRawData(), bitmap.getRawSize(), 16, 0); } diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h index e8f0be3a79..7c415f3bb3 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -1136,6 +1136,16 @@ public: *pixel++ = (uint8)color; } } + + Common::String toString() const { + return Common::String::format("%dx%d; res %dx%d; origin %dx%d; skip color %u; %s; %s):\n", + getWidth(), getHeight(), + getXResolution(), getYResolution(), + getOrigin().x, getOrigin().y, + getSkipColor(), + getRemap() ? "remap" : "no remap", + getShouldGC() ? "GC" : "no GC"); + } }; struct BitmapTable : public SegmentObjTable<SciBitmap> { |