From c451ae639f12fbe77dfde97743037aec72b3199a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 4 Aug 2011 12:33:26 +0100 Subject: [PATCH] SCUMM: Proper fix of Russian subtitles Initial fix in 11a17b3 (r51211) led to chopped inventory items. No idea why it does not work with our code, as it seems to match the disassembly. Thus implementing this hackish workaround. --- engines/scumm/string.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 2d2209c1550..61bb89328d4 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -1127,8 +1127,6 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) } num += (_game.version == 8) ? 4 : 2; } - } else if (_game.id == GID_DIG && (chr == 1 || chr == 2 || chr == 3 || chr == 8)) { - // Skip these characters } else { if ((chr != '@') || (_game.id == GID_CMI && _language == Common::ZH_TWN) || (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine && _language == Common::JA_JPN) || @@ -1142,6 +1140,14 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) if (dst >= end) error("convertMessageToString: buffer overflow"); } + + // WORKAROUND: Russian The Dig pads messages with 03. No idea why + // it does not work as is with our rendering code, thus fixing it + // with a workaround. + if (_game.id == GID_DIG) { + while (*(dst - 1) == 0x03) + dst--; + } *dst = 0; return dstSize - (end - dst);