We're instantiating the class, not the class members.

This commit is contained in:
Steve Checkoway
2006-09-30 04:03:42 +00:00
parent 307b94e934
commit 0acebabd01
+5 -4
View File
@@ -129,6 +129,7 @@ namespace LuaHelpers { bool FromStack( lua_State *L, X &Object, int iOffset ); }
namespace LuaHelpers { void Push( lua_State *L, const X &Object ); }
#define LuaXType(X) \
template class EnumTraits<X>; \
static void Lua##X(lua_State* L) \
{ \
/* Create the EnumToString table: { "UnlockEntry_ArcadePoints", "UnlockEntry_DancePoints" } */ \
@@ -156,10 +157,10 @@ static void Lua##X(lua_State* L) \
lua_setglobal( L, #X "Index" ); \
} \
REGISTER_WITH_LUA_FUNCTION( Lua##X ); \
template<> LuaReference EnumTraits<X>::StringToEnum; \
template<> LuaReference EnumTraits<X>::EnumToString; \
template<> X EnumTraits<X>::Invalid = enum_add2( NUM_##X, 1 ); \
template<> const char *EnumTraits<X>::szName = #X; \
LuaReference EnumTraits<X>::StringToEnum; \
LuaReference EnumTraits<X>::EnumToString; \
X EnumTraits<X>::Invalid = enum_add2( NUM_##X, 1 ); \
const char *EnumTraits<X>::szName = #X; \
namespace LuaHelpers { bool FromStack( lua_State *L, X &Object, int iOffset ) { Object = Enum::Check<X>( L, iOffset ); return true; } } \
namespace LuaHelpers { void Push( lua_State *L, const X &Object ) { Enum::Push<X>( L, Object ); } }