diff options
| author | Christopher Page | 2008-08-09 19:03:29 +0000 |
|---|---|---|
| committer | Christopher Page | 2008-08-09 19:03:29 +0000 |
| commit | ce3d1e1a7d9ec9860d3fc42d8127a1634051d950 (patch) | |
| tree | fbf6c9a71e7e4bdb90d502755d282c183562e93b /engines/touche | |
| parent | f41471d34bb6afb1dc0b6604b1952d10ef583765 (diff) | |
| parent | 71f4a15e4efebf4de7a25d2b09817cf3a5aa51b5 (diff) | |
| download | scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.tar.gz scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.tar.bz2 scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.zip | |
Merged revisions 33632-33633,33635,33637,33639-33640,33642-33645,33648,33654-33655,33664,33667-33670,33673-33674,33678,33682,33686-33691,33693,33696,33698,33700,33703,33708,33710,33712-33714,33716 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
svn-id: r33720
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 a7a362f2b1..d1d7528517 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -1256,10 +1256,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); } } @@ -2422,7 +2423,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; @@ -2430,7 +2431,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 90ab9933bd..f341769422 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -333,6 +333,11 @@ enum { kCurrentGameStateVersion = 6 // for --list-saves support }; +enum StringType { + kStringTypeDefault, + kStringTypeConversation +}; + class MidiPlayer; class ToucheEngine: public Engine { @@ -402,7 +407,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); |
