diff options
author | lukaslw | 2014-08-02 17:22:47 +0200 |
---|---|---|
committer | lukaslw | 2014-08-02 17:22:47 +0200 |
commit | 161f21352f7a0f35562e9955373aa04b8cfb16a4 (patch) | |
tree | 92186cf25a652e9d4a34e4adf08886a0419b2ce2 | |
parent | b761953bd3bdd499f97dfbe8d12e05f045e18eaf (diff) | |
download | scummvm-rg350-161f21352f7a0f35562e9955373aa04b8cfb16a4.tar.gz scummvm-rg350-161f21352f7a0f35562e9955373aa04b8cfb16a4.tar.bz2 scummvm-rg350-161f21352f7a0f35562e9955373aa04b8cfb16a4.zip |
PRINCE: German texts drawing - update
-rw-r--r-- | engines/prince/prince.cpp | 70 | ||||
-rw-r--r-- | engines/prince/prince.h | 1 |
2 files changed, 40 insertions, 31 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index a47542e240..a6a664cac6 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -1032,40 +1032,10 @@ int PrinceEngine::checkMob(Graphics::Surface *screen, Common::Array<Mob> &mobLis } void PrinceEngine::printAt(uint32 slot, uint8 color, char *s, uint16 x, uint16 y) { - debugC(1, DebugChannel::kEngine, "PrinceEngine::printAt slot %d, color %d, x %02d, y %02d, str %s", slot, color, x, y, s); - - char *strPointer = s; - if (getLanguage() == Common::DE_DEU) { - while (*strPointer) { - switch (*strPointer) { - case '\xc4': - *strPointer = '\x83'; - break; - case '\xd6': - *strPointer = '\x84'; - break; - case '\xdc': - *strPointer = '\x85'; - break; - case '\xdf': - *strPointer = '\x7f'; - break; - case '\xe4': - *strPointer = '\x80'; - break; - case '\xf6': - *strPointer = '\x81'; - break; - case '\xfc': - *strPointer = '\x82'; - break; - } - strPointer++; - } + correctStringDEU(s); } - Text &text = _textSlots[slot]; text._str = s; text._x = x; @@ -1090,6 +1060,35 @@ int PrinceEngine::calcTextTime(int numberOfLines) { return numberOfLines * 30; } +void PrinceEngine::correctStringDEU(char *s) { + while (*s) { + switch (*s) { + case '\xc4': + *s = '\x83'; + break; + case '\xd6': + *s = '\x84'; + break; + case '\xdc': + *s = '\x85'; + break; + case '\xdf': + *s = '\x7f'; + break; + case '\xe4': + *s = '\x80'; + break; + case '\xf6': + *s = '\x81'; + break; + case '\xfc': + *s = '\x82'; + break; + } + s++; + } +} + uint32 PrinceEngine::getTextWidth(const char *s) { uint16 textW = 0; while (*s) { @@ -2681,6 +2680,9 @@ void PrinceEngine::runDialog() { int actualColor = _dialogColor1; if (!(dialogDataValue & (1 << sentenceNumber))) { + if (getLanguage() == Common::DE_DEU) { + correctStringDEU((char *)dialogText); + } Common::Array<Common::String> lines; _font->wordWrapText((const char *)dialogText, _graph->_frontScreen->w, lines); @@ -2776,6 +2778,9 @@ void PrinceEngine::talkHero(int slot) { text._y = _secondHero->_middleY - _secondHero->_scaledFrameYSize; } text._time = time; + if (getLanguage() == Common::DE_DEU) { + correctStringDEU((char *)_interpreter->getString()); + } text._str = (const char *)_interpreter->getString(); _interpreter->increaseString(); } @@ -2813,6 +2818,9 @@ void PrinceEngine::doTalkAnim(int animNumber, int slot, AnimType animType) { error("doTalkAnim() - wrong animType: %d", animType); } text._time = time; + if (getLanguage() == Common::DE_DEU) { + correctStringDEU((char *)_interpreter->getString()); + } text._str = (const char *)_interpreter->getString(); _interpreter->increaseString(); } diff --git a/engines/prince/prince.h b/engines/prince/prince.h index 13405a6347..fbd71a2316 100644 --- a/engines/prince/prince.h +++ b/engines/prince/prince.h @@ -302,6 +302,7 @@ public: void printAt(uint32 slot, uint8 color, char *s, uint16 x, uint16 y); int calcTextLines(const char *s); int calcTextTime(int numberOfLines); + void correctStringDEU(char *s); static const uint8 kMaxTexts = 32; Text _textSlots[kMaxTexts]; |