From 9e94888fa288ef9a4388eb13c118d0b7ac0ada2c Mon Sep 17 00:00:00 2001 From: lukaslw Date: Sat, 14 Jun 2014 16:29:49 +0200 Subject: [PATCH] PRINCE: German special letters fix in intro - printAt function --- engines/prince/option_text.h | 2 +- engines/prince/prince.cpp | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/engines/prince/option_text.h b/engines/prince/option_text.h index ac5d7588b391..55fc23770e31 100644 --- a/engines/prince/option_text.h +++ b/engines/prince/option_text.h @@ -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", diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 0f52e97e8020..95f006881110 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -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;