Fix viewports not rendering in cutscene editor
This commit is contained in:
parent
ff0115ed7a
commit
0bb96b1747
2 changed files with 11 additions and 4 deletions
|
@ -8,5 +8,6 @@ class CutsceneEditor : public CommonEditor {
|
||||||
public:
|
public:
|
||||||
CutsceneEditor();
|
CutsceneEditor();
|
||||||
|
|
||||||
|
void renderEditor(GFXCommandBuffer* command_buffer) override;
|
||||||
void drawUI() override;
|
void drawUI() override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue