summaryrefslogtreecommitdiff
path: root/Editor/EditorMain.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-17 23:05:01 +0800
committerchai <chaifix@163.com>2021-10-17 23:05:01 +0800
commit7c8c68d79343d04be382334c15a73d079450857c (patch)
tree9aaacc042f0b7eeb4123c07dcc5f49c14fd8026c /Editor/EditorMain.cpp
parent6e73ca6ada8a41692809dae5db89c8db0675ce1e (diff)
*misc
Diffstat (limited to 'Editor/EditorMain.cpp')
-rw-r--r--Editor/EditorMain.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/Editor/EditorMain.cpp b/Editor/EditorMain.cpp
index 8fea1df..9745598 100644
--- a/Editor/EditorMain.cpp
+++ b/Editor/EditorMain.cpp
@@ -1,11 +1,13 @@
#include <windows.h>
#include <vector>
#include "GUI/EditorWindows.h"
-#include "Runtime/Scripting/LuaBind.h"
+#include "Runtime/LuaBind/LuaBind.h"
#include "EditorManager.h"
#include "Runtime/Graphics/OpenGL.h"
#include "Editor/Scripting/EditorScripting.h"
+using namespace LuaBind;
+
static int MainLoop()
{
BOOL returnValue;
@@ -37,6 +39,20 @@ void OpenLogTags()
{
//log_open_tag("WndProc");
//log_open_tag("Menu");
+ log_open_tag("Scripting");
+}
+
+void InitLuaState()
+{
+ LuaBind::VM vm;
+ vm.Setup();
+ vm.OpenLibs();
+ if (!SetupGameLabEditorScripting(vm.GetMainThread()))
+ {
+ log_error("Can't setup scripting.");
+ }
+ LuaBind::State state = vm.GetMainState();
+ state.DoFile("./Scripts/EditorApplication.lua");
}
#ifdef GAMELAB_DEBUG
@@ -48,11 +64,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
OpenLogTags();
WindowUtil::Init();
- if (!SetupGameLabEditorScripting())
- {
- log_error("Can't setup scripting.");
- return 0;
- }
+ InitLuaState();
ContainnerWindow* wnd = new ContainnerWindow();
Vector2f min = Vector2f(100, 100);