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.
This commit is contained in:
Johannes Schickel 2012-01-07 01:16:33 +01:00
parent 050b8e3360
commit 1574d644e8
2 changed files with 6 additions and 5 deletions

View file

@ -93,19 +93,19 @@ bool FontManager::assignFontToName(const Common::String &name, const Font *font)
return true; return true;
} }
bool FontManager::setFont(FontUsage usage, const Font *font) { bool FontManager::setFont(FontUsage usage, const BdfFont *font) {
switch (usage) { switch (usage) {
case kConsoleFont: case kConsoleFont:
delete g_consolefont; delete g_consolefont;
g_consolefont = (const BdfFont *)font; g_consolefont = font;
break; break;
case kGUIFont: case kGUIFont:
delete g_sysfont; delete g_sysfont;
g_sysfont = (const BdfFont *)font; g_sysfont = font;
break; break;
case kBigGUIFont: case kBigGUIFont:
delete g_sysfont_big; delete g_sysfont_big;
g_sysfont_big = (const BdfFont *)font; g_sysfont_big = font;
break; break;
default: default:
return false; return false;

View file

@ -32,6 +32,7 @@
namespace Graphics { namespace Graphics {
class Font; class Font;
class BdfFont;
class FontManager : public Common::Singleton<FontManager> { class FontManager : public Common::Singleton<FontManager> {
public: public:
@ -75,7 +76,7 @@ public:
* @param font the font object * @param font the font object
* @return true on success, false on failure * @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 * Removes binding from name to font