diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 5715010638..25bbfc906f 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -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] diff --git a/src/Font.cpp b/src/Font.cpp index ec00195979..049b8f137d 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -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 ) diff --git a/src/FontManager.cpp b/src/FontManager.cpp index 837a5d5aa1..5aba61bad2 100644 --- a/src/FontManager.cpp +++ b/src/FontManager.cpp @@ -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; }