diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/script_v8.cpp | 7 | ||||
-rw-r--r-- | 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++) |