diff options
author | Chris Apers | 2005-10-08 21:11:45 +0000 |
---|---|---|
committer | Chris Apers | 2005-10-08 21:11:45 +0000 |
commit | 3f2f5e099738f409501126168b3342a6c1284b34 (patch) | |
tree | 930276a10140e18577c8c3a58475dce78db82a81 /graphics/fontman.cpp | |
parent | 5b514241f34a0f25f98a280801df5d2f1f7d9dbf (diff) | |
download | scummvm-rg350-3f2f5e099738f409501126168b3342a6c1284b34.tar.gz scummvm-rg350-3f2f5e099738f409501126168b3342a6c1284b34.tar.bz2 scummvm-rg350-3f2f5e099738f409501126168b3342a6c1284b34.zip |
PalmOS : very bad hack to fix global constructor problem with ARM
svn-id: r18970
Diffstat (limited to 'graphics/fontman.cpp')
-rw-r--r-- | graphics/fontman.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp index e0ca9e5997..11c7dd1879 100644 --- a/graphics/fontman.cpp +++ b/graphics/fontman.cpp @@ -25,20 +25,44 @@ DECLARE_SINGLETON(Graphics::FontManager); namespace Graphics { +#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG)) 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) { + // FIXME : this need to be freed + g_initialized = true; + g_scummfont = new ScummFont; + INIT_FONT(g_sysfont) + INIT_FONT(g_sysfont_big) + INIT_FONT(g_consolefont) + } +} FontManager::FontManager() { + initfonts(); } +#endif //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)) case kOSDFont: return &g_scummfont; case kConsoleFont: @@ -47,7 +71,18 @@ const Font *FontManager::getFontByUsage(FontUsage usage) const { return &g_sysfont; case kBigGUIFont: return &g_sysfont_big; +#else + case kOSDFont: + return g_scummfont; + case kConsoleFont: + return g_consolefont; + case kGUIFont: + return g_sysfont; + case kBigGUIFont: + return g_sysfont_big; +#endif } + return 0; } |