damnit I wanted to be able to refresh font settings and now I can again.

This commit is contained in:
AJ Kelly
2011-02-17 14:42:40 -06:00
parent 2864b64dae
commit 69491c7ccb
3 changed files with 13 additions and 7 deletions
+4
View File
@@ -13,6 +13,10 @@ _____________________________________________________________________________
sm-ssc v1.2.2 | 201102??
--------------------------------------------------------------------------------
20110217
--------
* Allowed refreshing of Fonts again. [AJ]
20110214
--------
* Added #CHARTSTYLE to .ssc format, mainly meant for Pad/Keyboard distinctions. [AJ]
+2 -2
View File
@@ -237,7 +237,7 @@ Font::~Font()
void Font::Unload()
{
LOG->Trace("Font:Unload '%s'",path.c_str());
//LOG->Trace("Font:Unload '%s'",path.c_str());
for( unsigned i = 0; i < m_apPages.size(); ++i )
delete m_apPages[i];
m_apPages.clear();
@@ -655,7 +655,7 @@ void Font::Load( const RString &sIniPath, RString sChars )
{
ASSERT_M( !GetExtension(sIniPath).CompareNoCase("ini"), sIniPath );
LOG->Trace( "Font: Loading new font '%s'",sIniPath.c_str());
//LOG->Trace( "Font: Loading new font '%s'",sIniPath.c_str());
// Check for recursion (recursive imports).
for( unsigned i = 0; i < LoadStack.size(); ++i )
+7 -5
View File
@@ -43,10 +43,10 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha
PruneFonts();
Font *pFont;
// Convert the path to lowercase so that we don't load duplicates.
// Really, this does not solve the duplicate problem. We could have two copies
// of the same bitmap if there are equivalent but different paths
// (e.g. "graphics\blah.png" and "..\stepmania\graphics\blah.png" ).
/* Convert the path to lowercase so that we don't load duplicates. Really,
* this does not solve the duplicate problem. We could have two copies of
* the same bitmap if there are equivalent but different paths
* (e.g. "graphics\blah.png" and "..\stepmania\graphics\blah.png" ). */
CHECKPOINT_M( ssprintf("FontManager::LoadFont(%s).", sFontOrTextureFilePath.c_str()) );
const FontName NewName( sFontOrTextureFilePath, sChars );
@@ -54,6 +54,8 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha
if( p != g_mapPathToFont.end() )
{
pFont=p->second;
// reload in case metrics may have changed
pFont->Load(sFontOrTextureFilePath, sChars);
}
else {
pFont= new Font;
@@ -61,7 +63,7 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha
g_mapPathToFont[NewName] = pFont;
}
++pFont->m_iRefCount;
pFont->m_iRefCount++;
return pFont;
}