summaryrefslogtreecommitdiff
path: root/Editor/EditorMain.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-25 03:22:49 +0800
committerchai <chaifix@163.com>2021-10-25 03:22:49 +0800
commit0816cd70ca1a213b6ed872bcf3c0bf0912473722 (patch)
treeede23a398e78106551434ca762362ca04fd1ba8c /Editor/EditorMain.cpp
parent180b715e72ffc292ebbc4695f8a63ce449004d27 (diff)
*misc
Diffstat (limited to 'Editor/EditorMain.cpp')
-rw-r--r--Editor/EditorMain.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/Editor/EditorMain.cpp b/Editor/EditorMain.cpp
index 7686fa5..555867a 100644
--- a/Editor/EditorMain.cpp
+++ b/Editor/EditorMain.cpp
@@ -15,26 +15,12 @@ void ErrorHandle(cc8* msg)
log_error(std::string("[Lua] ") + msg);
}
-void OnRegisterNativeClass(LuaBind::State& state, int cls, std::string clsName, std::string pkgName)
-{
- // 填充类型的元数据
- lua_newtable(state);
- int typeIdx = state.GetTop();
- state.Push("native");
- state.SetField(typeIdx, "mode");
- state.Push(clsName);
- state.SetField(typeIdx, "name");
- state.Push(pkgName);
- state.SetField(typeIdx, "package");
- lua_setfield(state, cls, "_type");
-}
-
void InitLuaState(LuaBind::VM& vm)
{
vm.Setup();
vm.OpenLibs();
- LuaBind::onRegisterNativeClass = OnRegisterNativeClass;
+ LuaBind::onRegisterNativeClass = LuaHelper::OnRegisterNativeClass;
if (!SetupGameLabEditorScripting(vm.GetMainThread()))
{