[Scummvm-git-logs] scummvm master -> 1af3e4ef35a07733e5ea56535a5b6bc8e8e47750

athrxx athrxx at scummvm.org
Thu Dec 3 23:07:28 UTC 2020


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5fc9a43b8f SCUMM: (Smush) - cleanup text clipping
1af3e4ef35 SCUMM: (FT) - fix minor actor text positioning glitch


Commit: 5fc9a43b8f6cff3182a31417b470b7994b203fbe
    https://github.com/scummvm/scummvm/commit/5fc9a43b8f6cff3182a31417b470b7994b203fbe
Author: athrxx (athrxx at scummvm.org)
Date: 2020-12-04T00:02:28+01:00

Commit Message:
SCUMM: (Smush) - cleanup text clipping

Move left side x boundary check from drawSubString() to drawStringWrap().

Changed paths:
    engines/scumm/smush/smush_font.cpp


diff --git a/engines/scumm/smush/smush_font.cpp b/engines/scumm/smush/smush_font.cpp
index f63e8b66ae..f76e14e0ad 100644
--- a/engines/scumm/smush/smush_font.cpp
+++ b/engines/scumm/smush/smush_font.cpp
@@ -199,12 +199,6 @@ int SmushFont::draw2byte(byte *buffer, int dst_width, int x, int y, int idx) {
 }
 
 void SmushFont::drawSubstring(const char *str, uint numBytesMax, byte *buffer, int dst_width, int x, int y) {
-	// This happens in the Full Throttle intro. I don't know if our
-	// text-drawing functions are buggy, or if this function is supposed
-	// to have to check for it.
-	if (x < 0)
-		x = 0;
-
 	if (_vm->_language == Common::HE_ISR) {
 		for (int i = strlen(str); i >= 0 && numBytesMax; i--) {
 			x += drawChar(buffer, dst_width, x, y, str[i]);
@@ -361,6 +355,8 @@ void SmushFont::drawStringWrap(const char *str, byte *buffer, Common::Rect &clip
 	} else {
 		if (x > clipRect.right - maxWidth)
 			x = clipRect.right - maxWidth;
+		if (x < clipRect.left)
+			x = clipRect.left;
 	}
 
 	for (int i = 0; i < numSubstrings; i++) {


Commit: 1af3e4ef35a07733e5ea56535a5b6bc8e8e47750
    https://github.com/scummvm/scummvm/commit/1af3e4ef35a07733e5ea56535a5b6bc8e8e47750
Author: athrxx (athrxx at scummvm.org)
Date: 2020-12-04T00:02:32+01:00

Commit Message:
SCUMM: (FT) - fix minor actor text positioning glitch

Changed paths:
    engines/scumm/string.cpp


diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 9dbb6cbb82..755396c271 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -451,7 +451,12 @@ bool ScummEngine::newLine() {
 	if (_charset->_center) {
 		_nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
 		if (_nextLeft < 0)
-			_nextLeft = _game.version >= 6 ? _string[0].xpos : 0;
+			// The commented out part of the next line was meant as a fix for Kanji text glitches in DIG.
+			// But these glitches couldn't be reproduced in recent tests. So the underlying issue might
+			// have been taken care of in a different manner. And the fix actually caused other text glitches
+			// (FT/German, if you look at the sign on the container at game start). After counterchecking
+			// the original code it seems that setting _nextLeft to 0 is the right thing to do here.
+			_nextLeft = /*_game.version >= 6 ? _string[0].xpos :*/ 0;
 	} else if (_game.version >= 4 && _game.version < 7 && _game.heversion == 0 && _language == Common::HE_ISR) {
 		if (_game.id == GID_MONKEY && _charset->getCurID() == 4) {
 			_nextLeft = _screenWidth - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) - _nextLeft;




More information about the Scummvm-git-logs mailing list