diff options
Diffstat (limited to 'source/3rd-party/Luax')
-rw-r--r-- | source/3rd-party/Luax/luax_class.cpp | 14 | ||||
-rw-r--r-- | source/3rd-party/Luax/luax_class.hpp | 7 | ||||
-rw-r--r-- | source/3rd-party/Luax/luax_class.inl | 8 |
3 files changed, 16 insertions, 13 deletions
diff --git a/source/3rd-party/Luax/luax_class.cpp b/source/3rd-party/Luax/luax_class.cpp index e2019d4..9f316c1 100644 --- a/source/3rd-party/Luax/luax_class.cpp +++ b/source/3rd-party/Luax/luax_class.cpp @@ -73,7 +73,7 @@ namespace Luax } /// - /// NewnԻȡCtorCtorʼʵ + /// NewnԻȡ__init__initʼʵ /// int LuaxPlainClass::l_New(lua_State* L) { @@ -95,11 +95,11 @@ namespace Luax lua_setmetatable(L, -2); // ҵ캯ᴥmetatable.__index,ݼ̳ҡ - lua_getfield(L, classTable, "Ctor"); + lua_getfield(L, classTable, "__init"); if (state.IsType(-1, LUA_TFUNCTION)) { // stack: - // -1: Ctor() + // -1: __init() // -2: instance // -3~-n-2: params @@ -107,27 +107,27 @@ namespace Luax // stack: // -1: instance // -2~-n-1: params - // -n-2: Ctor() + // -n-2: __init() lua_pushvalue(L, -1); // stack: // -1: instance // -2: instance // -3~-n-2: params - // -n-3: Ctor + // -n-3: __init lua_insert(L, -3 - n); // stack: // -1: instance // -2~-n-1: params - // -n-2: Ctor() + // -n-2: __init() // -n-3: instance lua_insert(L, -1 - n); // stack: // -1~-n: params // -n-1: instance - // -n-2: Ctor() + // -n-2: __init() // -n-3: instance lua_pcall(L, n + 1, 0, 0); diff --git a/source/3rd-party/Luax/luax_class.hpp b/source/3rd-party/Luax/luax_class.hpp index 3d7ede6..af52b5f 100644 --- a/source/3rd-party/Luax/luax_class.hpp +++ b/source/3rd-party/Luax/luax_class.hpp @@ -11,8 +11,6 @@ namespace Luax { -#define LUAX_DECL_METHOD(mtd) static int mtd(lua_State* L) - /// /// RegisterLuaxClass עķͳԱö١ȵclass table /// LuaxGetFactoryName ùͬʱעʱעΪsingletonͨʱ @@ -35,6 +33,10 @@ namespace Luax static const char* GetLuaxClassName() { return #type; }; \ static bool IsLuaxClassSingleton() { return true; }; +#define LUAX_DECL_METHOD(mtd) static int mtd(lua_State* L) + +#define LUAX_DECL_ENUM(e) + /// /// ʵֵĺꡣһL /// @@ -106,6 +108,7 @@ namespace Luax /// /// userdata pushջûгʼmUserdataʼúԪѳʼõuserdataջһá + /// һnativeȨƽluaƵķ /// bool PushLuaxUserdata(LuaxState& state); bool PushLuaxMemberTable(LuaxState& state); diff --git a/source/3rd-party/Luax/luax_class.inl b/source/3rd-party/Luax/luax_class.inl index e2b8de8..7ee3de9 100644 --- a/source/3rd-party/Luax/luax_class.inl +++ b/source/3rd-party/Luax/luax_class.inl @@ -363,8 +363,8 @@ namespace Luax #if LUAX_ENABLE_NATIVE_EXTEND /// - /// ࣬luaijԱΪƣDZ֤userdataͳһNative classṩCtor֧֣ - /// nativeʵ崴ʹCtorгʼӵкͻһNewбnativeһ͡ + /// ࣬luaijԱΪƣDZ֤userdataͳһNative classṩ__init֧֣ + /// nativeʵ崴ʹ__initгʼӵкͻһNewбnativeһ͡ /// template<typename T> int LuaxNativeClass<T>::l_ExtendFactory(lua_State* L) @@ -541,8 +541,8 @@ namespace Luax int args = state.AbsIndex(-1 - n); - // ԵCtor - lua_getfield(L, lua_upvalueindex(1), "Ctor"); + // Ե__init + lua_getfield(L, lua_upvalueindex(1), "__init"); if (state.IsType(-1, LUA_TFUNCTION)) { |