[Scummvm-cvs-logs] CVS: residual font.h,1.3,1.4 textobject.cpp,1.17,1.18

Pawel Kolodziejski aquadran at users.sourceforge.net
Sun Mar 20 03:49:49 CET 2005


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

Modified Files:
	font.h textobject.cpp 
Log Message:
fixed drawing 'spaces' in textobjects

Index: font.h
===================================================================
RCS file: /cvsroot/scummvm/residual/font.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- font.h	18 Mar 2005 19:54:39 -0000	1.3
+++ font.h	20 Mar 2005 11:49:21 -0000	1.4
@@ -30,7 +30,7 @@
 
 	uint32 getCharWidth(char c) { return _charHeaders[_charIndex[c]].width; }
 	uint32 getCharHeight(char c) { return _charHeaders[_charIndex[c]].height; }
-	uint32 getCharLogicalWidth(char c) { return _charHeaders[_charIndex[c]].startingCol; }
+	uint32 getCharLogicalWidth(char c) { return _charHeaders[_charIndex[c]].logicalWidth; }
 	uint32 getCharStartingCol(char c) { return _charHeaders[_charIndex[c]].startingCol; }
 	uint32 getCharStartingLine(char c) { return _charHeaders[_charIndex[c]].startingLine; }
 	const byte *getCharData(char c) { return _fontData + (_charHeaders[_charIndex[c]].offset); }

Index: textobject.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/textobject.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- textobject.cpp	19 Mar 2005 21:48:23 -0000	1.17
+++ textobject.cpp	20 Mar 2005 11:49:21 -0000	1.18
@@ -34,7 +34,7 @@
 	_bitmapHeight = _bitmapWidth = 0;
 
 	for (int i = 0; msg[i] != '\0'; ++i) {
-		_bitmapWidth += font->getCharWidth(msg[i]) + font->getCharStartingCol(msg[i]);
+		_bitmapWidth += font->getCharLogicalWidth(msg[i]) + font->getCharStartingCol(msg[i]);
 
 		int h = font->getCharHeight(msg[i]) + font->getCharStartingLine(msg[i]);
 		if (h > _bitmapHeight)
@@ -51,6 +51,7 @@
 	for (int line = 0; line < _bitmapHeight; ++line) {
 		for (int c = 0; msg[c] != '\0'; ++c) {
 			uint32 charWidth = font->getCharWidth(msg[c]);
+			uint32 charLogicalWidth = font->getCharLogicalWidth(msg[c]);
 			uint8 startingCol = font->getCharStartingCol(msg[c]);
 			uint8 startingLine = font->getCharStartingLine(msg[c]);
 
@@ -59,7 +60,7 @@
 					font->getCharData(msg[c]) + charWidth * (line - startingLine), charWidth);
 			}
 
-			offset += charWidth + startingCol;
+			offset += charLogicalWidth + startingCol;
 		}
 	}
 





More information about the Scummvm-git-logs mailing list