Mini-rewrite of input mapping, theme support, and added KSF reader.
This commit is contained in:
@@ -40,7 +40,7 @@ FontManager::~FontManager()
|
||||
while( pos != NULL ) // iterate over all k/v pairs in map
|
||||
{
|
||||
m_mapPathToFont.GetNextAssoc( pos, sFontFilePath, pFont );
|
||||
LOG->WriteLine( "FONT LEAK: '%s', RefCount = %d.", sFontFilePath, pFont->m_iRefCount );
|
||||
LOG->Trace( "FONT LEAK: '%s', RefCount = %d.", sFontFilePath, pFont->m_iRefCount );
|
||||
SAFE_DELETE( pFont );
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
|
||||
{
|
||||
sFontFilePath.MakeLower();
|
||||
|
||||
// LOG->WriteLine( "FontManager::LoadFont(%s).", sFontFilePath );
|
||||
// LOG->Trace( "FontManager::LoadFont(%s).", sFontFilePath );
|
||||
|
||||
|
||||
// Convert the path to lowercase so that we don't load duplicates.
|
||||
@@ -67,7 +67,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
|
||||
|
||||
if( m_mapPathToFont.Lookup( sFontFilePath, pFont ) ) // if the texture already exists in the map
|
||||
{
|
||||
LOG->WriteLine( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath, pFont->m_iRefCount) );
|
||||
LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath, pFont->m_iRefCount) );
|
||||
pFont->m_iRefCount++;
|
||||
}
|
||||
else // the texture is not already loaded
|
||||
@@ -77,7 +77,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
|
||||
|
||||
pFont = (Font*) new Font( sFontFilePath );
|
||||
|
||||
LOG->WriteLine( "FontManager: Loading '%s' from disk.", sFontFilePath);
|
||||
LOG->Trace( "FontManager: Loading '%s' from disk.", sFontFilePath);
|
||||
|
||||
m_mapPathToFont.SetAt( sFontFilePath, pFont );
|
||||
}
|
||||
@@ -102,11 +102,11 @@ void FontManager::UnloadFont( CString sFontFilePath )
|
||||
{
|
||||
sFontFilePath.MakeLower();
|
||||
|
||||
// LOG->WriteLine( "FontManager::UnloadTexture(%s).", sFontFilePath );
|
||||
// LOG->Trace( "FontManager::UnloadTexture(%s).", sFontFilePath );
|
||||
|
||||
if( sFontFilePath == "" )
|
||||
{
|
||||
LOG->WriteLine( "FontManager::UnloadTexture(): tried to Unload a blank" );
|
||||
LOG->Trace( "FontManager::UnloadTexture(): tried to Unload a blank" );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -117,13 +117,13 @@ void FontManager::UnloadFont( CString sFontFilePath )
|
||||
pFont->m_iRefCount--;
|
||||
if( pFont->m_iRefCount == 0 ) // there are no more references to this texture
|
||||
{
|
||||
LOG->WriteLine( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath, pFont->m_iRefCount );
|
||||
LOG->Trace( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath, pFont->m_iRefCount );
|
||||
SAFE_DELETE( pFont ); // free the texture
|
||||
m_mapPathToFont.RemoveKey( sFontFilePath ); // and remove the key in the map
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->WriteLine( ssprintf("FontManager: '%s' will not be deleted. It still has %d references.", sFontFilePath, pFont->m_iRefCount) );
|
||||
LOG->Trace( ssprintf("FontManager: '%s' will not be deleted. It still has %d references.", sFontFilePath, pFont->m_iRefCount) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user