From bdff1ff90f8a3545bda5c9428c38b9968ba90e03 Mon Sep 17 00:00:00 2001 From: t-rvw <429601557@qq.com> Date: Tue, 7 Nov 2023 03:33:05 +0800 Subject: [PATCH] update --- Engine/Source/Editor/EditorApp.cpp | 2 +- Engine/Source/Editor/EditorApp.h | 3 +++ Engine/Source/Runtime/Window/Window.h | 1 - Engine/Source/Runtime/Window/WindowManager.cpp | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Engine/Source/Editor/EditorApp.cpp b/Engine/Source/Editor/EditorApp.cpp index ad8d8a4b..bc89e206 100644 --- a/Engine/Source/Editor/EditorApp.cpp +++ b/Engine/Source/Editor/EditorApp.cpp @@ -187,7 +187,7 @@ void EditorApp::InitEditorUILayers() auto pAssetBrowser = std::make_unique("AssetBrowser"); pAssetBrowser->SetSceneRenderer(m_pSceneRenderer); - GetMainWindow()->OnDropFile.Bind(pAssetBrowser.get()); + OnDropFile.Bind(pAssetBrowser.get()); m_pEditorImGuiContext->AddDynamicLayer(cd::MoveTemp(pAssetBrowser)); m_pEditorImGuiContext->AddDynamicLayer(std::make_unique("OutputLog")); diff --git a/Engine/Source/Editor/EditorApp.h b/Engine/Source/Editor/EditorApp.h index 0fb73e87..5c310c34 100644 --- a/Engine/Source/Editor/EditorApp.h +++ b/Engine/Source/Editor/EditorApp.h @@ -111,6 +111,9 @@ class EditorApp final : public engine::IApplication engine::Renderer* m_pTerrainRenderer = nullptr; engine::Renderer* m_pAABBRenderer = nullptr; + // Delegates + Delegate OnDropFile; + // Controllers for processing input events. std::unique_ptr m_pViewportCameraController; diff --git a/Engine/Source/Runtime/Window/Window.h b/Engine/Source/Runtime/Window/Window.h index 672bb4af..62f7dad7 100644 --- a/Engine/Source/Runtime/Window/Window.h +++ b/Engine/Source/Runtime/Window/Window.h @@ -76,7 +76,6 @@ class Window public: // Delegates - Delegate OnDropFile; MulticastDelegate OnResize; private: diff --git a/Engine/Source/Runtime/Window/WindowManager.cpp b/Engine/Source/Runtime/Window/WindowManager.cpp index 08540e78..91b83ad0 100644 --- a/Engine/Source/Runtime/Window/WindowManager.cpp +++ b/Engine/Source/Runtime/Window/WindowManager.cpp @@ -219,7 +219,7 @@ void WindowManager::Update() case SDL_DROPFILE: { - GetActiveWindow()->OnDropFile.Invoke(sdlEvent.drop.file); + OnDropFile.Invoke(sdlEvent.drop.file); } break;