[Scummvm-cvs-logs] SF.net SVN: scummvm:[42378] scummvm/trunk/engines/saga/font.cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sat Jul 11 11:45:25 CEST 2009


Revision: 42378
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42378&view=rev
Author:   wjpalenstijn
Date:     2009-07-11 09:45:25 +0000 (Sat, 11 Jul 2009)

Log Message:
-----------
Fix oversight in r42361 and also handle consecutive copied characters in SAGA.

Modified Paths:
--------------
    scummvm/trunk/engines/saga/font.cpp

Modified: scummvm/trunk/engines/saga/font.cpp
===================================================================
--- scummvm/trunk/engines/saga/font.cpp	2009-07-11 08:16:55 UTC (rev 42377)
+++ scummvm/trunk/engines/saga/font.cpp	2009-07-11 09:45:25 UTC (rev 42378)
@@ -154,6 +154,7 @@
 	unsigned char *destPointer2;
 	unsigned char *destPointer3;
 	unsigned char charRep;
+	int nextIndex = 0;
 
 
 	// Populate new font style character data
@@ -167,7 +168,7 @@
 
 		bool skip = false;
 
-		if (i > 0 && font->normal.fontCharEntry[i].width != 0 && font->normal.fontCharEntry[i].index < font->normal.fontCharEntry[i-1].index) {
+		if (font->normal.fontCharEntry[i].width != 0 && font->normal.fontCharEntry[i].index < nextIndex) {
 			// Some characters are copies of earlier characters.
 			// Look up the original, and make sure not to grow the size of
 			// the outline font twice.
@@ -200,8 +201,10 @@
 		font->outline.fontCharEntry[i].width = font->normal.fontCharEntry[i].width + 2;
 		font->outline.fontCharEntry[i].byteWidth = newByteWidth;
 
-		if (!skip)
+		if (!skip) {
 			newRowLength += newByteWidth;
+			nextIndex = font->normal.fontCharEntry[i].index + oldByteWidth;
+		}
 	}
 
 	debug(2, "New row length: %d", newRowLength);


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