aboutsummaryrefslogtreecommitdiff
path: root/scumm/string.cpp
diff options
context:
space:
mode:
authorPaweł Kołodziejski2003-03-12 19:53:02 +0000
committerPaweł Kołodziejski2003-03-12 19:53:02 +0000
commitcdb699fa43845d392bbbc204eddd8269f5bd498e (patch)
treedd1766dedd70f5539f7fe1e8d4d41e12729a9dea /scumm/string.cpp
parent31c94024dc97126ba88c2e6682c2eb9e10519821 (diff)
downloadscummvm-rg350-cdb699fa43845d392bbbc204eddd8269f5bd498e.tar.gz
scummvm-rg350-cdb699fa43845d392bbbc204eddd8269f5bd498e.tar.bz2
scummvm-rg350-cdb699fa43845d392bbbc204eddd8269f5bd498e.zip
separated comi/dig translation stuff
svn-id: r6801
Diffstat (limited to 'scumm/string.cpp')
-rw-r--r--scumm/string.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/scumm/string.cpp b/scumm/string.cpp
index dff12acf82..824d6b1d4f 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -842,15 +842,12 @@ void Scumm::loadLanguageBundle() {
}
void Scumm::translateText(byte *text, byte *trans_buff) {
- if ((_existLanguageFile == true) && (text[0] == '/')) {
- char name[20], tmp[500], tmp2[20], num_s[20], number[4];
- int32 num, l, j, k, r, pos;
- char enc;
+ char name[20], tmp[500], tmp2[20], num_s[20], number[4], enc;
+ int32 num, l, j, k, r, pos = 0;
+ char *buf = _languageBuffer;
- char *buf = _languageBuffer;
- pos = 0;
-
- if (_gameId == GID_CMI) {
+ if (_gameId == GID_CMI) {
+ if ((text[0] == '/') && (_existLanguageFile == true)) {
struct langIndexNode target;
struct langIndexNode *found;
@@ -880,11 +877,20 @@ void Scumm::translateText(byte *text, byte *trans_buff) {
}
file.close();
return;
+ } else {
+ // Some evil person removed the language file?
+ _existLanguageFile = false;
}
- // Some evil person removed the language file?
- _existLanguageFile = false;
}
- } else if (_gameId == GID_DIG) {
+ }
+ byte *pointer = (byte *)strchr((char *)text + 1, '/');
+ if (pointer != NULL) {
+ pointer++;
+ memcpy(trans_buff, pointer, resStrLen(pointer) + 1);
+ return;
+ }
+ } else if (_gameId == GID_DIG) {
+ if ((text[0] == '/') && (_existLanguageFile == true)) {
// copy name from text /..../
for (l = 0; (l < 20) && (text[l + 1] != '.'); l++) {
name[l] = text[l + 1];
@@ -968,23 +974,17 @@ void Scumm::translateText(byte *text, byte *trans_buff) {
}
}
}
- }
-
- if (text[0] == '/') {
byte *pointer = (byte *)strchr((char *)text + 1, '/');
if (pointer != NULL) {
pointer++;
- int l = 0;
+ l = 0;
while (*pointer != '/' && *pointer != 0xff && *pointer != 0) {
trans_buff[l++] = *pointer++;
}
trans_buff[l] = '\0';
+ return;
}
- else
- trans_buff[0] = '\0';
- return;
}
-
memcpy(trans_buff, text, resStrLen(text) + 1);
}