mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 08:17:40 +00:00
added support for nonenglish the dig(dialogs, descriptions, warnings), not gui yet
svn-id: r4959
This commit is contained in:
parent
978e879009
commit
c61b824942
@ -2534,17 +2534,19 @@ void Scumm::o6_talkActor()
|
||||
_actorToPrintStrFor = pop();
|
||||
_messagePtr = _scriptPointer;
|
||||
|
||||
if (_scriptPointer[0] == '/') {
|
||||
char *pointer = strtok((char *)_scriptPointer, "/");
|
||||
int bunsize = strlen(pointer) + 2;
|
||||
if ((_gameId == GID_DIG) && (_messagePtr[0] == '/')) {
|
||||
_scriptPointer += strlen((char*)_scriptPointer) + 1;
|
||||
translateText((char*)_messagePtr, (char*)&transText);
|
||||
char *pointer = strtok((char *)_messagePtr, "/");
|
||||
_sound->playBundleSound(pointer);
|
||||
_scriptPointer += bunsize;
|
||||
_messagePtr = _scriptPointer;
|
||||
_messagePtr = (byte*)&transText;
|
||||
setStringVars(0);
|
||||
actorTalk();
|
||||
} else {
|
||||
setStringVars(0);
|
||||
actorTalk();
|
||||
_scriptPointer = _messagePtr;
|
||||
}
|
||||
|
||||
setStringVars(0);
|
||||
actorTalk();
|
||||
_scriptPointer = _messagePtr;
|
||||
}
|
||||
|
||||
void Scumm::o6_talkEgo()
|
||||
@ -2552,17 +2554,19 @@ void Scumm::o6_talkEgo()
|
||||
_actorToPrintStrFor = (unsigned char)_vars[VAR_EGO];
|
||||
_messagePtr = _scriptPointer;
|
||||
|
||||
if (_scriptPointer[0] == '/') {
|
||||
char *pointer = strtok((char *)_scriptPointer, "/");
|
||||
int bunsize = strlen(pointer) + 2;
|
||||
if ((_gameId == GID_DIG) && (_messagePtr[0] == '/')) {
|
||||
_scriptPointer += strlen((char*)_scriptPointer) + 1;
|
||||
translateText((char*)_messagePtr, (char*)&transText);
|
||||
char *pointer = strtok((char *)_messagePtr, "/");
|
||||
_sound->playBundleSound(pointer);
|
||||
_scriptPointer += bunsize;
|
||||
_messagePtr = _scriptPointer;
|
||||
_messagePtr = (byte*)&transText;
|
||||
setStringVars(0);
|
||||
actorTalk();
|
||||
} else {
|
||||
setStringVars(0);
|
||||
actorTalk();
|
||||
_scriptPointer = _messagePtr;
|
||||
}
|
||||
|
||||
setStringVars(0);
|
||||
actorTalk();
|
||||
_scriptPointer = _messagePtr;
|
||||
}
|
||||
|
||||
void Scumm::o6_dim()
|
||||
@ -2743,16 +2747,17 @@ void Scumm::o6_miscOps()
|
||||
break;
|
||||
case 16:
|
||||
if (_gameId == GID_DIG) {
|
||||
_msgPtrToAdd = charset._buffer;
|
||||
byte buf[200];
|
||||
_msgPtrToAdd = buf;
|
||||
setStringVars(0);
|
||||
addMessageToStack(getStringAddressVar(VAR_STRING2DRAW));
|
||||
i = 0;
|
||||
while (charset._buffer[i] != 0) {
|
||||
if (charset._buffer[i] == '/') {
|
||||
charset._bufPos = i + 1;
|
||||
}
|
||||
i++;
|
||||
if (strncmp("/SYSTEM.007/ /", (char*)&buf, 14) == 0) {
|
||||
translateText((char*)&buf + 13, (char*)&charset._buffer);
|
||||
description();
|
||||
} else if (strncmp("/SYSTEM.007/ ", (char*)&buf, 13) == 0) {
|
||||
strcpy((char*)&charset._buffer, (char*)&buf + 13);
|
||||
description();
|
||||
}
|
||||
description();
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
@ -3076,30 +3081,43 @@ void Scumm::decodeParseString2(int m, int n)
|
||||
case 75:{
|
||||
_messagePtr = _scriptPointer;
|
||||
|
||||
if (_scriptPointer[0] == '/') {
|
||||
char *pointer = strtok((char *)_scriptPointer, "/");
|
||||
int bunsize = strlen(pointer) + 2;
|
||||
_sound->playBundleSound(pointer);
|
||||
_scriptPointer += bunsize;
|
||||
_messagePtr = _scriptPointer;
|
||||
if ((_messagePtr[0] == '/') && (_gameId == GID_DIG)) {
|
||||
translateText((char*)_messagePtr, (char*)&transText);
|
||||
_messagePtr = (byte*)&transText;
|
||||
_scriptPointer += strlen((char*)_scriptPointer) + 1;
|
||||
switch (m) {
|
||||
case 0:
|
||||
actorTalk();
|
||||
break;
|
||||
case 1:
|
||||
drawString(1);
|
||||
break;
|
||||
case 2:
|
||||
unkMessage1();
|
||||
break;
|
||||
case 3:
|
||||
unkMessage2();
|
||||
break;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
switch (m) {
|
||||
case 0:
|
||||
actorTalk();
|
||||
break;
|
||||
case 1:
|
||||
drawString(1);
|
||||
break;
|
||||
case 2:
|
||||
unkMessage1();
|
||||
break;
|
||||
case 3:
|
||||
unkMessage2();
|
||||
break;
|
||||
}
|
||||
_scriptPointer = _messagePtr;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (m) {
|
||||
case 0:
|
||||
actorTalk();
|
||||
break;
|
||||
case 1:
|
||||
drawString(1);
|
||||
break;
|
||||
case 2:
|
||||
unkMessage1();
|
||||
break;
|
||||
case 3:
|
||||
unkMessage2();
|
||||
break;
|
||||
}
|
||||
_scriptPointer = _messagePtr;
|
||||
return;
|
||||
}
|
||||
case 0xFE:
|
||||
setStringVars(m);
|
||||
|
@ -933,6 +933,7 @@ public:
|
||||
char *_languageBuffer;
|
||||
void loadLanguageBundle();
|
||||
void translateText(char * text, char * trans_buff);
|
||||
char transText[200];
|
||||
|
||||
bool checkFixedDisk();
|
||||
int _cdrom;
|
||||
|
@ -150,6 +150,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
|
||||
_saveLoadFlag = 2;
|
||||
_saveLoadCompatible = false;
|
||||
}
|
||||
loadLanguageBundle();
|
||||
}
|
||||
|
||||
Scumm::~Scumm ()
|
||||
@ -300,7 +301,6 @@ void Scumm::scummInit()
|
||||
#endif
|
||||
|
||||
_timer->installProcedure(&autosave, 5 * 60 * 1000);
|
||||
loadLanguageBundle();
|
||||
}
|
||||
|
||||
|
||||
|
@ -474,7 +474,8 @@ void Scumm::description()
|
||||
int c;
|
||||
byte *buffer;
|
||||
|
||||
buffer = charset._buffer + charset._bufPos;
|
||||
buffer = charset._buffer;
|
||||
charset._bufPos = 0;
|
||||
string[0].ypos = camera._cur.y + 88;
|
||||
string[0].xpos = (_realWidth / 2) - (charset.getStringWidth(0, buffer, 0) >> 1);
|
||||
if (string[0].xpos < 0)
|
||||
@ -1096,7 +1097,7 @@ void Scumm::loadLanguageBundle() {
|
||||
}
|
||||
|
||||
void Scumm::translateText(char * text, char * trans_buff) {
|
||||
if ((_existLanguageFile == true) && (text[0] == '/')) {
|
||||
if ((_existLanguageFile == true) && (text[0] == '/') && (text[1] != ' ')) {
|
||||
char name[20], tmp[20], tmp2[20], num_s[20];
|
||||
int32 num, l, j, k, r, pos;
|
||||
char enc;
|
||||
@ -1176,10 +1177,14 @@ void Scumm::translateText(char * text, char * trans_buff) {
|
||||
}
|
||||
|
||||
if (text[0] == '/') {
|
||||
char *pointer = strtok((char*)text, "/");
|
||||
int offset = strlen(pointer) + 2;
|
||||
strcpy (trans_buff, text + offset);
|
||||
char *pointer = strchr((char*)text + 1, '/');
|
||||
if (pointer != NULL)
|
||||
strcpy(trans_buff, pointer + 1);
|
||||
else
|
||||
strcpy(trans_buff, "");
|
||||
|
||||
return;
|
||||
}
|
||||
strcpy (trans_buff, text);
|
||||
strcpy(trans_buff, text);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user