[Scummvm-cvs-logs] CVS: scummvm/graphics font.cpp,1.7,1.8 scummfont.cpp,1.7,1.8

Max Horn fingolfin at users.sourceforge.net
Sat Jan 8 10:12:11 CET 2005


Update of /cvsroot/scummvm/scummvm/graphics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6861

Modified Files:
	font.cpp scummfont.cpp 
Log Message:
Fix bug #1098115 (GUI: Broken console font)

Index: font.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/graphics/font.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- font.cpp	6 Jan 2005 22:48:41 -0000	1.7
+++ font.cpp	8 Jan 2005 18:11:29 -0000	1.8
@@ -38,7 +38,6 @@
 
 void NewFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 color) const {
 	assert(dst != 0);
-
 	byte *ptr = (byte *)dst->getBasePtr(tx, ty);
 
 	assert(desc.bits != 0 && desc.maxwidth <= 16);
@@ -56,18 +55,15 @@
 	const bitmap_t *tmp = desc.bits + (desc.offset ? desc.offset[chr] : (chr * desc.height));
 
 	for (int y = 0; y < desc.height; y++, ptr += dst->pitch) {
-		const bitmap_t *buffer = 0;
-		buffer = tmp++;
+		const bitmap_t buffer = *tmp++;
 		bitmap_t mask = 0x8000;
 		if (ty + y < 0 || ty + y >= dst->h)
 			continue;
-
-		for (int x = 0; x < w; x++) {
-			mask >>= 1;
-
+		
+		for (int x = 0; x < w; x++, mask >>= 1) {
 			if (tx + x < 0 || tx + x >= dst->w)
 				continue;
-			if ((*buffer & mask) != 0) {
+			if ((buffer & mask) != 0) {
 				if (dst->bytesPerPixel == 1)
 					ptr[x] = color;
 				else if (dst->bytesPerPixel == 2)

Index: scummfont.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/graphics/scummfont.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- scummfont.cpp	6 Jan 2005 22:48:41 -0000	1.7
+++ scummfont.cpp	8 Jan 2005 18:11:29 -0000	1.8
@@ -20,7 +20,6 @@
 
 #include "stdafx.h"
 #include "graphics/font.h"
-#include "gui/newgui.h"
 
 namespace Graphics {
 
@@ -65,7 +64,6 @@
 //void ScummFont::drawChar(byte chr, int xx, int yy, OverlayColor color) {
 void ScummFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 color) const {
 	assert(dst != 0);
-
 	byte *ptr = (byte *)dst->getBasePtr(tx, ty);
 
 	const byte *tmp = guifont + 6 + guifont[4] + chr * 8;
@@ -76,17 +74,15 @@
 		if (ty + y < 0 || ty + y >= dst->h)
 			continue;
 		for (int x = 0; x < 8; x++) {
-			mask >>= 1;
-
 			if (tx + x < 0 || tx + x >= dst->w)
 				continue;
-			
-
+			unsigned char c;
+			mask >>= 1;
 			if (mask == 0) {
 				buffer = *tmp++;
 				mask = 0x80;
 			}
-			const byte c = ((buffer & mask) != 0);
+			c = ((buffer & mask) != 0);
 			if (c) {
 				if (dst->bytesPerPixel == 1)
 					ptr[x] = color;





More information about the Scummvm-git-logs mailing list