From 3c997641f83de728b4e6d3aa21d82545650b84fd Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 27 Sep 2004 13:33:08 +0000 Subject: [PATCH] Remove game-specific glyphs. It adds overhead to setting every BitmapText, and nothing uses it. If we want to do this, add Lua conditionals to font pages. --- stepmania/src/Font.cpp | 20 ++++---------------- stepmania/src/FontManager.cpp | 21 --------------------- stepmania/src/FontManager.h | 3 --- 3 files changed, 4 insertions(+), 40 deletions(-) diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index 0ac2adcf1d..ec403e2f09 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -270,16 +270,10 @@ void Font::MergeFont(Font &f) const glyph &Font::GetGlyph( wchar_t c ) const { - ASSERT(c >= 0 && c <= 0xFFFFFF); + /* Try the regular character. */ + map::const_iterator it = m_iCharToGlyph.find(c); - /* See if there's a game-specific version of this character. */ - int gc = FontManager::MakeGameGlyph(c, GAMESTATE->m_pCurGame); - map::const_iterator it = m_iCharToGlyph.find(gc); - - /* If there isn't, try the regular character. */ - if(it == m_iCharToGlyph.end()) it = m_iCharToGlyph.find(c); - - /* If *that's* missing, use the default glyph. */ + /* If that's missing, use the default glyph. */ if(it == m_iCharToGlyph.end()) it = m_iCharToGlyph.find(DEFAULT_GLYPH); if(it == m_iCharToGlyph.end()) @@ -543,13 +537,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri continue; } - if(pGame != NULL) - { - longchar lc = FontManager::MakeGameGlyph(c, pGame); - cfg.CharToGlyphNo[lc] = atoi(data); - } else { - cfg.CharToGlyphNo[c] = atoi(data); - } + cfg.CharToGlyphNo[c] = atoi(data); continue; } diff --git a/stepmania/src/FontManager.cpp b/stepmania/src/FontManager.cpp index 43c28371c5..f38f9fefcd 100644 --- a/stepmania/src/FontManager.cpp +++ b/stepmania/src/FontManager.cpp @@ -29,27 +29,6 @@ FontManager::~FontManager() } } -/* A longchar is at least 32 bits. If c & 0xFF000000, it's a game-custom - * character; game 0 is 0x0100nnnn, game 1 is 0x0200nnnn, and so on. */ -longchar FontManager::MakeGameGlyph(wchar_t c, const Game* g) -{ - ASSERT(c >= 0 && c <= 0xFFFF); - int index = GAMEMAN->GetIndexFromGame(g); - ASSERT(index >= 0 && index <= 0xFF); - return longchar (((index+1) << 24) + c); -} - -bool FontManager::ExtractGameGlyph(longchar ch, wchar_t &cOut, const Game *&gOut) -{ - if((ch & 0xFF000000) == 0) return false; /* not a game glyph */ - - int index = (ch >> 24) - 1; - gOut = GAMEMAN->GetGameFromIndex( index ); - cOut = wchar_t(ch & 0xFFFF); - - return true; -} - void FontManager::ReloadFonts() { for(map::iterator i = g_mapPathToFont.begin(); diff --git a/stepmania/src/FontManager.h b/stepmania/src/FontManager.h index 500e5f71d9..6e229dfcff 100644 --- a/stepmania/src/FontManager.h +++ b/stepmania/src/FontManager.h @@ -23,9 +23,6 @@ public: * that'll get freed eventually and crash. This is only used for realtime * adjustment of fonts in ScreenTestFonts at the moment. */ void ReloadFonts(); - - static longchar MakeGameGlyph(wchar_t c, const Game* g); - static bool ExtractGameGlyph(longchar ch, wchar_t &c, const Game*& g); }; extern FontManager* FONT; // global and accessable from anywhere in our program