From 09afb81741cec9657b4060542ddb761a73344af0 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 22 Sep 2006 21:23:13 +0000 Subject: [PATCH] GetMetric pushes the metric directly. This is faster, avoiding converting the metric to a string and then back into Lua, and works with any type; with "Class::Metric=math.sin", THEME:GetMetric("Class","Metric") will return the function sin(). --- stepmania/src/ThemeManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 497770b8e6..fcd9c0e878 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -1160,7 +1160,7 @@ class LunaThemeManager: public Luna public: LunaThemeManager() { LUA->Register( Register ); } - static int GetMetric( T* p, lua_State *L ) { lua_pushstring(L, p->GetMetric(SArg(1),SArg(2)) ); return 1; } + static int GetMetric( T* p, lua_State *L ) { p->PushMetric( L, SArg(1),SArg(2) ); return 1; } static int GetString( T* p, lua_State *L ) { lua_pushstring(L, p->GetString(SArg(1),SArg(2)) ); return 1; } static int GetPathG( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathG(SArg(1),SArg(2)) ); return 1; } static int GetPathB( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathB(SArg(1),SArg(2)) ); return 1; }