Don't create a new class just to register a function with lua.
This commit is contained in:
@@ -155,9 +155,9 @@ for( const int UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \
|
|||||||
lua_settop(L,UNIQUE_NAME(top)) )
|
lua_settop(L,UNIQUE_NAME(top)) )
|
||||||
|
|
||||||
|
|
||||||
|
struct RegisterLuaFunction { RegisterLuaFunction( RegisterWithLuaFn pfn ) { LuaManager::Register( pfn ); } };
|
||||||
#define REGISTER_WITH_LUA_FUNCTION( Fn ) \
|
#define REGISTER_WITH_LUA_FUNCTION( Fn ) \
|
||||||
class Register##Fn { public: Register##Fn() { LuaManager::Register( Fn ); } }; \
|
static RegisterLuaFunction register##Fn( Fn );
|
||||||
static Register##Fn register##Fn;
|
|
||||||
|
|
||||||
inline bool MyLua_checkboolean (lua_State *L, int numArg)
|
inline bool MyLua_checkboolean (lua_State *L, int numArg)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user