summaryrefslogtreecommitdiffhomepage
path: root/editor/draw.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-28 18:55:55 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-28 18:55:55 +0100
commit16911b659ac6555ada2ddec560eb82c8dd7b910f (patch)
treeaa46734355b1b0029f56e80f683234210598cd10 /editor/draw.cpp
parent9236dae6b3357c83de469947add0bf9c169367c5 (diff)
editor: only show cursor when placing something
Diffstat (limited to 'editor/draw.cpp')
-rw-r--r--editor/draw.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp
index 75444379..e0ddc743 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -22,13 +22,18 @@ void app::draw_cursor()
mesh.draw(shader, {center, size, LINE_WIDTH});
};
- if (const auto* ed = _editor.current_tile_editor(); ed && ed->mode() == editor_mode::walls)
- switch (ed->rotation())
- {
- case editor_wall_rotation::N: draw(_wireframe_wall_n, TILE_SIZE); break;
- case editor_wall_rotation::W: draw(_wireframe_wall_w, TILE_SIZE); break;
- }
- else
+ if (const auto* ed = _editor.current_tile_editor(); ed && ed->is_anything_selected())
+ {
+ if (ed->mode() == editor_mode::walls)
+ switch (ed->rotation())
+ {
+ case editor_wall_rotation::N: draw(_wireframe_wall_n, TILE_SIZE); break;
+ case editor_wall_rotation::W: draw(_wireframe_wall_w, TILE_SIZE); break;
+ }
+ else if (ed->mode() == editor_mode::floor)
+ draw(_wireframe_quad, TILE_SIZE2);
+ }
+ else if (const auto* ed = _editor.current_scenery_editor(); ed && ed->is_anything_selected())
draw(_wireframe_quad, TILE_SIZE2);
}
}