summaryrefslogtreecommitdiffhomepage
path: root/editor/draw.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-22 21:03:49 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-22 21:03:49 +0100
commit2141477c69d379b02ca52e0df9171834b37aadd7 (patch)
tree347f865c403fd86e24ae6f1d2d327554d23f1c33 /editor/draw.cpp
parent4f458fba80cbcbfecf3fa54284e3004852bbc172 (diff)
scenery work
Diffstat (limited to 'editor/draw.cpp')
-rw-r--r--editor/draw.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp
index 9915a93e..17be7aeb 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -35,21 +35,21 @@ void app::draw_cursor()
void app::draw()
{
- draw_cursor();
+ if (_editor.current_tile_editor())
+ draw_cursor();
draw_ui();
render_menu();
}
-clickable_scenery* app::find_clickable_scenery()
+clickable_scenery* app::find_clickable_scenery(Vector2i pixel_)
{
+ clickable_scenery* item = nullptr;
if (cursor.tile)
{
- float depth = -2;
- clickable_scenery* item = nullptr;
+ float depth = -1;
auto array = M->clickable_scenery();
- const auto pixel = Vector2ui(*cursor.pixel);
+ const auto pixel = Vector2ui(pixel_);
for (clickable_scenery& c : array)
- {
if (c.depth > depth && c.dest.contains(pixel))
{
const auto pos = pixel - c.dest.min() + c.src.min();
@@ -62,10 +62,8 @@ clickable_scenery* app::find_clickable_scenery()
item = &c;
}
}
- }
- return item;
}
- return nullptr;
+ return item;
}
} // namespace floormat