[Scummvm-cvs-logs] SF.net SVN: scummvm:[35224] scummvm/trunk/engines/sword2/screen.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Wed Dec 3 22:30:42 CET 2008


Revision: 35224
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35224&view=rev
Author:   eriktorbjorn
Date:     2008-12-03 21:30:41 +0000 (Wed, 03 Dec 2008)

Log Message:
-----------
Converted the credits scroller to use readLine_NEW() instead of readLine_OLD().

Modified Paths:
--------------
    scummvm/trunk/engines/sword2/screen.cpp

Modified: scummvm/trunk/engines/sword2/screen.cpp
===================================================================
--- scummvm/trunk/engines/sword2/screen.cpp	2008-12-03 19:20:59 UTC (rev 35223)
+++ scummvm/trunk/engines/sword2/screen.cpp	2008-12-03 21:30:41 UTC (rev 35224)
@@ -932,8 +932,33 @@
 
 	while (1) {
 		char buffer[80];
-		char *line = f.readLine_OLD(buffer, sizeof(buffer));
+		char *line = f.readLine_NEW(buffer, sizeof(buffer));
 
+		if (line) {
+			// Replace invalid character codes prevent the 'dud'
+			// symbol from showing up in the credits.
+
+			for (byte *ptr = (byte *)line; *ptr; ptr++) {
+				switch (*ptr) {
+				case 9:
+					// The German credits contain these.
+					// Convert them to spaces.
+					*ptr = 32;
+					break;
+				case 10:
+					// LF is treated as end of line.
+					*ptr = 0;
+					break;
+				case 170:
+					// The Spanish credits contain these.
+					// Convert them to periods.
+					*ptr = '.';
+				default:
+					break;
+				}
+			}
+		}
+
 		if (!line || *line == 0) {
 			if (!hasCenterMark) {
 				for (i = paragraphStart; i < lineCount; i++)
@@ -950,21 +975,6 @@
 			continue;
 		}
 
-		// Replace invalid character codes to avoid the credits to show
-		// the 'dud' symbol.
-
-		for (byte *ptr = (byte *)line; *ptr; ptr++) {
-			// The German credits contains character code 9. We
-			// replace them with spaces.
-			if (*ptr == 9)
-				*ptr = 32;
-
-			// The Spanish credits contains character code 170. We
-			// replace them with dots.
-			if (*ptr == 170)
-				*ptr = '.';
-		}
-
 		char *center_mark = strchr(line, '^');
 
 		if (center_mark) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list