From 6fed44298e38c672789ac3b2e42d254dd5a6ee62 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 4 Feb 2012 14:11:20 +0100 Subject: TOUCHE: Add charset debug channel This is intended to help debug the missing Spanish characters reported in #2040311 and #3483383. --- engines/touche/touche.cpp | 8 ++++++++ engines/touche/touche.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'engines/touche') diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 81d6adf581..4b989963f6 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -81,6 +81,7 @@ ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) DebugMan.addDebugChannel(kDebugResource, "Resource", "Resource debug level"); DebugMan.addDebugChannel(kDebugOpcodes, "Opcodes", "Opcodes debug level"); DebugMan.addDebugChannel(kDebugMenu, "Menu", "Menu debug level"); + DebugMan.addDebugChannel(kDebugCharset, "Charset", "Charset debug level"); _console = new ToucheConsole(this); } @@ -1260,6 +1261,13 @@ const char *ToucheEngine::getString(int num) const { int ToucheEngine::getStringWidth(int num) const { const char *str = getString(num); + if (DebugMan.isDebugChannelEnabled(kDebugCharset)) { + debug("stringwidth: %s", str); + debugN("raw:"); + const char *p = str; + while (*p) debugN(" %02X", (unsigned char)*p++); + debugN("\n"); + } return Graphics::getStringWidth16(str); } diff --git a/engines/touche/touche.h b/engines/touche/touche.h index cbb3fec7aa..949727b665 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -277,7 +277,8 @@ enum { kDebugGraphics = 1 << 1, kDebugResource = 1 << 2, kDebugOpcodes = 1 << 3, - kDebugMenu = 1 << 4 + kDebugMenu = 1 << 4, + kDebugCharset = 1 << 5 }; enum ResourceType { -- cgit v1.2.3