From b4abd6f067f088f554c1fb643502b8ee98b37afb Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 2 Mar 2006 05:31:14 +0000 Subject: [PATCH] simplify clearing theme path cache; fix it when changing languages --- stepmania/src/ThemeManager.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index ae7d747ef0..c0270a4872 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -327,12 +327,11 @@ void ThemeManager::SwitchThemeAndLanguage( const RString &sThemeName_, const RSt bool bThemeChanging = (sThemeName != m_sCurThemeName); LoadThemeMetrics( g_vThemes, sThemeName, sLanguage ); + // Clear the theme path cache. This caches language-specific graphic paths, so do this + // even if only the language is changing. + ClearThemePathCache(); if( bThemeChanging ) { - // clear theme path cache - for( int i = 0; i < NUM_ElementCategory; ++i ) - g_ThemePathCache[i].clear(); - #if !defined(SMPACKAGE) // reload common sounds if( SCREENMAN != NULL ) @@ -718,11 +717,7 @@ void ThemeManager::ReloadMetrics() SCREENMAN->SystemMessage( RELOADED_METRICS ); #endif - // - // clear theme path cache - // - for( int i = 0; i < NUM_ElementCategory; ++i ) - g_ThemePathCache[i].clear(); + ClearThemePathCache(); }