[Scummvm-cvs-logs] CVS: scummvm/gui newgui.h,1.45,1.46 newgui.cpp,1.85,1.86

Max Horn fingolfin at users.sourceforge.net
Sun Aug 15 06:50:11 CEST 2004


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

Modified Files:
	newgui.h newgui.cpp 
Log Message:
Allow char drawing with a custom font

Index: newgui.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- newgui.h	15 Aug 2004 13:15:55 -0000	1.45
+++ newgui.h	15 Aug 2004 13:49:13 -0000	1.46
@@ -128,10 +128,12 @@
 	void fillRect(int x, int y, int w, int h, OverlayColor color);
 	void checkerRect(int x, int y, int w, int h, OverlayColor color);
 	void frameRect(int x, int y, int w, int h, OverlayColor color);
-	void drawChar(byte c, int x, int y, OverlayColor color);
+
+	void drawChar(byte c, int x, int y, OverlayColor color, const Graphics::Font *font = 0);
+	void drawString(const String &str, int x, int y, int w, OverlayColor color, Graphics::TextAlignment align = Graphics::kTextAlignLeft, int deltax = 0, bool useEllipsis = true);
+
 	int getStringWidth(const String &str);
 	int getCharWidth(byte c);
-	void drawString(const String &str, int x, int y, int w, OverlayColor color, Graphics::TextAlignment align = Graphics::kTextAlignLeft, int deltax = 0, bool useEllipsis = true);
 
 	void drawBitmap(uint32 *bitmap, int x, int y, OverlayColor color, int h = 8);
 

Index: newgui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- newgui.cpp	15 Aug 2004 13:15:55 -0000	1.85
+++ newgui.cpp	15 Aug 2004 13:49:13 -0000	1.86
@@ -373,8 +373,10 @@
 	_system->copyRectToOverlay(buf, _screenPitch, x, y, w, h);
 }
 
-void NewGui::drawChar(byte chr, int xx, int yy, OverlayColor color) {
-	getFont().drawChar(&_screen, chr, xx, yy, color);
+void NewGui::drawChar(byte chr, int xx, int yy, OverlayColor color, const Graphics::Font *font) {
+	if (font == 0)
+		font = &getFont();
+	font->drawChar(&_screen, chr, xx, yy, color);
 }
 
 int NewGui::getStringWidth(const String &str) {





More information about the Scummvm-git-logs mailing list