[Scummvm-cvs-logs] CVS: scummvm/scumm string.cpp,1.295,1.296 charset.cpp,2.147,2.148

Max Horn fingolfin at users.sourceforge.net
Fri Jun 17 13:23:44 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19257

Modified Files:
	string.cpp charset.cpp 
Log Message:
Handle newlines in blast text (fixes last remaining part of bug #902415)

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.295
retrieving revision 1.296
diff -u -d -r1.295 -r1.296
--- string.cpp	13 Jun 2005 07:09:12 -0000	1.295
+++ string.cpp	17 Jun 2005 20:23:12 -0000	1.296
@@ -796,32 +796,37 @@
 		buf = _blastTextQueue[i].text;
 
 		_charset->_top = _blastTextQueue[i].ypos + _screenTop;
-		_charset->_left = _blastTextQueue[i].xpos;
 		_charset->_right = _screenWidth - 1;
 		_charset->_center = _blastTextQueue[i].center;
 		_charset->setColor(_blastTextQueue[i].color);
 		_charset->_disableOffsX = _charset->_firstChar = true;
 		_charset->setCurID(_blastTextQueue[i].charset);
 
-		// Center text if necessary
-		if (_charset->_center) {
-			_charset->_left -= _charset->getStringWidth(0, buf) / 2;
-			if (_charset->_left < 0)
-				_charset->_left = 0;
-		}
-
 		do {
-			c = *buf++;
-			if (c != 0 && c != 0xFF) {
-				if (c & 0x80 && _useCJKMode) {
-					if (_language == Common::JA_JPN && !checkSJISCode(c)) {
-						c = 0x20; //not in S-JIS
-					} else {
-						c += *buf++ * 256;
+			_charset->_left = _blastTextQueue[i].xpos;
+
+			// Center text if necessary
+			if (_charset->_center) {
+				_charset->_left -= _charset->getStringWidth(0, buf) / 2;
+				if (_charset->_left < 0)
+					_charset->_left = 0;
+			}
+	
+			do {
+				c = *buf++;
+				if (c != 0 && c != 0xFF && c != '\n') {
+					if (c & 0x80 && _useCJKMode) {
+						if (_language == Common::JA_JPN && !checkSJISCode(c)) {
+							c = 0x20; //not in S-JIS
+						} else {
+							c += *buf++ * 256;
+						}
 					}
+					_charset->printChar(c);
 				}
-				_charset->printChar(c);
-			}
+			} while (c && c != '\n');
+
+			_charset->_top += _charset->getFontHeight();
 		} while (c);
 
 		_blastTextQueue[i].rect = _charset->_str;

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.147
retrieving revision 2.148
diff -u -d -r2.147 -r2.148
--- charset.cpp	4 Jun 2005 16:10:39 -0000	2.147
+++ charset.cpp	17 Jun 2005 20:23:12 -0000	2.148
@@ -311,7 +311,7 @@
 				break;
 		} else if (chr == '@')
 			continue;
-		if (chr == 0xD)
+		if (chr == '\n' || chr == '\r')
 			break;
 		if (chr == 254 || chr == 255) {
 			//process in LE





More information about the Scummvm-git-logs mailing list