[Scummvm-cvs-logs] scummvm master -> 1574d644e8e3d32d9bf9a05aefabb82f877e05cd

lordhoto lordhoto at gmail.com
Sat Jan 7 01:17:57 CET 2012


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:
1574d644e8 GRAPHICS: Let FontManager::setFont accept an "const BdfFont *".


Commit: 1574d644e8e3d32d9bf9a05aefabb82f877e05cd
    https://github.com/scummvm/scummvm/commit/1574d644e8e3d32d9bf9a05aefabb82f877e05cd
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-01-06T16:16:33-08:00

Commit Message:
GRAPHICS: Let FontManager::setFont accept an "const BdfFont *".

As the documentation points out this method currently only works for BDF
fonts, thus it is safer to let it actually just accept such.

Changed paths:
    graphics/fontman.cpp
    graphics/fontman.h



diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp
index 9c7285e..8d967d5 100644
--- a/graphics/fontman.cpp
+++ b/graphics/fontman.cpp
@@ -93,19 +93,19 @@ bool FontManager::assignFontToName(const Common::String &name, const Font *font)
 	return true;
 }
 
-bool FontManager::setFont(FontUsage usage, const Font *font) {
+bool FontManager::setFont(FontUsage usage, const BdfFont *font) {
 	switch (usage) {
 	case kConsoleFont:
 		delete g_consolefont;
-		g_consolefont = (const BdfFont *)font;
+		g_consolefont = font;
 		break;
 	case kGUIFont:
 		delete g_sysfont;
-		g_sysfont = (const BdfFont *)font;
+		g_sysfont = font;
 		break;
 	case kBigGUIFont:
 		delete g_sysfont_big;
-		g_sysfont_big = (const BdfFont *)font;
+		g_sysfont_big = font;
 		break;
 	default:
 		return false;
diff --git a/graphics/fontman.h b/graphics/fontman.h
index e229860..42f7d85 100644
--- a/graphics/fontman.h
+++ b/graphics/fontman.h
@@ -32,6 +32,7 @@
 namespace Graphics {
 
 class Font;
+class BdfFont;
 
 class FontManager : public Common::Singleton<FontManager> {
 public:
@@ -75,7 +76,7 @@ public:
 	 * @param font	the font object
 	 * @return true on success, false on failure
 	 */
-	bool setFont(FontUsage usage, const Font *font);
+	bool setFont(FontUsage usage, const BdfFont *font);
 
 	/**
 	 * Removes binding from name to font






More information about the Scummvm-git-logs mailing list