diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index a1e59fc6c5..49fa76d5ec 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -90,6 +90,11 @@ void ThemeManager::Unsubscribe( IThemeMetric *p ) /* We spend a lot of time doing redundant theme path lookups. Cache results. */ static map 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 ) { diff --git a/stepmania/src/ThemeManager.h b/stepmania/src/ThemeManager.h index 1954ab868a..fddb07d936 100644 --- a/stepmania/src/ThemeManager.h +++ b/stepmania/src/ThemeManager.h @@ -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 );