[Scummvm-git-logs] scummvm master -> 1180f7a03f19f4c40378b62ff20fd49c3933e1b3

sev- sev at scummvm.org
Thu Jan 26 18:07:39 CET 2017


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

Summary:
f7ada97cf8 GRAPHICS: Fixes to MacFont scaling
1180f7a03f DIRECTOR: Improved font scaling test


Commit: f7ada97cf84b519935dde4890d9507cc06e5723e
    https://github.com/scummvm/scummvm/commit/f7ada97cf84b519935dde4890d9507cc06e5723e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-01-26T18:08:03+01:00

Commit Message:
GRAPHICS: Fixes to MacFont scaling

Changed paths:
    graphics/fonts/macfont.cpp


diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp
index 882e841..820936c 100644
--- a/graphics/fonts/macfont.cpp
+++ b/graphics/fonts/macfont.cpp
@@ -440,7 +440,7 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize) {
 		glyph->bitmapWidth = (int)((float)srcglyph->bitmapWidth * scale);
 		glyph->bitmapOffset = newBitmapWidth;
 
-		newBitmapWidth += ((glyph->bitmapWidth + 7) / 8);
+		newBitmapWidth += (glyph->bitmapWidth + 7) & ~0x7;
 	}
 
 	data._rowWords = newBitmapWidth;
@@ -454,15 +454,15 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize) {
 	for (uint i = 0; i < src->_data._glyphs.size() + 1; i++) {
 		const MacGlyph *srcglyph = (i == src->_data._glyphs.size()) ? &src->_data._defaultChar : &src->_data._glyphs[i];
 		MacGlyph *glyph = (i == src->_data._glyphs.size()) ? &data._defaultChar : &data._glyphs[i];
-		byte *ptr = &data._bitImage[glyph->bitmapOffset];
+		byte *ptr = &data._bitImage[glyph->bitmapOffset / 8];
 
 		for (int y = 0; y < data._fRectHeight; y++) {
-			const byte *srcd = (const byte *)&src->_data._bitImage[((int)((float)y / scale)) * srcPitch + srcglyph->bitmapOffset];
+			const byte *srcd = (const byte *)&src->_data._bitImage[((int)((float)y / scale)) * srcPitch];
 			byte *dst = ptr;
 			byte b = 0;
 
 			for (int x = 0; x < glyph->width; x++) {
-				int sx = (int)((float)x / scale);
+				int sx = (int)((float)x / scale) + srcglyph->bitmapOffset;
 
 				if (srcd[sx / 8] & (0x80 >> (sx % 8)))
 					b |= 1;


Commit: 1180f7a03f19f4c40378b62ff20fd49c3933e1b3
    https://github.com/scummvm/scummvm/commit/1180f7a03f19f4c40378b62ff20fd49c3933e1b3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-01-26T18:08:03+01:00

Commit Message:
DIRECTOR: Improved font scaling test

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 9864a4c..18ab4c9 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -110,18 +110,17 @@ void DirectorEngine::testFontScaling() {
 
 	const Graphics::MacFONTFont *font1 = (const Graphics::MacFONTFont *)_wm->_fontMan->getFont(origFont);
 
-	Graphics::MacFONTFont::testBlit(font1, &surface, 0, x, y, 500);
+	Graphics::MacFONTFont::testBlit(font1, &surface, 0, x, y + 200, 500);
 
 	Graphics::MacFont bigFont(Graphics::kMacFontNewYork, 15);
 
 	font1 = (const Graphics::MacFONTFont *)_wm->_fontMan->getFont(bigFont);
 
-	Graphics::MacFONTFont::testBlit(font1, &surface, 0, x, y + 50, 500);
+	Graphics::MacFONTFont::testBlit(font1, &surface, 0, x, y + 50 + 200, 500);
 
-#if 0
 	const char *text = "d";
 
-	for (int i = 9; i <= 40; i++) {
+	for (int i = 9; i <= 20; i++) {
 		Graphics::MacFont macFont(Graphics::kMacFontNewYork, i);
 
 		const Graphics::Font *font = _wm->_fontMan->getFont(macFont);
@@ -135,7 +134,6 @@ void DirectorEngine::testFontScaling() {
 
 		x += width + 1;
 	}
-#endif
 
 	g_system->copyRectToScreen(surface.getPixels(), surface.pitch, 0, 0, w, h);
 





More information about the Scummvm-git-logs mailing list