rename GetMetricRaw overload to GetMetricRawRecursive for clarity

This commit is contained in:
Glenn Maynard
2005-09-04 05:26:44 +00:00
parent 286c008b41
commit fa2fa3d526
2 changed files with 8 additions and 8 deletions
+7 -7
View File
@@ -328,7 +328,7 @@ CString ThemeManager::GetPathToAndFallback( const CString &sThemeName, ElementCa
// search fallback name (if any) // search fallback name (if any)
CString sFallback; CString sFallback;
GetMetricRaw( sClass, "Fallback", sFallback ); GetMetricRawRecursive( sClass, "Fallback", sFallback );
if( sFallback.empty() ) if( sFallback.empty() )
return NULL; return NULL;
sClass = sFallback; sClass = sFallback;
@@ -556,7 +556,7 @@ CString ThemeManager::GetMetricsIniPath( const CString &sThemeName )
bool ThemeManager::HasMetric( const CString &sClassName, const CString &sValueName ) bool ThemeManager::HasMetric( const CString &sClassName, const CString &sValueName )
{ {
CString sThrowAway; CString sThrowAway;
return GetMetricRaw( sClassName, sValueName, sThrowAway ); return GetMetricRawRecursive( sClassName, sValueName, sThrowAway );
} }
void ThemeManager::ReloadMetrics() void ThemeManager::ReloadMetrics()
@@ -579,7 +579,7 @@ void ThemeManager::ReloadMetrics()
} }
bool ThemeManager::GetMetricRaw( const CString &sClassName, const CString &sValueName, CString &ret, int level ) bool ThemeManager::GetMetricRawRecursive( const CString &sClassName, const CString &sValueName, CString &ret, int level )
{ {
if( level > 100 ) if( level > 100 )
RageException::Throw("Infinite recursion looking up theme metric \"%s::%s\"", sClassName.c_str(), sValueName.c_str() ); RageException::Throw("Infinite recursion looking up theme metric \"%s::%s\"", sClassName.c_str(), sValueName.c_str() );
@@ -592,7 +592,7 @@ bool ThemeManager::GetMetricRaw( const CString &sClassName, const CString &sValu
return true; return true;
if( iter->iniMetrics->GetValue(sClassName,"Fallback",sFallback) ) if( iter->iniMetrics->GetValue(sClassName,"Fallback",sFallback) )
{ {
if( GetMetricRaw(sFallback,sValueName,ret,level+1) ) if( GetMetricRawRecursive(sFallback,sValueName,ret,level+1) )
return true; return true;
} }
} }
@@ -610,7 +610,7 @@ CString ThemeManager::GetMetricRaw( const CString &sClassName_, const CString &s
try_metric_again: try_metric_again:
CString ret; CString ret;
if( ThemeManager::GetMetricRaw( sClassName, sValueName, ret ) ) if( ThemeManager::GetMetricRawRecursive( sClassName, sValueName, ret ) )
return ret; return ret;
@@ -801,7 +801,7 @@ void ThemeManager::GetMetricsThatBeginWith( const CString &_sClassName, const CS
continue; continue;
// Iterate over all metrics that match. // Iterate over all metrics that match.
for( XAttrs::const_iterator j = cur->m_attrs.lower_bound( sValueName ); j != cur->m_attrs.end(); j++ ) for( XAttrs::const_iterator j = cur->m_attrs.lower_bound( sValueName ); j != cur->m_attrs.end(); ++j )
{ {
const CString &sv = j->first; const CString &sv = j->first;
if( sv.Left(sValueName.size()) == sValueName ) if( sv.Left(sValueName.size()) == sValueName )
@@ -813,7 +813,7 @@ void ThemeManager::GetMetricsThatBeginWith( const CString &_sClassName, const CS
// put the fallback (if any) in sClassName // put the fallback (if any) in sClassName
CString sFallback; CString sFallback;
if( GetMetricRaw( sClassName, "Fallback", sFallback ) ) if( GetMetricRawRecursive( sClassName, "Fallback", sFallback ) )
sClassName = sFallback; sClassName = sFallback;
else else
sClassName = ""; sClassName = "";
+1 -1
View File
@@ -98,7 +98,7 @@ public:
protected: protected:
void RunLuaScripts( const CString &sMask ); void RunLuaScripts( const CString &sMask );
void LoadThemeRecursive( deque<Theme> &theme, const CString &sThemeName ); void LoadThemeRecursive( deque<Theme> &theme, const CString &sThemeName );
bool GetMetricRaw( const CString &sClassName, const CString &sValueName, CString &ret, int level=0 ); bool GetMetricRawRecursive( const CString &sClassName, const CString &sValueName, CString &ret, int level=0 );
CString GetPathToAndFallback( const CString &sThemeName, ElementCategory category, const CString &sClassName, const CString &sFile ); CString GetPathToAndFallback( const CString &sThemeName, ElementCategory category, const CString &sClassName, const CString &sFile );
CString GetPathToRaw( const CString &sThemeName, ElementCategory category, const CString &sClassName, const CString &sFile ); CString GetPathToRaw( const CString &sThemeName, ElementCategory category, const CString &sClassName, const CString &sFile );
static CString GetThemeDirFromName( const CString &sThemeName ); static CString GetThemeDirFromName( const CString &sThemeName );