From cc34c9bd6b0a6653336fd85b45e0e2e2fc545937 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 20 Mar 2005 05:39:32 +0000 Subject: [PATCH] add ThemeManager::ClearThemePathCache --- stepmania/src/ThemeManager.cpp | 5 +++++ stepmania/src/ThemeManager.h | 1 + 2 files changed, 6 insertions(+) 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 );