Skip to content

Commit

Permalink
PRINCE: German special letters fix in intro - printAt function
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslw committed Jun 22, 2014
1 parent db19f92 commit 9e94888
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engines/prince/option_text.h
Expand Up @@ -45,7 +45,7 @@ const char optionsTextPL[7][18] = {
// + special letter values changing (with U2 negation)
// Normal value: 196, 214, 220, 223, 228, 246, 252
// Prince change: 131, 132, 133, 127, 128, 129, 130
// U2 neg: -125, -124, -123, 127, 128, -127, -126
// U2 neg: -125, -124, -123, 127, -128, -127, -126

char invOptionsTextDE[5][17] = {
"Anschauen",
Expand Down
35 changes: 34 additions & 1 deletion engines/prince/prince.cpp
Expand Up @@ -758,8 +758,41 @@ void PrinceEngine::printAt(uint32 slot, uint8 color, const char *s, uint16 x, ui

debugC(1, DebugChannel::kEngine, "PrinceEngine::printAt slot %d, color %d, x %02d, y %02d, str %s", slot, color, x, y, s);

char *destStr = (char *)malloc(strlen(s));
strcpy(destStr, s);
char *strPointer = destStr;

if (getLanguage() == Common::DE_DEU) {
while (*strPointer) {
switch(*strPointer) {
case -60:
*strPointer = -125;
break;
case -42:
*strPointer = -124;
break;
case -36:
*strPointer = -123;
break;
case -33:
*strPointer = 127;
break;
case -28:
*strPointer = -128;
break;
case -10:
*strPointer = -127;
break;
case -4:
*strPointer = -126;
break;
}
strPointer++;
}
}

Text &text = _textSlots[slot];
text._str = s;
text._str = destStr;
text._x = x;
text._y = y;
text._color = color;
Expand Down

0 comments on commit 9e94888

Please sign in to comment.