remove LuaFunctionList
This commit is contained in:
@@ -26,7 +26,6 @@ struct Impl
|
|||||||
RageMutex g_pLock;
|
RageMutex g_pLock;
|
||||||
};
|
};
|
||||||
static Impl *pImpl = NULL;
|
static Impl *pImpl = NULL;
|
||||||
static LuaFunctionList *g_LuaFunctions = NULL;
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined (_XBOX)
|
#if defined(_MSC_VER) || defined (_XBOX)
|
||||||
/* "interaction between '_setjmp' and C++ object destruction is non-portable"
|
/* "interaction between '_setjmp' and C++ object destruction is non-portable"
|
||||||
@@ -279,9 +278,6 @@ void LuaManager::RegisterTypes()
|
|||||||
{
|
{
|
||||||
Lua *L = LUA->Get();
|
Lua *L = LUA->Get();
|
||||||
|
|
||||||
for( const LuaFunctionList *p = g_LuaFunctions; p; p=p->next )
|
|
||||||
lua_register( L, p->name, p->func );
|
|
||||||
|
|
||||||
if( g_vRegisterActorTypes )
|
if( g_vRegisterActorTypes )
|
||||||
{
|
{
|
||||||
for( unsigned i=0; i<g_vRegisterActorTypes->size(); i++ )
|
for( unsigned i=0; i<g_vRegisterActorTypes->size(); i++ )
|
||||||
@@ -790,15 +786,6 @@ void LuaHelpers::PushValueFunc( lua_State *L, int iArgs )
|
|||||||
lua_pushcclosure( L, lua_pushvalues, iArgs+1 );
|
lua_pushcclosure( L, lua_pushvalues, iArgs+1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
LuaFunctionList::LuaFunctionList( RString name_, lua_CFunction func_ )
|
|
||||||
{
|
|
||||||
name = name_;
|
|
||||||
func = func_;
|
|
||||||
next = g_LuaFunctions;
|
|
||||||
g_LuaFunctions = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static bool Trace( const RString &sString )
|
static bool Trace( const RString &sString )
|
||||||
{
|
{
|
||||||
LOG->Trace( "%s", sString.c_str() );
|
LOG->Trace( "%s", sString.c_str() );
|
||||||
|
|||||||
@@ -186,15 +186,6 @@ inline bool MyLua_checkintboolean( lua_State *L, int iArg )
|
|||||||
#define BArg(n) (MyLua_checkboolean(L,(n)))
|
#define BArg(n) (MyLua_checkboolean(L,(n)))
|
||||||
#define FArg(n) ((float) luaL_checknumber(L,(n)))
|
#define FArg(n) ((float) luaL_checknumber(L,(n)))
|
||||||
|
|
||||||
/* Linked list of functions we make available to Lua. */
|
|
||||||
struct LuaFunctionList
|
|
||||||
{
|
|
||||||
LuaFunctionList( RString name, lua_CFunction func );
|
|
||||||
RString name;
|
|
||||||
lua_CFunction func;
|
|
||||||
LuaFunctionList *next;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define LuaFunction( func, expr ) \
|
#define LuaFunction( func, expr ) \
|
||||||
int LuaFunc_##func( lua_State *L ) { \
|
int LuaFunc_##func( lua_State *L ) { \
|
||||||
LuaHelpers::Push( L, expr ); return 1; \
|
LuaHelpers::Push( L, expr ); return 1; \
|
||||||
|
|||||||
Reference in New Issue
Block a user