From ebb49d5cfe23f9e20a8b88baf2f91fedd791b9df Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 30 Mar 2005 17:30:47 +0000 Subject: In V7/V8 games, just always call translateText, it'll check for the '/' prefix anyway (this allows us to perform additional magic in it, should we need to, e.g. to fix bug #1172655) svn-id: r17297 --- scumm/script_v8.cpp | 7 ++----- scumm/string.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 910a72201d..695e94700d 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1483,11 +1483,8 @@ void ScummEngine_v8::o8_getStringWidth() { // Skip to the next instruction _scriptPointer += resStrLen(_scriptPointer) + 1; - if (msg[0] == '/') { - translateText(msg, transBuf); - msg = transBuf; - } - + translateText(msg, transBuf); + msg = transBuf; // Temporary set the specified charset id _charset->setCurID(_string[charset].charset); diff --git a/scumm/string.cpp b/scumm/string.cpp index 3e1a3b05e3..427310eeb0 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -569,7 +569,7 @@ int ScummEngine::addMessageToStack(const byte *msg, byte *dst, int dstSize) { return 0; } - if (_version >= 7 && msg[0] == '/') { + if (_version >= 7) { translateText(msg, transBuf); src = transBuf; } else { @@ -649,7 +649,7 @@ int ScummEngine::addMessageToStack(const byte *msg, byte *dst, int dstSize) { error("addMessageToStack: buffer overflow!"); } *dst = 0; - + return dstSize - (end - dst); } @@ -896,6 +896,8 @@ void ScummEngine::loadLanguageBundle() { // That was another index entry _languageIndexSize++; + } else { + error("Unknwon languag.bnd entry found: '%s'\n", ptr); } // Skip over newlines (and turn them into null bytes) @@ -955,6 +957,9 @@ void ScummEngine::translateText(const byte *text, byte *trans_buff) { LangIndexNode *found = NULL; int i; + trans_buff[0] = 0; + _lastStringTag[0] = 0; + if (_version >= 7 && text[0] == '/') { // Extract the string tag from the text: /..../ for (i = 0; (i < 12) && (text[i + 1] != '/'); i++) -- cgit v1.2.3