[Scummvm-git-logs] scummvm master -> cb411b20860e98dc9e5a8ee2ea745e62446396dd

AndywinXp noreply at scummvm.org
Sun Feb 12 23:47:56 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:
cb411b2086 SCUMM: MI1 (Sega CD): Fix calculation of dialog line height for JAP version


Commit: cb411b20860e98dc9e5a8ee2ea745e62446396dd
    https://github.com/scummvm/scummvm/commit/cb411b20860e98dc9e5a8ee2ea745e62446396dd
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-02-13T00:47:51+01:00

Commit Message:
SCUMM: MI1 (Sega CD): Fix calculation of dialog line height for JAP version

Changed paths:
    engines/scumm/string.cpp


diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index bd216389dd3..9d28411bb31 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -574,15 +574,30 @@ bool ScummEngine::newLine() {
 	} else if (!(_game.platform == Common::kPlatformFMTowns) && _string[0].height) {
 		_nextTop += _string[0].height;
 	} else {
-		bool useCJK = _useCJKMode;
-		// SCUMM5 FM-Towns doesn't use the height of the ROM font here.
-		if (_game.platform == Common::kPlatformFMTowns && _game.version == 5)
+		if (_game.platform == Common::kPlatformSegaCD && _useCJKMode) {
+			// The JAP Sega CD version of Monkey Island 1 doesn't just calculate
+			// the font height, but instead relies on the actual string height.
+			// If the string contains at least a 2 byte character, then we signal it with
+			// the opposite of the hack used below for FM-Towns, so that getFontHeight()
+			// can yield the correct result.
 			_useCJKMode = false;
-		_nextTop += _charset->getFontHeight();
-		_useCJKMode = useCJK;
 
-		if (_useCJKMode && _game.platform == Common::kPlatformSegaCD) {
-			_nextTop -= 1;
+			for (int i = 0; _charsetBuffer[i]; i++) {
+				if (is2ByteCharacter(_language, _charsetBuffer[i])) {
+					_useCJKMode = true;
+					break;
+				}
+			}
+
+			_nextTop += _charset->getFontHeight() - 1;
+			_useCJKMode = true;
+		} else {
+			bool useCJK = _useCJKMode;
+			// SCUMM5 FM-Towns doesn't use the height of the ROM font here.
+			if (_game.platform == Common::kPlatformFMTowns && _game.version == 5)
+				_useCJKMode = false;
+			_nextTop += _charset->getFontHeight();
+			_useCJKMode = useCJK;
 		}
 	}
 	if (_game.version > 3) {




More information about the Scummvm-git-logs mailing list