[Scummvm-git-logs] scummvm branch-2-2 -> b51d5ed0da32c85d3903dd491e2881724b51cf6f

sev- sev at scummvm.org
Mon Aug 31 22:31:41 UTC 2020


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:
b51d5ed0da SCUMM: Treat 0x21 as breaking space in Chinese in SMUSH movies. Fixes #7126


Commit: b51d5ed0da32c85d3903dd491e2881724b51cf6f
    https://github.com/scummvm/scummvm/commit/b51d5ed0da32c85d3903dd491e2881724b51cf6f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-09-01T00:31:32+02:00

Commit Message:
SCUMM: Treat 0x21 as breaking space in Chinese in SMUSH movies. Fixes #7126

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 93945d9e2f..46a2722715 100644
--- a/engines/scumm/smush/smush_font.cpp
+++ b/engines/scumm/smush/smush_font.cpp
@@ -215,7 +215,14 @@ void SmushFont::drawString(const char *str, byte *buffer, int dst_width, int dst
 
 	while (str) {
 		char line[256];
-		const char *pos = strchr(str, '\n');
+		char separators[] = "\n ";
+
+		if (_vm->_language == Common::ZH_TWN)
+			separators[1] = '!';
+		else
+			separators[1] = '\0';
+
+		const char *pos = strpbrk(str, separators);
 		if (pos) {
 			memcpy(line, str, pos - str - 1);
 			line[pos - str - 1] = 0;
@@ -236,12 +243,18 @@ void SmushFont::drawStringWrap(const char *str, byte *buffer, int dst_width, int
 	Common::String s(str);
 	char *words[MAX_WORDS];
 	int word_count = 0;
+	char separators[] = " \t\r\n ";
+
+	if (_vm->_language == Common::ZH_TWN)
+		separators[4] = '!';
+	else
+		separators[4] = '\0';
 
 	Common::String::iterator tmp = s.begin();
 	while (tmp) {
 		assert(word_count < MAX_WORDS);
 		words[word_count++] = tmp;
-		tmp = strpbrk(tmp, " \t\r\n");
+		tmp = strpbrk(tmp, separators);
 		if (tmp == 0)
 			break;
 		*tmp++ = 0;




More information about the Scummvm-git-logs mailing list