add ThemeManager::ClearThemePathCache

This commit is contained in:
Glenn Maynard
2005-03-20 05:39:32 +00:00
parent dbb8f87932
commit cc34c9bd6b
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -90,6 +90,11 @@ void ThemeManager::Unsubscribe( IThemeMetric *p )
/* We spend a lot of time doing redundant theme path lookups. Cache results. */
static map<CString, CString> g_ThemePathCache[NUM_ELEMENT_CATEGORIES];
void ThemeManager::ClearThemePathCache()
{
for( int i = 0; i < NUM_ELEMENT_CATEGORIES; ++i )
g_ThemePathCache[i].clear();
}
void FileNameToClassAndElement( const CString &sFileName, CString &sClassNameOut, CString &sElementOut )
{
+1
View File
@@ -61,6 +61,7 @@ public:
CString GetPathG( const CString &sClassName, const CString &sElement, bool bOptional=false ) { return GetPath(ELEMENT_CATEGORY_GRAPHICS,sClassName,sElement,bOptional); };
CString GetPathS( const CString &sClassName, const CString &sElement, bool bOptional=false ) { return GetPath(ELEMENT_CATEGORY_SOUNDS,sClassName,sElement,bOptional); };
CString GetPathO( const CString &sClassName, const CString &sElement, bool bOptional=false ) { return GetPath(ELEMENT_CATEGORY_OTHER,sClassName,sElement,bOptional); };
void ClearThemePathCache();
// TODO: remove these and update the places that use them
CString GetPathToB( const CString &sFileName, bool bOptional=false );