From 8bcdaa6e455fd164f5fa3b8e230251eea7456016 Mon Sep 17 00:00:00 2001 From: BLooperZ Date: Sat, 17 Aug 2019 20:28:57 +0300 Subject: SCUMM: minimize changes required for rtl --- engines/scumm/smush/smush_font.cpp | 25 +++++++++++-------------- engines/scumm/string.cpp | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/engines/scumm/smush/smush_font.cpp b/engines/scumm/smush/smush_font.cpp index bad1b02d37..de9a183bce 100644 --- a/engines/scumm/smush/smush_font.cpp +++ b/engines/scumm/smush/smush_font.cpp @@ -191,16 +191,19 @@ void SmushFont::drawSubstring(const char *str, byte *buffer, int dst_width, int // to have to check for it. if (x < 0) x = 0; - - //for (int i = 0; str[i] != 0; i++) { - int len = strlen(str); - for (int i = len; i >= 0; i--) { - if ((byte)str[i] >= 0x80 && _vm->_useCJKMode) { - x += draw2byte(buffer, dst_width, x, y, (byte)str[i] + 256 * (byte)str[i+1]); - i++; - } else + if (_vm->_language == Common::HE_ISR || true) { + for (int i = strlen(str); i >= 0; i--) { x += drawChar(buffer, dst_width, x, y, str[i]); + } + } else { + for (int i = 0; str[i] != 0; i++) { + if ((byte)str[i] >= 0x80 && _vm->_useCJKMode) { + x += draw2byte(buffer, dst_width, x, y, (byte)str[i] + 256 * (byte)str[i+1]); + i++; + } else + x += drawChar(buffer, dst_width, x, y, str[i]); + } } } @@ -210,12 +213,6 @@ void SmushFont::drawSubstring(const char *str, byte *buffer, int dst_width, int void SmushFont::drawString(const char *str, byte *buffer, int dst_width, int dst_height, int x, int y, bool center) { debugC(DEBUG_SMUSH, "SmushFont::drawString(%s, %d, %d, %d)", str, x, y, center); - - //char rev[384] = {0}; - //int len = strlen(str); - //for (int l = 0; l < len; l++) { - // rev[l] = str[len - l - 1]; - //} while (str) { char line[256]; const char *pos = strchr(str, '\n'); diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index f50bcac697..8db9cd6da4 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -1265,7 +1265,7 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) } else { src = msg; } - + num = 0; while (1) { -- cgit v1.2.3