From 0bb96b1747292001e2ee1489203f18e9928fa11d Mon Sep 17 00:00:00 2001 From: redstrate Date: Thu, 14 Oct 2021 11:33:13 -0400 Subject: [PATCH] Fix viewports not rendering in cutscene editor --- tools/cutsceneeditor/include/cutsceneeditor.hpp | 3 ++- tools/cutsceneeditor/src/cutsceneeditor.cpp | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/cutsceneeditor/include/cutsceneeditor.hpp b/tools/cutsceneeditor/include/cutsceneeditor.hpp index 7311710..7aa2907 100755 --- a/tools/cutsceneeditor/include/cutsceneeditor.hpp +++ b/tools/cutsceneeditor/include/cutsceneeditor.hpp @@ -7,6 +7,7 @@ class CutsceneEditor : public CommonEditor { public: CutsceneEditor(); - + + void renderEditor(GFXCommandBuffer* command_buffer) override; void drawUI() override; }; diff --git a/tools/cutsceneeditor/src/cutsceneeditor.cpp b/tools/cutsceneeditor/src/cutsceneeditor.cpp index 772feff..3c61715 100755 --- a/tools/cutsceneeditor/src/cutsceneeditor.cpp +++ b/tools/cutsceneeditor/src/cutsceneeditor.cpp @@ -31,6 +31,12 @@ CutsceneEditor::CutsceneEditor() : CommonEditor("CutsceneEditor") {} static bool has_been_docked = false; +void CutsceneEditor::renderEditor(GFXCommandBuffer* command_buffer) { + for(auto [id, render_target] : viewport_render_targets) { + engine->get_renderer()->render(command_buffer, render_target.scene, *render_target.target, nullptr); + } +} + void CutsceneEditor::drawUI() { createDockArea(); @@ -117,7 +123,7 @@ void CutsceneEditor::drawUI() { if(ImGui::MenuItem("Save", "CTRL+S")) { if (currentPath.empty()) { - platform::save_dialog([](std::string path) { + engine->get_imgui().save_dialog([](std::string path) { currentPath = path; engine->save_cutscene(path); @@ -131,7 +137,7 @@ void CutsceneEditor::drawUI() { } if (ImGui::MenuItem("Save as...", "CTRL+S")) { - platform::save_dialog([](std::string path) { + engine->get_imgui().save_dialog([](std::string path) { currentPath = path; engine->save_cutscene(path); @@ -165,7 +171,7 @@ void CutsceneEditor::drawUI() { } if(ImGui::MenuItem("Prefab")) { - platform::open_dialog(false, [](std::string path) { + engine->get_imgui().open_dialog(false, [](std::string path) { engine->add_prefab(*engine->get_scene(), path); }); }