cleanup
This commit is contained in:
@@ -171,12 +171,12 @@ static int LuaPanic( lua_State *L )
|
||||
|
||||
|
||||
// Actor registration
|
||||
static vector<RegisterActorFn> *g_vRegisterActorTypes = NULL;
|
||||
static vector<RegisterWithLuaFn> *g_vRegisterActorTypes = NULL;
|
||||
|
||||
void LuaManager::Register( RegisterActorFn pfn )
|
||||
void LuaManager::Register( RegisterWithLuaFn pfn )
|
||||
{
|
||||
if( g_vRegisterActorTypes == NULL )
|
||||
g_vRegisterActorTypes = new vector<RegisterActorFn>;
|
||||
g_vRegisterActorTypes = new vector<RegisterWithLuaFn>;
|
||||
|
||||
g_vRegisterActorTypes->push_back( pfn );
|
||||
}
|
||||
@@ -205,7 +205,7 @@ void LuaManager::RegisterTypes()
|
||||
{
|
||||
for( unsigned i=0; i<g_vRegisterActorTypes->size(); i++ )
|
||||
{
|
||||
RegisterActorFn fn = (*g_vRegisterActorTypes)[i];
|
||||
RegisterWithLuaFn fn = (*g_vRegisterActorTypes)[i];
|
||||
fn( L );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
#ifndef LUA_HELPERS_H
|
||||
#define LUA_HELPERS_H
|
||||
#ifndef LUA_MANAGER_H
|
||||
#define LUA_MANAGER_H
|
||||
|
||||
struct lua_State;
|
||||
class LuaManager;
|
||||
typedef void (*RegisterActorFn)(lua_State*);
|
||||
typedef void (*RegisterWithLuaFn)(lua_State*);
|
||||
|
||||
class LuaManager
|
||||
{
|
||||
public:
|
||||
// Every Actor should register its class at program initialization.
|
||||
static void Register( RegisterActorFn pfn );
|
||||
static void Register( RegisterWithLuaFn pfn );
|
||||
|
||||
LuaManager();
|
||||
~LuaManager();
|
||||
|
||||
Reference in New Issue
Block a user