[Scummvm-git-logs] scummvm master -> 8a476715f6a733a0d6aa765204e87547725c243e

sev- sev at scummvm.org
Sat Jan 21 23:46:39 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8a476715f6 GRAPHICS: More work on MacFont scaling


Commit: 8a476715f6a733a0d6aa765204e87547725c243e
    https://github.com/scummvm/scummvm/commit/8a476715f6a733a0d6aa765204e87547725c243e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-01-21T23:46:21+01:00

Commit Message:
GRAPHICS: More work on MacFont scaling

Changed paths:
    graphics/fonts/macfont.cpp


diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp
index 0f057a8..f20b64e 100644
--- a/graphics/fonts/macfont.cpp
+++ b/graphics/fonts/macfont.cpp
@@ -419,7 +419,6 @@ MacFONTFont *MacFONTFont::scaleFont(MacFONTFont *src, int newSize) {
 	data._ascent = (int)((float)src->_data._ascent * scale);
 	data._descent = (int)((float)src->_data._descent * scale);
 	data._leading = (int)((float)src->_data._leading * scale);
-	data._rowWords = (int)((float)src->_data._rowWords * scale);
 
 	data._family = src->_data._family;
 	data._size = src->_data._size;
@@ -438,14 +437,10 @@ MacFONTFont *MacFONTFont::scaleFont(MacFONTFont *src, int newSize) {
 		newBitmapWidth += ((glyph->bitmapWidth + 7) / 8);
 	}
 
-	for (uint i = 0; i < src->_data._glyphs.size() + 1; i++) {
-		MacGlyph *glyph = (i == src->_data._glyphs.size()) ? &_data._defaultChar : &_data._glyphs[i];
+	data._rowWords = newBitmapWidth;
 
-		//glyph->bitmapOffset = bitmapOffsets[i];
-		//glyph->bitmapWidth = bitmapOffsets[i + 1] - bitmapOffsets[i];
-		glyph->width = (int)((float)src->_data._glyphs[i].width * scale);
-		glyph->kerningOffset = (int)((float)src->_data._glyphs[i].kerningOffset * scale);
-	}
+	uint16 bitImageSize = data._rowWords * _data._fRectHeight;
+	_data._bitImage = new byte[bitImageSize];
 
 #if 0
 	for (int i = 0; i < data.numCharacters; i++) {





More information about the Scummvm-git-logs mailing list