From 1db6e0258e748ee26cf0d31b182d6b02b035d05b Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:19:17 +0000 Subject: [PATCH 01/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp | 2 +- Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp index d9e3d7c89e..cfe2ffaad3 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp @@ -48,7 +48,7 @@ void GUI_Menu_File::Draw() { // Shader Editor if (ImGui::MenuItem("Shader Editor")) { - ShaderEditor_->Enabled_ = !ShaderEditor_->Enabled_; + } ImGui::Separator(); diff --git a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp index 11898abe15..3ef25cbea0 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp @@ -102,6 +102,7 @@ void GUI_Menu_Window::Draw() { } ImGui::MenuItem("Script Editor", "", &GUI_Window_ScriptEditor_->Enabled_); + ImGui::MenuItem("Shader Editor", "", &ShaderEditor_->Enabled_); ImGui::EndMenu(); From 3e2dab4bb27c267994cff55e6249b2969cf4bc1f Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:19:38 +0000 Subject: [PATCH 02/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp index cfe2ffaad3..cbb41cc39e 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp @@ -45,13 +45,6 @@ void GUI_Menu_File::Draw() { } ImGui::Separator(); - - // Shader Editor - if (ImGui::MenuItem("Shader Editor")) { - - } - ImGui::Separator(); - // Save Options if (ImGui::MenuItem("Save Active Scene")) { SceneWriter_->ProcessScene( From d92918c7adb47e38949efce0f1c5cfb12f3009b7 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:20:36 +0000 Subject: [PATCH 03/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h | 1 - Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.h | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h index fa2a15069a..0423d164c5 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h @@ -50,7 +50,6 @@ class GUI_Menu_File { std::unique_ptr ImportAsset_; /** GUI_Window_ProjectSettings_; /** ShaderEditor_; /** GUI_Window_ObjectProperties_; /** GUI_Window_FrameLatencyGraph_; /** GUI_Window_ShaderEditor_; /** GUI_Window_SceneTree_; /** GUI_Window_SystemLog_; /** Date: Thu, 30 Jun 2022 05:20:51 +0000 Subject: [PATCH 04/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_File/CMakeLists.txt | 1 - Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h | 1 - Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.h | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/CMakeLists.txt b/Source/Core/Editor/Menus/GUI_Menu_File/CMakeLists.txt index cae0fc467b..b0667e3f09 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/CMakeLists.txt +++ b/Source/Core/Editor/Menus/GUI_Menu_File/CMakeLists.txt @@ -39,7 +39,6 @@ target_link_libraries(Menu_File ERS_STRUCT_Scene GUI_Window_ProjectSettings - GUI_Window_ShaderEditor ERS_CLASS_VisualRenderer ) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h index 0423d164c5..5889a69707 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.h @@ -30,7 +30,6 @@ #include #include -#include #include diff --git a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.h b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.h index c764cb4e5c..c4554f573a 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.h +++ b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.h @@ -34,6 +34,8 @@ #include #include #include +#include + #include #include From e06ce630b906964c1caa2d4cd9e81a794167dad2 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:20:59 +0000 Subject: [PATCH 05/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_Window/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Window/CMakeLists.txt b/Source/Core/Editor/Menus/GUI_Menu_Window/CMakeLists.txt index 6ab545568c..d782db8443 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Window/CMakeLists.txt +++ b/Source/Core/Editor/Menus/GUI_Menu_Window/CMakeLists.txt @@ -42,6 +42,8 @@ target_link_libraries(Menu_Window GUI_Window_FramerateCounter GUI_Window_FramerateHistogram GUI_Window_FrameratePlot + GUI_Window_ShaderEditor + ) From 953c81e435ce8d785eb6bd297e44b98ba18762fc Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:21:20 +0000 Subject: [PATCH 06/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp | 1 - Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp index cbb41cc39e..0cebfacc33 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp @@ -15,7 +15,6 @@ GUI_Menu_File::GUI_Menu_File(ERS_STRUCT_SystemUtils* SystemUtils, ERS_CLASS_Scen SceneWriter_ = std::make_unique(SystemUtils_); ImportAsset_ = std::make_unique(SystemUtils_); - ShaderEditor_ = std::make_unique(SystemUtils_, ProjectUtils_, VisualRenderer_); GUI_Window_ProjectSettings_ = std::make_unique(ProjectUtils, SystemUtils); } diff --git a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp index 3ef25cbea0..5bb815309b 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp @@ -25,6 +25,8 @@ GUI_Menu_Window::GUI_Menu_Window(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT GUI_Window_SystemLog_ = std::make_unique(SystemUtils_); GUI_Window_AssetExplorer_ = std::make_unique(SystemUtils_, ProjectUtils_); GUI_Window_ScriptEditor_ = std::make_unique(SystemUtils_, ProjectUtils_, VisualRenderer_); + ShaderEditor_ = std::make_unique(SystemUtils_, ProjectUtils_, VisualRenderer_); + } From 7694828ccb47c592e92d45d8117b70700872eff4 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:21:33 +0000 Subject: [PATCH 07/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp index 5bb815309b..cfb1678622 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp @@ -13,14 +13,11 @@ GUI_Menu_Window::GUI_Menu_Window(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT SystemUtils_->Logger_->Log("Editor Setting Up Window Menu", 4); - SystemUtils_->Logger_->Log("Initializing Editor Widgets", 5); + SystemUtils_->Logger_->Log("Initializing Editor Windows", 5); GUI_Window_ObjectProperties_ = std::make_unique(Cursors3D, SceneManager, ProjectUtils_); GUI_Window_RenderingSettings_ = std::make_unique(SystemUtils_); GUI_Window_FrameLatencyGraph_ = std::make_unique(SystemUtils_); GUI_Window_RAMGraph_ = std::make_unique(SystemUtils_); - - - SystemUtils_->Logger_->Log("Initializing Editor Windows", 5); GUI_Window_SceneTree_ = std::make_unique(SceneManager, SystemUtils_, ProjectUtils_, Cursors3D); GUI_Window_SystemLog_ = std::make_unique(SystemUtils_); GUI_Window_AssetExplorer_ = std::make_unique(SystemUtils_, ProjectUtils_); From 82f74f1eb565165a53719ff88fcb82a4df8de328 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:21:45 +0000 Subject: [PATCH 08/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp index 0cebfacc33..90f366b5d8 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp @@ -75,7 +75,6 @@ void GUI_Menu_File::Draw() { // Draw Subwindows ImportAsset_->Draw(); GUI_Window_ProjectSettings_->Draw(); - ShaderEditor_->Draw(); From 1c2b727285734327eeb1f325ef21decbc8f8cd70 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:22:19 +0000 Subject: [PATCH 09/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp index cfb1678622..49d4db7992 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp @@ -127,5 +127,8 @@ void GUI_Menu_Window::Draw() { GUI_Window_AssetExplorer_->Draw(); GUI_Window_ScriptEditor_->Draw(); + GUI_Window_ShaderEditor_->Draw(); + + } \ No newline at end of file From e38997ad5e6c01e375b3ff51109cbe206889a7f8 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:22:54 +0000 Subject: [PATCH 10/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp index 49d4db7992..e02ee7e70e 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp @@ -101,7 +101,7 @@ void GUI_Menu_Window::Draw() { } ImGui::MenuItem("Script Editor", "", &GUI_Window_ScriptEditor_->Enabled_); - ImGui::MenuItem("Shader Editor", "", &ShaderEditor_->Enabled_); + ImGui::MenuItem("Shader Editor", "", &GUI_Window_ShaderEditor_->Enabled_); ImGui::EndMenu(); From f7d5ecc9f50a7b0620d82aa110ebfebbd469f006 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:23:12 +0000 Subject: [PATCH 11/29] Move Shader Editor To Window Menu --- Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp index e02ee7e70e..79d47e895e 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Window/GUI_Menu_Window.cpp @@ -22,7 +22,7 @@ GUI_Menu_Window::GUI_Menu_Window(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT GUI_Window_SystemLog_ = std::make_unique(SystemUtils_); GUI_Window_AssetExplorer_ = std::make_unique(SystemUtils_, ProjectUtils_); GUI_Window_ScriptEditor_ = std::make_unique(SystemUtils_, ProjectUtils_, VisualRenderer_); - ShaderEditor_ = std::make_unique(SystemUtils_, ProjectUtils_, VisualRenderer_); + GUI_Window_ShaderEditor_ = std::make_unique(SystemUtils_, ProjectUtils_, VisualRenderer_); } From fbe2a0717ffc7ffaa1a0d44192f84c2f477edc9f Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:35:27 +0000 Subject: [PATCH 12/29] Add New Scene Button (#234) --- Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp index 90f366b5d8..d12c932f43 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_File/GUI_Menu_File.cpp @@ -44,7 +44,7 @@ void GUI_Menu_File::Draw() { } ImGui::Separator(); - // Save Options + // Scene Options if (ImGui::MenuItem("Save Active Scene")) { SceneWriter_->ProcessScene( SceneManager_->Scenes_[SceneManager_->ActiveScene_].get(), From d6dd4cabce238c69353c8f5340217e532895e64a Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 05:39:29 +0000 Subject: [PATCH 13/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 3 +++ .../Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h | 1 + 2 files changed, 4 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index 06c8775378..eabc8c7116 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -95,7 +95,10 @@ void ERS_CLASS_ViewportMenu::AddSpotLight(ERS_CLASS_ShadowMaps* ShadowMaps) { } +void ERS_CLASS_ViewportMenu::AddScene(ERS_STRUCT_Viewport* Viewport) { + +} void ERS_CLASS_ViewportMenu::DrawMenu(ERS_STRUCT_Viewport* Viewport, ERS_CLASS_ShadowMaps* ShadowMaps) { diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h index 157b74a0c6..b6f1331a59 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h @@ -76,6 +76,7 @@ class ERS_CLASS_ViewportMenu { void AddPointLight(ERS_CLASS_ShadowMaps* ShadowMaps); void AddDirectionalLight(ERS_CLASS_ShadowMaps* ShadowMaps); void AddSpotLight(ERS_CLASS_ShadowMaps* ShadowMaps); + void AddScene(ERS_STRUCT_Viewport* Viewport); }; \ No newline at end of file From 9102f39636d81589abc0044df14ed656652104f5 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 06:46:21 +0000 Subject: [PATCH 14/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index eabc8c7116..6101f39512 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -97,7 +97,8 @@ void ERS_CLASS_ViewportMenu::AddSpotLight(ERS_CLASS_ShadowMaps* ShadowMaps) { void ERS_CLASS_ViewportMenu::AddScene(ERS_STRUCT_Viewport* Viewport) { - + + } From 80ef3284cbd6d0b91211d7b2e66c48f24855c624 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 06:52:08 +0000 Subject: [PATCH 15/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index 6101f39512..4e4f762aec 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -350,6 +350,10 @@ void ERS_CLASS_ViewportMenu::DrawMenu(ERS_STRUCT_Viewport* Viewport, ERS_CLASS_S } + if (ImGui::MenuItem("Scene")) { + AddScene(Viewport); + } + ImGui::EndMenu(); } From 01750e165cc54183d628c871296ae64440c2302e Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 06:55:03 +0000 Subject: [PATCH 16/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index 4e4f762aec..01f03f2659 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -97,7 +97,7 @@ void ERS_CLASS_ViewportMenu::AddSpotLight(ERS_CLASS_ShadowMaps* ShadowMaps) { void ERS_CLASS_ViewportMenu::AddScene(ERS_STRUCT_Viewport* Viewport) { - + // } From 3e7cfb6a893cbe8ffd96fee9e744e25471c4d345 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 06:59:32 +0000 Subject: [PATCH 17/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index 01f03f2659..a0536b88e2 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -97,7 +97,12 @@ void ERS_CLASS_ViewportMenu::AddSpotLight(ERS_CLASS_ShadowMaps* ShadowMaps) { void ERS_CLASS_ViewportMenu::AddScene(ERS_STRUCT_Viewport* Viewport) { - // + // Add Scene To List Of Scenes + ERS_STRUCT_Scene NewScene; + NewScene.ScenePath = SystemUtils_->ERS_IOSubsystem_->AllocateAssetID(); + NewScene.SceneName = "New Scene"; + ProjectUtils_->SceneManager_->AddScene(NewScene); + } From 1732258e091a2ffa0e455da7966a4a9b1a5e5fd8 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:01:54 +0000 Subject: [PATCH 18/29] Add New Scene Button (#234) --- .../Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index a0536b88e2..857e8f33d2 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -101,6 +101,7 @@ void ERS_CLASS_ViewportMenu::AddScene(ERS_STRUCT_Viewport* Viewport) { ERS_STRUCT_Scene NewScene; NewScene.ScenePath = SystemUtils_->ERS_IOSubsystem_->AllocateAssetID(); NewScene.SceneName = "New Scene"; + NewScene.IsSceneLoaded = true; ProjectUtils_->SceneManager_->AddScene(NewScene); From 039f016ababb9c297b328e21d711fbe06deb4cbb Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:13:31 +0000 Subject: [PATCH 19/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp index 8fcb1196e9..aa8bcac467 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_VisualRenderer.cpp @@ -372,7 +372,7 @@ void ERS_CLASS_VisualRenderer::UpdateViewport(int Index, ERS_CLASS_SceneManager* // Update Cursor If Selection Changed ERS_STRUCT_Scene* ActiveScene = SceneManager->Scenes_[SceneManager->ActiveScene_].get(); - if (ActiveScene->HasSelectionChanged && DrawCursor) { + if (ActiveScene->HasSelectionChanged && DrawCursor && (ActiveScene->SceneObjects_.size() != 0)) { // Get Selected Model int SelectedObject = ActiveScene->SelectedObject; From 4b2236cf3ff86158636d97425c4f457185cf2199 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:16:28 +0000 Subject: [PATCH 20/29] Add New Scene Button (#234) --- Source/Core/Manager/ERS_SceneManager/ERS_SceneManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Core/Manager/ERS_SceneManager/ERS_SceneManager.cpp b/Source/Core/Manager/ERS_SceneManager/ERS_SceneManager.cpp index a01443309f..0f79edc054 100644 --- a/Source/Core/Manager/ERS_SceneManager/ERS_SceneManager.cpp +++ b/Source/Core/Manager/ERS_SceneManager/ERS_SceneManager.cpp @@ -21,6 +21,11 @@ ERS_CLASS_SceneManager::~ERS_CLASS_SceneManager() { void ERS_CLASS_SceneManager::UpdateLocRotScale(glm::vec3 Pos, glm::vec3 Rot, glm::vec3 Scale) { + // If The Scene Has No Models, Exit Early + if (Scenes_[ActiveScene_]->SceneObjects_.size() == 0) { + return; + } + unsigned long SelectedObject = Scenes_[ActiveScene_]->SelectedObject; if (Scenes_[ActiveScene_]->SceneObjects_[SelectedObject].Type_ == std::string("Model")) { From b935956afb387a993e27a7fb972bcef724028931 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:18:58 +0000 Subject: [PATCH 21/29] Add New Scene Button (#234) --- .../GUI_Window_ObjectProperties.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp index ef3176ac40..df3b9fcd86 100644 --- a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp @@ -95,7 +95,9 @@ void GUI_Window_ObjectProperties::Draw() { SelectedSceneObject = 0; } - if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Type_ == std::string("PointLight")) { + if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_.size() == 0) { // Early exit if no objects in scene + return; + } else if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Type_ == std::string("PointLight")) { unsigned long Index = SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Index_; if (ImGui::CollapsingHeader("Point Light Settings", ImGuiTreeNodeFlags_DefaultOpen)) { From b2b7c5fc74f585f15748553ef836681559583a00 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:20:42 +0000 Subject: [PATCH 22/29] Add New Scene Button (#234) --- .../GUI_Window_ObjectProperties.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp index df3b9fcd86..b8188589a3 100644 --- a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp @@ -95,8 +95,8 @@ void GUI_Window_ObjectProperties::Draw() { SelectedSceneObject = 0; } - if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_.size() == 0) { // Early exit if no objects in scene - return; + if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_.size() == 0) { + } else if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Type_ == std::string("PointLight")) { unsigned long Index = SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Index_; From 4d2327b8d2436fbbf1335df24a1488f1e5a8c146 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:22:22 +0000 Subject: [PATCH 23/29] Add New Scene Button (#234) --- .../GUI_Window_ObjectProperties.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp index b8188589a3..cd8faf6b2a 100644 --- a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp @@ -70,7 +70,7 @@ void GUI_Window_ObjectProperties::Draw() { // Set Initial Window Size ImGui::SetWindowSize(ImVec2(400,250), ImGuiCond_FirstUseEver); - if (Visible) { + if (Visible && (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_.size() == 0)) { // LocRotScale Properties @@ -95,9 +95,7 @@ void GUI_Window_ObjectProperties::Draw() { SelectedSceneObject = 0; } - if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_.size() == 0) { - - } else if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Type_ == std::string("PointLight")) { + if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Type_ == std::string("PointLight")) { unsigned long Index = SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Index_; if (ImGui::CollapsingHeader("Point Light Settings", ImGuiTreeNodeFlags_DefaultOpen)) { From e05705000d5f14c872d5a5dd48312fe4290a8a07 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:22:33 +0000 Subject: [PATCH 24/29] Add New Scene Button (#234) --- .../GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp index cd8faf6b2a..9f6cb4e02d 100644 --- a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp @@ -72,7 +72,6 @@ void GUI_Window_ObjectProperties::Draw() { if (Visible && (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_.size() == 0)) { - // LocRotScale Properties if (ImGui::CollapsingHeader("Physical Parameters", ImGuiTreeNodeFlags_DefaultOpen)) { From bbc08cfa32ffd1a58b46efe746195ffda0b4bb6d Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:23:26 +0000 Subject: [PATCH 25/29] Add New Scene Button (#234) --- .../GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp index 9f6cb4e02d..9c6ad28e26 100644 --- a/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp +++ b/Source/Core/Editor/Windows/GUI_Window_ObjectProperties/GUI_Window_ObjectProperties.cpp @@ -70,7 +70,7 @@ void GUI_Window_ObjectProperties::Draw() { // Set Initial Window Size ImGui::SetWindowSize(ImVec2(400,250), ImGuiCond_FirstUseEver); - if (Visible && (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_.size() == 0)) { + if (Visible && (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_.size() != 0)) { // LocRotScale Properties if (ImGui::CollapsingHeader("Physical Parameters", ImGuiTreeNodeFlags_DefaultOpen)) { From 412fa2f9b3dae8765c017496ecbbf22c364cdc6a Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:39:51 +0000 Subject: [PATCH 26/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index 857e8f33d2..bf47509721 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -102,6 +102,10 @@ void ERS_CLASS_ViewportMenu::AddScene(ERS_STRUCT_Viewport* Viewport) { NewScene.ScenePath = SystemUtils_->ERS_IOSubsystem_->AllocateAssetID(); NewScene.SceneName = "New Scene"; NewScene.IsSceneLoaded = true; + NewScene.SceneFormatVersion = 1; + + ProjectUtils_->ProjectManager_->Project_.SceneIDs.push_back(NewScene.ScenePath); + ProjectUtils_->SceneManager_->AddScene(NewScene); From 6b5fb14d8e138cd1cb924d983fe53b9408eb311d Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:43:56 +0000 Subject: [PATCH 27/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index bf47509721..b3ae1615d7 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -95,7 +95,7 @@ void ERS_CLASS_ViewportMenu::AddSpotLight(ERS_CLASS_ShadowMaps* ShadowMaps) { } -void ERS_CLASS_ViewportMenu::AddScene(ERS_STRUCT_Viewport* Viewport) { +void ERS_CLASS_ViewportMenu::AddScene() { // Add Scene To List Of Scenes ERS_STRUCT_Scene NewScene; From cb28e11bf3d0d6ffe6cd50672ea3144cbda85f99 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:44:05 +0000 Subject: [PATCH 28/29] Add New Scene Button (#234) --- .../Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h index b6f1331a59..b6326cad4e 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.h @@ -76,7 +76,7 @@ class ERS_CLASS_ViewportMenu { void AddPointLight(ERS_CLASS_ShadowMaps* ShadowMaps); void AddDirectionalLight(ERS_CLASS_ShadowMaps* ShadowMaps); void AddSpotLight(ERS_CLASS_ShadowMaps* ShadowMaps); - void AddScene(ERS_STRUCT_Viewport* Viewport); + void AddScene(); }; \ No newline at end of file From c4ce0750aeec32bf3e6a0ca42c8ebca2f8d1dae4 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Thu, 30 Jun 2022 07:44:14 +0000 Subject: [PATCH 29/29] Add New Scene Button (#234) --- .../ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp index b3ae1615d7..7fe3b37b57 100644 --- a/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp +++ b/Source/Core/Renderer/ERS_CLASS_VisualRenderer/ERS_CLASS_ViewportMenu.cpp @@ -361,7 +361,7 @@ void ERS_CLASS_ViewportMenu::DrawMenu(ERS_STRUCT_Viewport* Viewport, ERS_CLASS_S } if (ImGui::MenuItem("Scene")) { - AddScene(Viewport); + AddScene(); }