Archived
1
Fork 0

Fix viewports not rendering in cutscene editor

This commit is contained in:
redstrate 2021-10-14 11:33:13 -04:00
parent ff0115ed7a
commit 0bb96b1747
2 changed files with 11 additions and 4 deletions

View file

@ -7,6 +7,7 @@
class CutsceneEditor : public CommonEditor { class CutsceneEditor : public CommonEditor {
public: public:
CutsceneEditor(); CutsceneEditor();
void renderEditor(GFXCommandBuffer* command_buffer) override;
void drawUI() override; void drawUI() override;
}; };

View file

@ -31,6 +31,12 @@ CutsceneEditor::CutsceneEditor() : CommonEditor("CutsceneEditor") {}
static bool has_been_docked = false; 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() { void CutsceneEditor::drawUI() {
createDockArea(); createDockArea();
@ -117,7 +123,7 @@ void CutsceneEditor::drawUI() {
if(ImGui::MenuItem("Save", "CTRL+S")) { if(ImGui::MenuItem("Save", "CTRL+S")) {
if (currentPath.empty()) { if (currentPath.empty()) {
platform::save_dialog([](std::string path) { engine->get_imgui().save_dialog([](std::string path) {
currentPath = path; currentPath = path;
engine->save_cutscene(path); engine->save_cutscene(path);
@ -131,7 +137,7 @@ void CutsceneEditor::drawUI() {
} }
if (ImGui::MenuItem("Save as...", "CTRL+S")) { if (ImGui::MenuItem("Save as...", "CTRL+S")) {
platform::save_dialog([](std::string path) { engine->get_imgui().save_dialog([](std::string path) {
currentPath = path; currentPath = path;
engine->save_cutscene(path); engine->save_cutscene(path);
@ -165,7 +171,7 @@ void CutsceneEditor::drawUI() {
} }
if(ImGui::MenuItem("Prefab")) { 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); engine->add_prefab(*engine->get_scene(), path);
}); });
} }