From d24f17b88d901b779c81c7434995675eb2a17429 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 4 Nov 2021 12:55:25 +0800 Subject: - Internal:: --- Editor/GUI/ContainerWindow.cpp | 5 +++-- Editor/GUI/EditorWindows.h | 9 +++++---- Editor/GUI/GUIWindow.cpp | 5 +++-- Editor/GUI/WindowManager.cpp | 7 ++++--- 4 files changed, 15 insertions(+), 11 deletions(-) (limited to 'Editor/GUI') diff --git a/Editor/GUI/ContainerWindow.cpp b/Editor/GUI/ContainerWindow.cpp index d737838..f7d9e45 100644 --- a/Editor/GUI/ContainerWindow.cpp +++ b/Editor/GUI/ContainerWindow.cpp @@ -6,6 +6,7 @@ #include "MenuManager.h" #include "Runtime/Utilities/Assert.h" #include "Editor/Graphics/Graphics.h" +#include "Runtime/Math/Math.h" using namespace std; @@ -273,7 +274,7 @@ bool ContainerWindow::SetRenderContext() } // 初始化,创建窗口 -void ContainerWindow::Init(Internal::Rect pixelRect, int showMode, const Internal::Vector2& minSize, const Internal::Vector2& maxSize, std::string name) +void ContainerWindow::Init(Rect pixelRect, int showMode, const Vector2& minSize, const Vector2& maxSize, std::string name) { // Aux windows are mac only. on windows they look just like normal utility windows. if (showMode == kShowAuxWindow) @@ -342,7 +343,7 @@ void ContainerWindow::Init(Internal::Rect pixelRect, int showMode, const Interna // parentWindow = GetMainEditorWindow(); } - bool notSizeable = (minSize == maxSize) && (minSize != Internal::Vector2::zero); + bool notSizeable = (minSize == maxSize) && (minSize != Vector2::zero); if (notSizeable) windowStyle &= ~(WS_THICKFRAME); diff --git a/Editor/GUI/EditorWindows.h b/Editor/GUI/EditorWindows.h index e1ad89a..78d9ca8 100644 --- a/Editor/GUI/EditorWindows.h +++ b/Editor/GUI/EditorWindows.h @@ -11,6 +11,7 @@ #include "Runtime/Graphics/OpenGL.h" #include "Runtime/Utilities/UtilMacros.h" #include "Editor/Utils/HelperFuncs.h" +#include "Runtime/Math/Math.h" using namespace LuaBind; @@ -29,7 +30,7 @@ public : class WindowManager : Singleton { public: - static Internal::Vector2 GetMousePosition(); + static Vector2 GetMousePosition(); static GUIWindow* GetMouseOverWindow(); private: @@ -56,7 +57,7 @@ public: ContainerWindow(LuaBind::VM* vm); ~ContainerWindow(); - void Init(Internal::Rect size, int showMode, const Internal::Vector2& minSize, const Internal::Vector2& maxSize, std::string name = ""); + void Init(Rect size, int showMode, const Vector2& minSize, const Vector2& maxSize, std::string name = ""); void SetTitle(const char* title); void SetIcon(LPCSTR iconName); void SetAsRenderContext(); @@ -83,7 +84,7 @@ private: bool m_IsClosing; bool m_InMenuLoop; bool m_CloseFromScriptDontShutdown; - Internal::Rect m_InternalRect; + Rect m_InternalRect; POINT m_MinSize; POINT m_MaxSize; @@ -138,7 +139,7 @@ public: void DoPaint(); void SetContainerWindow(ContainerWindow* wnd); void Focus(); - void SetPosition(Internal::Rect position); + void SetPosition(Rect position); void SetAsRenderContext(); void OnFocus(); diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp index 011dfa8..cd49445 100644 --- a/Editor/GUI/GUIWindow.cpp +++ b/Editor/GUI/GUIWindow.cpp @@ -3,6 +3,7 @@ #include "Runtime/Graphics/OpenGL.h" #include "Editor/Graphics/Graphics.h" #include "Editor/Win/Win.h" +#include "Runtime/Math/Math.h" static bool RedirectMouseWheel(HWND window, WPARAM wParam, LPARAM lParam) { @@ -201,7 +202,7 @@ void GUIWindow::Init(std::string name) //DWORD windowStyle = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_CLIPCHILDREN | WS_MAXIMIZEBOX | WS_MINIMIZEBOX; DWORD extendedStyle = WS_EX_TOOLWINDOW; - Internal::Rect pixelRect; + Rect pixelRect; pixelRect.x = 0; pixelRect.y = 0; pixelRect.width = 32; @@ -316,7 +317,7 @@ void GUIWindow::OnPaint() InvokeLuaCallback(m_Script, "OnGUI"); } -void GUIWindow::SetPosition(Internal::Rect position) +void GUIWindow::SetPosition(Rect position) { log_info("GUIWindow::SetPosition()"); RECT rc; diff --git a/Editor/GUI/WindowManager.cpp b/Editor/GUI/WindowManager.cpp index d6d8b1e..5ba3086 100644 --- a/Editor/GUI/WindowManager.cpp +++ b/Editor/GUI/WindowManager.cpp @@ -1,5 +1,6 @@ #include "EditorWindows.h" #include "WinUtils.h" +#include "Runtime/Math/Math.h" std::vector WindowManager::s_GUIWindows; @@ -8,12 +9,12 @@ GUIWindow* WindowManager::GetMouseOverWindow() return NULL; } -Internal::Vector2 WindowManager::GetMousePosition() +Vector2 WindowManager::GetMousePosition() { POINT pt; if (!GetCursorPos(&pt)) - return Internal::Vector2(0, 0); + return Vector2(0, 0); - return Internal::Vector2(pt.x, pt.y); + return Vector2(pt.x, pt.y); } -- cgit v1.1-26-g67d0