[Scummvm-git-logs] scummvm master -> 1b40a6c9323c2d970efd062f1d72301cff672e96
AndywinXp
noreply at scummvm.org
Mon Nov 13 09:18:00 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1b40a6c932 SCUMM: MI1 (SegaCD Jap): Fix remaining text rendering issues
Commit: 1b40a6c9323c2d970efd062f1d72301cff672e96
https://github.com/scummvm/scummvm/commit/1b40a6c9323c2d970efd062f1d72301cff672e96
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-11-13T10:17:55+01:00
Commit Message:
SCUMM: MI1 (SegaCD Jap): Fix remaining text rendering issues
These include:
- Stray "-" characters (actually, "_") in dialogues
- Graphical glitches when scrolling dialog choices horizontally
With this commit we finally close issue #10447
Changed paths:
engines/scumm/charset.cpp
engines/scumm/scumm.h
engines/scumm/verbs.cpp
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 53e46a873fb..6648ea3bd3b 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -1056,7 +1056,8 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
// an additional '_' character where it should be drawn.
// This, of course, disables the text cursor when writing a savegame name, but that's in the
// original as well.
- if (_vm->_isIndy4Jap && chr == '_')
+ if ((_vm->_isIndy4Jap || (_vm->_game.platform == Common::kPlatformSegaCD && _vm->_language == Common::JA_JPN)) &&
+ chr == '_')
return;
translateColor();
@@ -1112,7 +1113,18 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
int drawTop = _top - vs->topline;
- _vm->markRectAsDirty(vs->number, _left, _left + _width, drawTop, drawTop + _height);
+ // Clip the dialog choices to a rectangle starting 35 pixels from the left
+ // for Japanese Monkey Island 1 SegaCD. _scummVars[451] is set by script 187,
+ // responsible for handling the dialog horizontal scrolling.
+ bool isSegaCDDialogChoice = _vm->_game.platform == Common::kPlatformSegaCD &&
+ _vm->_language == Common::JA_JPN && vs->number == kVerbVirtScreen && _vm->_scummVars[451] == 1;
+ if (isSegaCDDialogChoice && _left < 35) {
+ _left += _origWidth;
+ return;
+ } else {
+ _vm->markRectAsDirty(vs->number, _left, _left + _width, drawTop, drawTop + _height);
+ }
+
// This check for kPlatformFMTowns and kMainVirtScreen is at least required for the chat with
// the navigator's head in front of the ghost ship in Monkey Island 1
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index d1fb70539fc..1f22ee8d200 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -519,6 +519,7 @@ extern const char *const insaneKeymapId;
class ScummEngine : public Engine, public Common::Serializable {
friend class ScummDebugger;
friend class CharsetRenderer;
+ friend class CharsetRendererClassic;
friend class CharsetRendererTownsClassic;
friend class ResourceManager;
friend class MacIndy3Gui;
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index f40ec1ca7f7..55f868735a6 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -1050,7 +1050,7 @@ void ScummEngine_v7::drawVerb(int verb, int mode) {
// Compute the text rect
vs->curRect = _textV7->calcStringDimensions((const char*)msg, xpos, vs->curRect.top, flags);
-
+
const int maxWidth = _screenWidth - vs->curRect.left;
int finalWidth = maxWidth;
@@ -1073,7 +1073,7 @@ void ScummEngine_v7::drawVerb(int verb, int mode) {
enqueueText(tmpBuf, xpos, ypos, color, vs->charset_nr, flags);
enqueueText(&msg[len + 1], xpos, ypos + _verbLineSpacing, color, vs->charset_nr, flags);
vs->curRect.right = vs->curRect.left + finalWidth;
- vs->curRect.bottom += _verbLineSpacing;
+ vs->curRect.bottom += _verbLineSpacing;
} else {
enqueueText(msg, xpos, ypos, color, vs->charset_nr, flags);
}
@@ -1158,6 +1158,14 @@ void ScummEngine::restoreVerbBG(int verb) {
vs->bkcolor;
if (vs->oldRect.left != -1) {
+ // Clip the dialog choices to a rectangle starting 35 pixels from the left
+ // for Japanese Monkey Island 1 SegaCD. _scummVars[451] is set by script 187,
+ // responsible for handling the dialog horizontal scrolling.
+ bool isSegaCDDialogChoice = _game.platform == Common::kPlatformSegaCD &&
+ _language == Common::JA_JPN && _scummVars[451] == 1;
+ if (isSegaCDDialogChoice && vs->oldRect.left < 35)
+ vs->oldRect.left = 35;
+
restoreBackground(vs->oldRect, col);
vs->oldRect.left = -1;
}
More information about the Scummvm-git-logs
mailing list