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

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Fri Jul 24 20:58:15 CEST 2009


Revision: 42696
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42696&view=rev
Author:   wjpalenstijn
Date:     2009-07-24 18:58:15 +0000 (Fri, 24 Jul 2009)

Log Message:
-----------
SAGA: Instead of trying to detect duplicate glyphs,
simply generate duplicate outline glyphs.
This should fix #2826697.

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

Modified: scummvm/trunk/engines/saga/font.cpp
===================================================================
--- scummvm/trunk/engines/saga/font.cpp	2009-07-24 13:30:26 UTC (rev 42695)
+++ scummvm/trunk/engines/saga/font.cpp	2009-07-24 18:58:15 UTC (rev 42696)
@@ -143,9 +143,7 @@
 	int i;
 	int row;
 	int newByteWidth;
-	int oldByteWidth;
 	int newRowLength = 0;
-	size_t indexOffset = 0;
 	int index;
 	int currentByte;
 	unsigned char *basePointer;
@@ -154,57 +152,22 @@
 	unsigned char *destPointer2;
 	unsigned char *destPointer3;
 	unsigned char charRep;
-	int nextIndex = 0;
 
-
 	// Populate new font style character data
 	for (i = 0; i < FONT_CHARCOUNT; i++) {
 		newByteWidth = 0;
-		oldByteWidth = 0;
-		index = font->normal.fontCharEntry[i].index;
-		if ((index > 0) || (i == FONT_FIRSTCHAR)) {
-			index += indexOffset;
-		}
 
-		bool skip = false;
-
-		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.
-			skip = true;
-			bool found = false;
-			for (int j = 0; j < i; j++) {
-				if (font->normal.fontCharEntry[i].index == font->normal.fontCharEntry[j].index) {
-					index = font->outline.fontCharEntry[j].index;
-					found = true;
-					break;
-				}
-			}
-			if (!found)
-				error("Invalid index backreference in font char %d", i);
-		}
-
-		font->outline.fontCharEntry[i].index = index;
+		font->outline.fontCharEntry[i].index = newRowLength;
 		font->outline.fontCharEntry[i].tracking = font->normal.fontCharEntry[i].tracking;
 		font->outline.fontCharEntry[i].flag = font->normal.fontCharEntry[i].flag;
 
-		if (font->normal.fontCharEntry[i].width != 0) {
+		if (font->normal.fontCharEntry[i].width != 0)
 			newByteWidth = getByteLen(font->normal.fontCharEntry[i].width + 2);
-			oldByteWidth = getByteLen(font->normal.fontCharEntry[i].width);
 
-			if (!skip && newByteWidth > oldByteWidth) {
-				indexOffset++;
-			}
-		}
-
 		font->outline.fontCharEntry[i].width = font->normal.fontCharEntry[i].width + 2;
 		font->outline.fontCharEntry[i].byteWidth = newByteWidth;
 
-		if (!skip) {
-			newRowLength += newByteWidth;
-			nextIndex = font->normal.fontCharEntry[i].index + oldByteWidth;
-		}
+		newRowLength += newByteWidth;
 	}
 
 	debug(2, "New row length: %d", newRowLength);
@@ -220,10 +183,6 @@
 
 	// Generate outline font representation
 	for (i = 0; i < FONT_CHARCOUNT; i++) {
-		if (i > 0 && font->normal.fontCharEntry[i].index < font->normal.fontCharEntry[i-1].index) {
-			// Skip copies
-			continue;
-		}
 		for (row = 0; row < font->normal.header.charHeight; row++) {
 			for (currentByte = 0; currentByte < font->outline.fontCharEntry[i].byteWidth; currentByte++) {
 				basePointer = font->outline.font + font->outline.fontCharEntry[i].index + currentByte;


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