summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Data/DefaultContent/Libraries/GameLab/Entity.lua6
-rw-r--r--Data/DefaultContent/Libraries/GameLab/Node.lua0
-rw-r--r--Data/Libraries/GameLab/Editor/EditorWindow.lua5
-rw-r--r--Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua5
-rw-r--r--Data/Resources/Shaders/Editor-Text.glsl1
-rw-r--r--Documents/窗口.xlsxbin0 -> 160261 bytes
-rw-r--r--Editor/EditorApplication.h3
-rw-r--r--Editor/EditorMain.cpp5
-rw-r--r--Editor/GUI/ContainerWindow.cpp20
-rw-r--r--Editor/GUI/EditorWindows.h33
-rw-r--r--Editor/GUI/GUIWindow.cpp10
-rw-r--r--Runtime/GUI/Font.h8
12 files changed, 61 insertions, 35 deletions
diff --git a/Data/DefaultContent/Libraries/GameLab/Entity.lua b/Data/DefaultContent/Libraries/GameLab/Entity.lua
new file mode 100644
index 0000000..27769f3
--- /dev/null
+++ b/Data/DefaultContent/Libraries/GameLab/Entity.lua
@@ -0,0 +1,6 @@
+-- 游戏中的实体
+local Entity = GameLab.Class("GameLab.Entity")
+
+
+
+return Entity \ No newline at end of file
diff --git a/Data/DefaultContent/Libraries/GameLab/Node.lua b/Data/DefaultContent/Libraries/GameLab/Node.lua
deleted file mode 100644
index e69de29..0000000
--- a/Data/DefaultContent/Libraries/GameLab/Node.lua
+++ /dev/null
diff --git a/Data/Libraries/GameLab/Editor/EditorWindow.lua b/Data/Libraries/GameLab/Editor/EditorWindow.lua
index 0122b2c..d765031 100644
--- a/Data/Libraries/GameLab/Editor/EditorWindow.lua
+++ b/Data/Libraries/GameLab/Editor/EditorWindow.lua
@@ -1,7 +1,8 @@
-- EditorWindow是应用级别的逻辑窗口
-- ContainerWindow
--- |- GUIWindow
--- |- EditorWindow
+-- |- SplitWindow
+-- |- GUIWindow
+-- |- EditorWindow
local EditorWindow = GameLab.Class("GameLab.Editor.EditorWindow")
diff --git a/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua b/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua
new file mode 100644
index 0000000..275c2a7
--- /dev/null
+++ b/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua
@@ -0,0 +1,5 @@
+local GUIWindowScript = {}
+
+
+
+return GUIWindowScript \ No newline at end of file
diff --git a/Data/Resources/Shaders/Editor-Text.glsl b/Data/Resources/Shaders/Editor-Text.glsl
index d1003c3..b228198 100644
--- a/Data/Resources/Shaders/Editor-Text.glsl
+++ b/Data/Resources/Shaders/Editor-Text.glsl
@@ -44,3 +44,4 @@ void main()
FragColor = sampled;
}
FSH_END
+ \ No newline at end of file
diff --git a/Documents/窗口.xlsx b/Documents/窗口.xlsx
new file mode 100644
index 0000000..e0757bb
--- /dev/null
+++ b/Documents/窗口.xlsx
Binary files differ
diff --git a/Editor/EditorApplication.h b/Editor/EditorApplication.h
index 8c74d07..db47c7a 100644
--- a/Editor/EditorApplication.h
+++ b/Editor/EditorApplication.h
@@ -19,8 +19,7 @@ public:
void OnQuit();
-private :
-
+private:
LUA_BIND_DECL_CLASS(EditorApplication);
LUA_BIND_DECL_METHOD(_New);
diff --git a/Editor/EditorMain.cpp b/Editor/EditorMain.cpp
index 3c6b893..7d7f07c 100644
--- a/Editor/EditorMain.cpp
+++ b/Editor/EditorMain.cpp
@@ -18,13 +18,8 @@ void ErrorHandle(cc8* msg)
log_error("[Lua] %s", msg);
}
-void TestFont()
-{
-}
-
int BeforeMainLoop(lua_State* L)
{
- TestFont();
return 0;
}
diff --git a/Editor/GUI/ContainerWindow.cpp b/Editor/GUI/ContainerWindow.cpp
index f7d9e45..57b1b48 100644
--- a/Editor/GUI/ContainerWindow.cpp
+++ b/Editor/GUI/ContainerWindow.cpp
@@ -14,10 +14,13 @@ static bool s_IsMainWindowMaximized;
extern bool ProcessMainWindowMessages(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT& result);
-static PAINTSTRUCT ps;
LRESULT CALLBACK ContainerWindow::ContainerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
-
+#if GAMELAB_DEBUG
+ static int _event_count = 0;
+ log_info_tag("WndProc", "ContrainerWindow Event %d", ++_event_count);
+#endif
+
ContainerWindow *self = (ContainerWindow*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (!self)
{
@@ -25,8 +28,6 @@ LRESULT CALLBACK ContainerWindow::ContainerWndProc(HWND hWnd, UINT message, WPAR
return DefWindowProcW(hWnd, message, wParam, lParam);
}
- //log_info_tag("WndProc", "ContainerWindow::ContainerWndProc(), ContainerWindow name is " + self->GetName());
-
switch (message)
{
case WM_MENUSELECT:
@@ -43,6 +44,7 @@ LRESULT CALLBACK ContainerWindow::ContainerWndProc(HWND hWnd, UINT message, WPAR
return WM_SETICON;
case WM_PAINT:
{
+ static PAINTSTRUCT ps;
log_info("WM_PAINT");
self->SetAsRenderContext();
glEnable(GL_BLEND);
@@ -343,9 +345,9 @@ void ContainerWindow::Init(Rect pixelRect, int showMode, const Vector2& minSize,
// parentWindow = GetMainEditorWindow();
}
- bool notSizeable = (minSize == maxSize) && (minSize != Vector2::zero);
- if (notSizeable)
- windowStyle &= ~(WS_THICKFRAME);
+ //bool notSizeable = (minSize == maxSize) && (minSize != Vector2::zero);
+ //if (notSizeable)
+ // windowStyle &= ~(WS_THICKFRAME);
AdjustWindowRectEx(&rect, windowStyle, showMode == kShowMainWindow, extendedStyle);
int extraX = rect.right - rect.left - 200;
@@ -379,8 +381,8 @@ void ContainerWindow::Init(Rect pixelRect, int showMode, const Vector2& minSize,
if (pixelRect.width > 10 || pixelRect.height > 10)
{
//SetRect(pixelRect);
- if (shouldMaximize)
- SetWindowLong(m_Window, GWL_STYLE, windowStyle | WS_MAXIMIZE);
+ //if (shouldMaximize)
+ // SetWindowLong(m_Window, GWL_STYLE, windowStyle | WS_MAXIMIZE);
}
if (showMode == kShowMainWindow)
diff --git a/Editor/GUI/EditorWindows.h b/Editor/GUI/EditorWindows.h
index a8c96ad..d8a3f66 100644
--- a/Editor/GUI/EditorWindows.h
+++ b/Editor/GUI/EditorWindows.h
@@ -75,10 +75,10 @@ public:
private:
bool SetRenderContext();
+ //--------------------------------------------------------
+
std::string m_Name;
- HWND m_Window;
- HDC m_DC;
POINT m_Size;
ShowMode m_ShowMode; //
bool m_IsClosing;
@@ -88,6 +88,13 @@ private:
POINT m_MinSize;
POINT m_MaxSize;
+#ifdef GAMELAB_WIN
+ HWND m_Window;
+ HDC m_DC;
+#endif
+
+ //--------------------------------------------------------
+
LUA_BIND_DECL_CLASS(ContainerWindow);
LUA_BIND_DECL_METHOD(_New);
@@ -97,12 +104,11 @@ private:
};
-// ڻ
class WindowBase
{
};
-// 󴰿ڣ
+// 󴰿ڣ֣SplitWindowǶ׵
class SplitWindow : public WindowBase
{
public:
@@ -119,7 +125,10 @@ public:
private:
SplitMode m_SplitMode;
- GUIWindow* m_GUIWindow;
+ // Ƕsplit
+ std::vector< SplitWindow*> m_ChildSplitWindows;
+
+ // split windowGUIWindows
std::vector<GUIWindow*>* m_GUIWindows;
};
@@ -158,12 +167,17 @@ private:
std::string m_Name;
ContainerWindow* m_ContainerWindow;
- HWND m_Handle;
- HDC m_DC;
- std::vector<LuaBind::MemberRef> m_EditorWindows;
+ std::vector<LuaBind::MemberRef> m_EditorWindows;
LuaBind::MemberRef m_EditorWindow; // EditorWindowű
- LuaBind::MemberRef m_Script; // EditorWindowű
+ LuaBind::MemberRef m_ActiveEditorWindow; // ǰEditorWindow
+
+ LuaBind::MemberRef m_Script; // EditorWindowű
+
+#if GAMELAB_WIN
+ HWND m_Handle;
+ HDC m_DC;
+#endif
//-----------------------------------------------------------------
@@ -174,7 +188,6 @@ private:
LUA_BIND_DECL_METHOD(_Focus);
LUA_BIND_DECL_METHOD(_SetContainerWindow);
LUA_BIND_DECL_METHOD(_SetPosition);
-
LUA_BIND_DECL_METHOD(_SetInstance);
};
diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp
index cd49445..6bf7fd8 100644
--- a/Editor/GUI/GUIWindow.cpp
+++ b/Editor/GUI/GUIWindow.cpp
@@ -25,9 +25,13 @@ static bool RedirectMouseWheel(HWND window, WPARAM wParam, LPARAM lParam)
return true;
}
-static PAINTSTRUCT ps;
LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
+#if GAMELAB_DEBUG
+ static int _event_count = 0;
+ log_info_tag("WndProc", "GUIWindow Event %d", ++_event_count);
+#endif
+
GUIWindow* self = (GUIWindow*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (!self)
{
@@ -35,8 +39,6 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
return DefWindowProcW(hWnd, message, wParam, lParam);
}
- //log_info_tag("WndProc", "GUIWindow::GUIViewWndProc(), GUIWindow name is %s", self->GetName());
-
switch (message)
{
case WM_ERASEBKGND:
@@ -45,6 +47,8 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
case WM_PAINT:
{
+ static PAINTSTRUCT ps;
+
log_info_tag("WndProc", "WM_PAINT");
self->SetAsRenderContext();
diff --git a/Runtime/GUI/Font.h b/Runtime/GUI/Font.h
index df0bc7b..4bcc70b 100644
--- a/Runtime/GUI/Font.h
+++ b/Runtime/GUI/Font.h
@@ -29,9 +29,9 @@ namespace character
typedef unsigned int Unicode; // unicode codepointBMPU+0000U+FFFF)
#endif
+#pragma pack(1)
union Hash {
unsigned int hashCode;
-#pragma pack(1)
struct {
Unicode codepoint;
unsigned short size;//С
@@ -66,11 +66,11 @@ namespace std
struct GlyphAtals
{
int index;
- Texture* altas; // ͼ
- int width, height; // ߴ
+ Texture* altas; // ͼ
+ int width, height; // ߴ
Vector2 cursor; // α꣬Ͻǣ0,0ʼ
- int rowHeight; // ǰеĸ߶
+ int rowHeight; // ǰеĸ߶
};
struct TextGeneratingSettings