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().
This commit is contained in:
Glenn Maynard
2006-09-22 21:23:13 +00:00
parent 4ae6eb6070
commit 09afb81741
+1 -1
View File
@@ -1160,7 +1160,7 @@ class LunaThemeManager: public Luna<ThemeManager>
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; }