diff options
Diffstat (limited to 'engines/touche')
-rw-r--r-- | engines/touche/graphics.cpp | 5 | ||||
-rw-r--r-- | engines/touche/graphics.h | 2 | ||||
-rw-r--r-- | engines/touche/staticres.cpp | 5 | ||||
-rw-r--r-- | engines/touche/touche.cpp | 9 | ||||
-rw-r--r-- | engines/touche/touche.h | 7 |
5 files changed, 19 insertions, 9 deletions
diff --git a/engines/touche/graphics.cpp b/engines/touche/graphics.cpp index 999aa8005c..ab711beba0 100644 --- a/engines/touche/graphics.cpp +++ b/engines/touche/graphics.cpp @@ -76,10 +76,13 @@ int Graphics::getCharWidth16(uint8 chr) { return chrData[2]; } -void Graphics::drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str) { +void Graphics::drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str, int xmax) { while (*str) { uint8 chr = (uint8)*str++; x += drawChar16(dst, dstPitch, chr, x, y, color); + if (xmax != 0 && x > xmax) { + break; + } } } diff --git a/engines/touche/graphics.h b/engines/touche/graphics.h index 6b4072d896..9c928f983c 100644 --- a/engines/touche/graphics.h +++ b/engines/touche/graphics.h @@ -40,7 +40,7 @@ public: static void setupFont(Common::Language language); static int getStringWidth16(const char *str); static int getCharWidth16(uint8 chr); - static void drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str); + static void drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str, int xmax = 0); static int drawChar16(uint8 *dst, int dstPitch, uint8 chr, int x, int y, uint16 color); static void fillRect(uint8 *dst, int dstPitch, int x, int y, int w, int h, uint8 color); static void drawRect(uint8 *dst, int dstPitch, int x, int y, int w, int h, uint8 color1, uint8 color2); diff --git a/engines/touche/staticres.cpp b/engines/touche/staticres.cpp index ec9a0ea903..a377a6e45f 100644 --- a/engines/touche/staticres.cpp +++ b/engines/touche/staticres.cpp @@ -889,6 +889,7 @@ const uint8 Graphics::_freGerFontData[] = { 0xC0, 0x00, 0x00, }; +// spanish charset differs from original executable, see tracker item #2040311. const uint16 Graphics::_spaFontOffs[] = { 0x0000, 0x0007, 0x0024, 0x0043, 0x0072, 0x00AD, 0x00E0, 0x0113, 0x0124, 0x0141, 0x015E, 0x0191, 0x01C4, 0x01E3, 0x01F8, 0x0215, 0x0232, 0x0269, 0x0286, 0x02BD, @@ -904,11 +905,11 @@ const uint16 Graphics::_spaFontOffs[] = { 0x1462, 0x1499, 0x14A4, 0x14DB, 0x1512, 0x1549, 0x1580, 0x15B7, 0x15EE, 0x1625, 0x165C, 0x1667, 0x169E, 0x16D5, 0x16E0, 0x16EB, 0x1722, 0x172D, 0x1738, 0x176F, 0x178C, 0x17C3, 0x17FA, 0x1831, 0x1868, 0x1873, 0x187E, 0x18B5, 0x18C0, 0x18CB, - 0x18D6, 0x18E1, 0x18FE, 0x1929, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x18D6, 0x18E1, 0x18FE, 0x1929, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x054B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0703, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1954 }; diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index ac8e8a786a..a39517fe32 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -1248,10 +1248,11 @@ int ToucheEngine::getStringWidth(int num) const { return Graphics::getStringWidth16(str); } -void ToucheEngine::drawString(uint16 color, int x, int y, int16 num) { +void ToucheEngine::drawString(uint16 color, int x, int y, int16 num, StringType strType) { + const int xmax = (_language == Common::ES_ESP && strType == kStringTypeConversation) ? kScreenWidth - 20 : 0; if (num) { const char *str = getString(num); - Graphics::drawString16(_offscreenBuffer, kScreenWidth, color, x, y, str); + Graphics::drawString16(_offscreenBuffer, kScreenWidth, color, x, y, str, xmax); } } @@ -2414,7 +2415,7 @@ void ToucheEngine::drawCharacterConversation() { } drawConversationPanel(); for (int i = 0; i < 4; ++i) { - drawString(214, 42, 328 + i * kTextHeight, _conversationChoicesTable[_scrollConversationChoiceOffset + i].msg); + drawString(214, 42, 328 + i * kTextHeight, _conversationChoicesTable[_scrollConversationChoiceOffset + i].msg, kStringTypeConversation); } updateScreenArea(0, 320, kScreenWidth, kScreenHeight - 320); _conversationAreaCleared = false; @@ -2422,7 +2423,7 @@ void ToucheEngine::drawCharacterConversation() { void ToucheEngine::drawConversationString(int num, uint16 color) { const int y = 328 + num * kTextHeight; - drawString(color, 42, y, _conversationChoicesTable[num + _scrollConversationChoiceOffset].msg); + drawString(color, 42, y, _conversationChoicesTable[num + _scrollConversationChoiceOffset].msg, kStringTypeConversation); updateScreenArea(0, y, kScreenWidth, kTextHeight); } diff --git a/engines/touche/touche.h b/engines/touche/touche.h index c1bc12655f..41f5c832c5 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -331,6 +331,11 @@ enum { kMaxSaveStates = 100 }; +enum StringType { + kStringTypeDefault, + kStringTypeConversation +}; + class MidiPlayer; class ToucheEngine: public Engine { @@ -399,7 +404,7 @@ protected: void setKeyCharMoney(); const char *getString(int num) const; int getStringWidth(int num) const; - void drawString(uint16 color, int x, int y, int16 num); + void drawString(uint16 color, int x, int y, int16 num, StringType strType = kStringTypeDefault); void drawGameString(uint16 color, int x1, int y, const char *str); int restartKeyCharScriptOnAction(int action, int obj1, int obj2); void buildSpriteScalingTable(int z1, int z2); |