[Scummvm-cvs-logs] scummvm master -> 5aae18feb80ff7aa58ce6f7400d54673af58196b

m-kiewitz m_kiewitz at users.sourceforge.net
Sun Nov 2 13:07:10 CET 2014


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:
5aae18feb8 SCI: text16 Shift-JIS font switch fixed


Commit: 5aae18feb80ff7aa58ce6f7400d54673af58196b
    https://github.com/scummvm/scummvm/commit/5aae18feb80ff7aa58ce6f7400d54673af58196b
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2014-11-02T13:08:33+01:00

Commit Message:
SCI: text16 Shift-JIS font switch fixed
fixes Police Quest 2 Japanese intro and others,
where the internal SCI font was used and not
the Shift-JIS hires font

Changed paths:
    engines/sci/graphics/text16.cpp



diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp
index 4f9b6c7..3769cd3 100644
--- a/engines/sci/graphics/text16.cpp
+++ b/engines/sci/graphics/text16.cpp
@@ -362,12 +362,12 @@ int16 GfxText16::Size(Common::Rect &rect, const char *text, GuiResourceId fontId
 	else
 		fontId = previousFontId;
 
-	if (g_sci->getLanguage() == Common::JA_JPN)
-		SwitchToFont900OnSjis(text);
-
 	rect.top = rect.left = 0;
 
 	if (maxWidth < 0) { // force output as single line
+		if (g_sci->getLanguage() == Common::JA_JPN)
+			SwitchToFont900OnSjis(text);
+
 		StringWidth(text, fontId, textWidth, textHeight);
 		rect.bottom = textHeight;
 		rect.right = textWidth;
@@ -378,6 +378,10 @@ int16 GfxText16::Size(Common::Rect &rect, const char *text, GuiResourceId fontId
 		const char *curTextPos = text; // in work position for GetLongest()
 		const char *curTextLine = text; // starting point of current line
 		while (*curTextPos) {
+			// We need to check for Shift-JIS every line
+			if (g_sci->getLanguage() == Common::JA_JPN)
+				SwitchToFont900OnSjis(curTextPos);
+
 			charCount = GetLongest(curTextPos, rect.right, fontId);
 			if (charCount == 0)
 				break;
@@ -466,17 +470,19 @@ void GfxText16::Box(const char *text, bool show, const Common::Rect &rect, TextA
 	else
 		fontId = previousFontId;
 
-	if (g_sci->getLanguage() == Common::JA_JPN) {
-		if (SwitchToFont900OnSjis(text))
-			doubleByteMode = true;
-	}
-
 	// Reset reference code rects
 	_codeRefRects.clear();
 	_codeRefTempRect.left = _codeRefTempRect.top = -1;
 
 	maxTextWidth = 0;
 	while (*curTextPos) {
+		// We need to check for Shift-JIS every line
+		//  Police Quest 2 PC-9801 often draws English + Japanese text during the same call
+		if (g_sci->getLanguage() == Common::JA_JPN) {
+			if (SwitchToFont900OnSjis(curTextPos))
+				doubleByteMode = true;
+		}
+
 		charCount = GetLongest(curTextPos, rect.width(), fontId);
 		if (charCount == 0)
 			break;






More information about the Scummvm-git-logs mailing list