aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/string.cpp
diff options
context:
space:
mode:
authorניב באר2018-09-03 22:29:19 +0300
committerEugene Sandulenko2020-01-01 00:31:21 +0100
commit72471ec431c76f6aee63ef67cf4fd475f942ac47 (patch)
tree3b7a078b2f7da96bc9af7c797a06dccef0e79fcc /engines/scumm/string.cpp
parentc05b911563a8016c4e978dabd4715403febe3648 (diff)
downloadscummvm-rg350-72471ec431c76f6aee63ef67cf4fd475f942ac47.tar.gz
scummvm-rg350-72471ec431c76f6aee63ef67cf4fd475f942ac47.tar.bz2
scummvm-rg350-72471ec431c76f6aee63ef67cf4fd475f942ac47.zip
SCUMM: rtl support for scumm-7-8
Diffstat (limited to 'engines/scumm/string.cpp')
-rw-r--r--engines/scumm/string.cpp43
1 files changed, 40 insertions, 3 deletions
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 421c72b21d..112f4127cc 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -237,8 +237,10 @@ void ScummEngine_v7::addSubtitleToQueue(const byte *text, const Common::Point &p
assert(_subtitleQueuePos < ARRAYSIZE(_subtitleQueue));
SubtitleText *st = &_subtitleQueue[_subtitleQueuePos];
int i = 0;
+
+ int len = strlen((const char *)text);
while (1) {
- st->text[i] = text[i];
+ st->text[i] = text[len - i - 1];
if (!text[i])
break;
++i;
@@ -1247,7 +1249,20 @@ int ScummEngine::convertNameMessage(byte *dst, int dstSize, int var) {
if (num) {
const byte *ptr = getObjOrActorName(num);
if (ptr) {
- return convertMessageToString(ptr, dst, dstSize);
+ int retval = convertMessageToString(ptr, dst, dstSize);
+
+ if (_game.version >= 7 && (_language == Common::HE_ISR || true)) {
+ byte rev[384] = {0};
+ int lens = strlen((const char *)dst);
+
+ for (int l = 0; l < lens; l++) {
+ rev[l] = dst[lens - l - 1];
+ }
+ rev[lens] = '\0';
+ strcpy((char *)dst, (const char *)rev);
+ }
+
+ return retval;
}
}
return 0;
@@ -1275,7 +1290,19 @@ int ScummEngine::convertStringMessage(byte *dst, int dstSize, int var) {
if (var) {
ptr = getStringAddress(var);
if (ptr) {
- return convertMessageToString(ptr, dst, dstSize);
+ int retval = convertMessageToString(ptr, dst, dstSize);
+
+ if (_game.version >= 7 && (_language == Common::HE_ISR || true)) {
+ byte rev[384] = {0};
+ int lens = strlen((const char *)dst);
+
+ for (int l = 0; l < lens; l++) {
+ rev[l] = dst[lens - l - 1];
+ }
+ rev[lens] = '\0';
+ strcpy((char *)dst, (const char *)rev);
+ }
+ return retval;
}
}
return 0;
@@ -1575,6 +1602,16 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
}
if (found != NULL) {
+ //char rev[384] = {0};
+ //strcpy(rev, _languageBuffer + found->offset);
+ //int len = strlen(rev);
+ //for (int l = 0; l < len; l++) {
+ // trans_buff[l] = rev[len - l - 1];
+ //}
+ //trans_buff[len] = '\0';
+
+ // OR
+
strcpy((char *)trans_buff, _languageBuffer + found->offset);
if ((_game.id == GID_DIG) && !(_game.features & GF_DEMO)) {