Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCUMM: COMI: fix hebrew multiline dialogue #2746

Merged
merged 2 commits into from Feb 4, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 15 additions & 4 deletions engines/scumm/verbs.cpp
Expand Up @@ -1013,9 +1013,6 @@ void ScummEngine_v7::drawVerb(int verb, int mode) {
_charset->setCurID(vs->charset_nr);

// Compute the text rect
if (_language == Common::HE_ISR) {
vs->curRect.left = _screenWidth - _charset->getStringWidth(0, buf);
}
vs->curRect.right = 0;
vs->curRect.bottom = 0;
const byte *msg2 = msg;
Expand Down Expand Up @@ -1046,12 +1043,26 @@ void ScummEngine_v7::drawVerb(int verb, int mode) {
}
--len;
}
if (_language == Common::HE_ISR) {
vs->curRect.right -= vs->curRect.left;
vs->curRect.left = _screenWidth - _charset->getStringWidth(0, tmpBuf);
vs->curRect.right += vs->curRect.left;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what you're doing here?

Copy link
Contributor Author

@BLooperZ BLooperZ Jan 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aligning the text to the right.
The first and third lines is replacing the old left position value with the new left position. (substract old value, add new value).

Copy link
Member

@bluegr bluegr Feb 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but you're trying to right-align the text relative to the screen. Is that intended? Does the original align the text to the left of the screen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the dialogue on SCUMM-7-8, which is aligned to the left.
altough I have checked this now again, the original version of COMI is indeed indented 5 pixels to the left (value of vs->curRect.left). (not 0 as I assumed)
ideally we would use this value to calculate
drawLeft = _screenWidth - originalLeft - _widthOfString
problem is the updated value is used for the clickable/hoverable mouse area, and it causes the new value to be received when drawing the next time, so using it make the text to jump from side to side.
the difference is (IMO) somewhat neglectable visually, though.
could be solved by making 2 _verbs arrays, but that is a change that may affect much more games.

enqueueText(tmpBuf, vs->curRect.left, vs->curRect.top, color, vs->charset_nr, vs->center);
if (len >= 0) {
enqueueText(&msg[len + 1], vs->curRect.left, vs->curRect.top + _verbLineSpacing, color, vs->charset_nr, vs->center);
int16 leftPos = vs->curRect.left;
if (_language == Common::HE_ISR) {
leftPos = _screenWidth - _charset->getStringWidth(0, &msg[len + 1]);
}
enqueueText(&msg[len + 1], leftPos, vs->curRect.top + _verbLineSpacing, color, vs->charset_nr, vs->center);
vs->curRect.bottom += _verbLineSpacing;
}
} else {
if (_language == Common::HE_ISR) {
vs->curRect.right -= vs->curRect.left;
vs->curRect.left = _screenWidth - _charset->getStringWidth(0, buf);
vs->curRect.right += vs->curRect.left;
}
enqueueText(msg, vs->curRect.left, vs->curRect.top, color, vs->charset_nr, vs->center);
}
_charset->setCurID(oldID);
Expand Down