flip GetMetric(ref) and GetMetricR(), so there's an interface exposed that doens't
copy the reference. Copying refs isn't expensive, but it does lock Lua.
This commit is contained in:
@@ -971,14 +971,18 @@ RageColor ThemeManager::GetMetricC( const RString &sClassName, const RString &sV
|
||||
}
|
||||
|
||||
LuaReference ThemeManager::GetMetricR( const RString &sClassName, const RString &sValueName )
|
||||
{
|
||||
LuaReference ref;
|
||||
GetMetric( sClassName, sValueName, ref );
|
||||
return ref;
|
||||
}
|
||||
|
||||
void ThemeManager::GetMetric( const RString &sClassName, const RString &sValueName, LuaReference &valueOut )
|
||||
{
|
||||
RString sValue = GetMetricRaw( g_pLoadedThemeData->iniMetrics, sClassName, sValueName );
|
||||
|
||||
LuaHelpers::PrepareExpression( sValue );
|
||||
|
||||
LuaReference ref;
|
||||
ref.SetFromExpression( sValue );
|
||||
return ref;
|
||||
valueOut.SetFromExpression( sValue );
|
||||
}
|
||||
|
||||
#if !defined(SMPACKAGE)
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
void GetMetric( const RString &sClassName, const RString &sValueName, float &valueOut ) { valueOut = GetMetricF( sClassName, sValueName ); }
|
||||
void GetMetric( const RString &sClassName, const RString &sValueName, bool &valueOut ) { valueOut = GetMetricB( sClassName, sValueName ); }
|
||||
void GetMetric( const RString &sClassName, const RString &sValueName, RageColor &valueOut ) { valueOut = GetMetricC( sClassName, sValueName ); }
|
||||
void GetMetric( const RString &sClassName, const RString &sValueName, LuaReference &valueOut ) { valueOut = GetMetricR( sClassName, sValueName ); }
|
||||
void GetMetric( const RString &sClassName, const RString &sValueName, LuaReference &valueOut );
|
||||
#if !defined(SMPACKAGE)
|
||||
void GetMetric( const RString &sClassName, const RString &sValueName, apActorCommands &valueOut );
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user