From 7d141e3d24140659d1762ea7d64a5d19351dce89 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 9 Jan 2024 21:31:41 +0100 Subject: a --- editor/app.hpp | 1 - editor/imgui-editors.cpp | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'editor') diff --git a/editor/app.hpp b/editor/app.hpp index 0d056558..8c8a522f 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -127,7 +127,6 @@ private: void draw_inspector(); static void entity_inspector_name(char* buf, size_t len, object_id id); bool check_inspector_exists(const popup_target& p); - void draw_editor_tile_pane_atlas(tile_editor& ed, StringView name, const std::shared_ptr& atlas); void draw_editor_scenery_pane(scenery_editor& ed); void draw_editor_vobj_pane(vobj_editor& ed); void set_cursor_from_imgui(); diff --git a/editor/imgui-editors.cpp b/editor/imgui-editors.cpp index 95e51667..8ba6aece 100644 --- a/editor/imgui-editors.cpp +++ b/editor/imgui-editors.cpp @@ -35,13 +35,10 @@ StringView scenery_type_to_string(const vobj_& vobj) { return vobj.name; } std::shared_ptr get_atlas(const vobj_& vobj) { return vobj.factory->atlas(); } StringView scenery_name(StringView, const vobj_& vobj) { return vobj.descr; } -} // namespace - -void app::draw_editor_tile_pane_atlas(tile_editor& ed, StringView name, const std::shared_ptr& atlas) +void draw_editor_tile_pane_atlas(tile_editor& ed, StringView name, const std::shared_ptr& atlas, Vector2 dpi) { const auto b = push_id("tile-pane"); - const auto dpi = M->dpi_scale(); constexpr Color4 color_perm_selected{1, 1, 1, .7f}, color_selected{1, 0.843f, 0, .8f}, color_hover{0, .8f, 1, .7f}; @@ -108,9 +105,8 @@ void app::draw_editor_tile_pane_atlas(tile_editor& ed, StringView name, const st do_caption(); } - template -static void impl_draw_editor_scenery_pane(T& ed, Vector2 dpi) +void impl_draw_editor_scenery_pane(T& ed, Vector2 dpi) { const auto b1 = push_id("scenery-pane"); @@ -192,6 +188,8 @@ static void impl_draw_editor_scenery_pane(T& ed, Vector2 dpi) template void impl_draw_editor_scenery_pane(scenery_editor&, Vector2); template void impl_draw_editor_scenery_pane(vobj_editor&, Vector2); +} // namespace + void app::draw_editor_scenery_pane(scenery_editor& ed) { impl_draw_editor_scenery_pane(ed, M->dpi_scale()); @@ -243,7 +241,7 @@ void app::draw_editor_pane(float main_menu_height) { if (ed) for (const auto& [k, v] : *ed) - draw_editor_tile_pane_atlas(*ed, k, v); + draw_editor_tile_pane_atlas(*ed, k, v, dpi); else if (sc) draw_editor_scenery_pane(*sc); else if (vo) -- cgit v1.2.3