add ThemeManager::ClearThemePathCache
This commit is contained in:
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user