summaryrefslogtreecommitdiff
path: root/Editor
diff options
context:
space:
mode:
Diffstat (limited to 'Editor')
-rw-r--r--Editor/EditorMain.cpp16
-rw-r--r--Editor/GUI/GUIWindow.cpp6
2 files changed, 6 insertions, 16 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()))
{
diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp
index df28785..621eb54 100644
--- a/Editor/GUI/GUIWindow.cpp
+++ b/Editor/GUI/GUIWindow.cpp
@@ -44,8 +44,10 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
case WM_PAINT:
{
log_info("WndProc", "WM_PAINT");
+
self->SetAsRenderContext();
self->OnPaint();
+
BeginPaint(self->m_Handle, &ps);
EndPaint(self->m_Handle, &ps);
UpdateWindow(self->m_Handle);
@@ -104,6 +106,8 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
{
SetFocus(hWnd);
+ self->DoPaint();
+
if (/*processInput && !focused*/ true)
{
//focused = (GetFocus() == hWnd);
@@ -323,7 +327,7 @@ void GUIWindow::OnLostFocus()
void GUIWindow::OnPaint()
{
- InvokeLuaCallback(m_Script, "OnPaint");
+ InvokeLuaCallback(m_Script, "OnGUI");
}
void GUIWindow::SetPosition(Rect position)