aboutsummaryrefslogtreecommitdiff
path: root/graphics/fontman.cpp
diff options
context:
space:
mode:
authorMax Horn2009-12-09 16:44:48 +0000
committerMax Horn2009-12-09 16:44:48 +0000
commitfb5e747565e28a6863190e0e837899d5177244af (patch)
tree664990ab09fb610c55b82661dc223e55f4f2aa74 /graphics/fontman.cpp
parent421363a13258c149bdf976938e7dc8d8438aa9db (diff)
downloadscummvm-rg350-fb5e747565e28a6863190e0e837899d5177244af.tar.gz
scummvm-rg350-fb5e747565e28a6863190e0e837899d5177244af.tar.bz2
scummvm-rg350-fb5e747565e28a6863190e0e837899d5177244af.zip
GRAPHICS: Change font code to be identical on all platforms
svn-id: r46309
Diffstat (limited to 'graphics/fontman.cpp')
-rw-r--r--graphics/fontman.cpp39
1 files changed, 11 insertions, 28 deletions
diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp
index fea29f4489..05abb4e4c7 100644
--- a/graphics/fontman.cpp
+++ b/graphics/fontman.cpp
@@ -29,26 +29,17 @@ DECLARE_SINGLETON(Graphics::FontManager);
namespace Graphics {
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
-const ScummFont g_scummfont;
-extern const NewFont g_sysfont;
-extern const NewFont g_sysfont_big;
-extern const NewFont g_consolefont;
-
-FontManager::FontManager() {
-}
-
-#else
const ScummFont *g_scummfont;
extern const NewFont *g_sysfont;
extern const NewFont *g_sysfont_big;
extern const NewFont *g_consolefont;
-static bool g_initialized = false;
-void initfonts() {
- if (!g_initialized) {
+static bool s_initialized = false;
+
+FontManager::FontManager() {
+ if (!s_initialized) {
// FIXME : this need to be freed
- g_initialized = true;
+ s_initialized = true;
g_scummfont = new ScummFont;
INIT_FONT(g_sysfont)
INIT_FONT(g_sysfont_big)
@@ -56,10 +47,13 @@ void initfonts() {
}
}
-FontManager::FontManager() {
- initfonts();
+FontManager::~FontManager() {
+ s_initialized = false;
+ delete g_scummfont;
+ delete g_sysfont;
+ delete g_sysfont_big;
+ delete g_consolefont;
}
-#endif
const Font *FontManager::getFontByName(const Common::String &name) const {
if (!_fontMap.contains(name))
@@ -69,16 +63,6 @@ const Font *FontManager::getFontByName(const Common::String &name) const {
const Font *FontManager::getFontByUsage(FontUsage usage) const {
switch (usage) {
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
- case kOSDFont:
- return &g_scummfont;
- case kConsoleFont:
- return &g_consolefont;
- case kGUIFont:
- return &g_sysfont;
- case kBigGUIFont:
- return &g_sysfont_big;
-#else
case kOSDFont:
return g_scummfont;
case kConsoleFont:
@@ -87,7 +71,6 @@ const Font *FontManager::getFontByUsage(FontUsage usage) const {
return g_sysfont;
case kBigGUIFont:
return g_sysfont_big;
-#endif
}
return 0;