From d3d06626e41a28c70b489a164a018c0ba65d0547 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 11 Jul 2009 09:45:25 +0000 Subject: Fix oversight in r42361 and also handle consecutive copied characters in SAGA. svn-id: r42378 --- engines/saga/font.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/saga/font.cpp') diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp index 1c1c3100c4..d58d1a8900 100644 --- a/engines/saga/font.cpp +++ b/engines/saga/font.cpp @@ -154,6 +154,7 @@ void Font::createOutline(FontData *font) { unsigned char *destPointer2; unsigned char *destPointer3; unsigned char charRep; + int nextIndex = 0; // Populate new font style character data @@ -167,7 +168,7 @@ void Font::createOutline(FontData *font) { 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 @@ void Font::createOutline(FontData *font) { 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); -- cgit v1.2.3