aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/string.cpp48
1 files changed, 37 insertions, 11 deletions
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 6f0f489e66..dee62a7823 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -434,10 +434,15 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) {
bool ScummEngine::newLine() {
_nextLeft = _string[0].xpos;
if (_charset->_center) {
+ // warning("NL CENTER");
_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
if (_nextLeft < 0)
_nextLeft = _game.version >= 6 ? _string[0].xpos : 0;
} else if (_game.version >= 4 && _game.version < 7 && (_language == Common::HE_ISR || true)) {
+ // warning("FIRST");
+ // char buffy[30];
+ // sprintf(buffy, "%d-%d", _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos), _screenWidth);
+ // warning(buffy);
_nextLeft = _screenWidth - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) - _nextLeft;
}
@@ -597,13 +602,21 @@ void ScummEngine::CHARSET_1() {
_charset->addLinebreaks(0, _charsetBuffer + _charsetBufPos, 0, maxwidth);
}
-
+ if (_game.version >= 4 && _game.version < 7 && (_language == Common::HE_ISR || true)) {
+ _nextLeft = (_screenWidth - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos)) - _nextLeft;
+ }
if (_charset->_center) {
+ // warning("CENTER");
_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
if (_nextLeft < 0)
_nextLeft = _game.version >= 6 ? _string[0].xpos : 0;
} else if (_game.version >= 4 && _game.version < 7 && (_language == Common::HE_ISR || true)) {
- _nextLeft = _screenWidth - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) - _nextLeft;
+ // warning("SECOND");
+ //_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos);
+ // char buffy[30];
+ // sprintf(buffy, "%d-%d", _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos), _screenWidth);
+ // warning(buffy);
+ // _nextLeft = _screenWidth - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) - _nextLeft;
}
_charset->_disableOffsX = _charset->_firstChar = !_keepText;
@@ -621,6 +634,16 @@ void ScummEngine::CHARSET_1() {
int start = 0;
char* text = ltext + ll;
+
+
+ for (int u = 0; u < strlen(text); u++) {
+ char buffy[30] = {0};
+ sprintf(buffy, "[%d-%c],", text[u], text[u]);
+ debugN(buffy);
+ }
+ debugN("\n");
+
+
char* current = text;
while(1) {
if (*current == 13 || *current == 0 || *current == -1 || *current == -2) {
@@ -665,6 +688,17 @@ void ScummEngine::CHARSET_1() {
}
break;
}
+
+
+ // warning("REVERSED");
+ // for (int u = 0; u < strlen(text); u++) {
+ // char buffy[30] = {0};
+ // sprintf(buffy, "[%d-%c],", text[u], text[u]);
+ // debugN(buffy);
+ // }
+ // debugN("\n\n\n\n\n");
+
+
}
while (handleNextCharsetCode(a, &c)) {
@@ -936,20 +970,12 @@ void ScummEngine::drawString(int a, const byte *msg) {
convertMessageToString(msg, buf, sizeof(buf));
- if (_game.version >= 4 && true /*TODO: IS_HEBREW*/) {
+ if (_game.version >= 4 && _game.version < 7 && (_language == Common::HE_ISR || true)) {
int ll = 0;
char* ltext = (char*)buf;
while (ltext[ll] == -1) {
ll += 4;
}
- // for (int u = 0; u < strlen(ltext + ll); u++) {
- // char buf[384] = {0};
- // sprintf(buf, "%d - %c\n", (ltext + ll)[u], (ltext + ll)[u]);
- // debugN(buf);
- // }
- // char buf[384] = {0};
- // sprintf(buf, "LL: %d", ll);
- // warning(buf);
byte fin[270] = {0};
memcpy(fin, ltext, ll);