diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-24 10:28:00 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-24 10:28:00 +0200 |
commit | ceef13e7bd4c01e66885611e2fef54d589a695da (patch) | |
tree | 9b85b5b3f558b7806278853fa13372d95d807e78 /editor | |
parent | 34134e88f6c6b8b4d19fec53366d6e40a3303c6e (diff) |
a
Diffstat (limited to 'editor')
-rw-r--r-- | editor/app.cpp | 22 | ||||
-rw-r--r-- | editor/draw.cpp | 3 | ||||
-rw-r--r-- | editor/imgui.cpp | 9 |
3 files changed, 27 insertions, 7 deletions
diff --git a/editor/app.cpp b/editor/app.cpp index 878e4052..44ca1530 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -66,11 +66,24 @@ int app::run_from_argv(const int argc, const char* const* const argv) { Corrade::Utility::Arguments args{}; args.addOption("vsync", "m") - .addOption("gpu-validation", "1") + .addOption("gpu-validation", "m") .addOption("msaa", "1") .parse(argc, argv); opts.vsync = parse_tristate("--vsync", args.value<StringView>("vsync"), opts.vsync); - opts.msaa = parse_bool("--msaa", args.value<StringView>("msaaa"), opts.msaa); + opts.msaa = parse_bool("--msaa", args.value<StringView>("msaa"), opts.msaa); + { + auto str = args.value<StringView>("gpu-validation"); + if (str == "no-error" || str == "NO-ERROR") + opts.gpu_debug = fm_gpu_debug::no_error; + else if (str == "robust" || str == "robust") + opts.gpu_debug = fm_gpu_debug::robust; + else switch (parse_tristate("--gpu-validation", args.value<StringView>("gpu-validation"), fm_tristate::maybe)) + { + default: + case fm_tristate::on: opts.gpu_debug = fm_gpu_debug::on; break; + case fm_tristate::off: opts.gpu_debug = fm_gpu_debug::off; break; + } + } } app application; return application.exec(); @@ -94,3 +107,8 @@ extern "C" int __stdcall WinMain(void*, void*, void*, int) #endif } // namespace floormat + +int main(int argc, char** argv) +{ + return floormat::app::run_from_argv(argc, argv); +} diff --git a/editor/draw.cpp b/editor/draw.cpp index 33188573..fe12489d 100644 --- a/editor/draw.cpp +++ b/editor/draw.cpp @@ -1,3 +1,4 @@ +#if 0 #include "app.hpp" #include "main/floormat-main.hpp" #include "shaders/tile-shader.hpp" @@ -48,3 +49,5 @@ void app::draw() } } // namespace floormat + +#endif diff --git a/editor/imgui.cpp b/editor/imgui.cpp index aea34ae9..571c1c1b 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -78,10 +78,9 @@ void app::draw_editor_pane(tile_editor& type, float main_menu_height) color_selected{1, 0.843f, 0, .8f}, color_hover{0, .8f, 1, .7f}; - if (ImGui::GetIO().WantTextInput && !isTextInputActive()) - startTextInput(); - else if (!ImGui::GetIO().WantTextInput && isTextInputActive()) - stopTextInput(); + if (const bool active = M->is_text_input_active(); + ImGui::GetIO().WantTextInput != active) + active ? M->start_text_input() : M->stop_text_input(); [[maybe_unused]] const raii_wrapper vars[] = { push_style_var(ImGuiStyleVar_WindowPadding, {8, 8}), @@ -126,7 +125,7 @@ void app::draw_editor_pane(tile_editor& type, float main_menu_height) if (ed) { click_event(); - if (ed->is_atlas_selected(v)) + if (ed->is_atlas_selected(v_)) { ImGui::SameLine(); ImGui::Text(" (selected)"); |