summaryrefslogtreecommitdiffhomepage
path: root/main/editor.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-20 23:08:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-20 23:11:32 +0200
commitd22abc50862f7243228c93fd2fd3878b37821487 (patch)
tree26d388a2d86132cd6d5df4295d5affa216e02cb4 /main/editor.hpp
parent3e1199836bf8eb752afe9d4d20b121c8a23e87d5 (diff)
some editor stuff
Diffstat (limited to 'main/editor.hpp')
-rw-r--r--main/editor.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/editor.hpp b/main/editor.hpp
index c66ccff1..88740b35 100644
--- a/main/editor.hpp
+++ b/main/editor.hpp
@@ -16,6 +16,8 @@ enum class editor_mode : unsigned char {
select, floor, walls,
};
+struct world;
+
struct tile_type final
{
tile_type(editor_mode mode, Containers::StringView name);
@@ -36,6 +38,7 @@ struct tile_type final
bool is_tile_selected(const std::shared_ptr<tile_atlas>& atlas, std::uint8_t variant);
bool is_permutation_selected(const std::shared_ptr<tile_atlas>& atlas);
std::optional<std::tuple<std::shared_ptr<tile_atlas>, std::uint8_t>> get_selected();
+ void place_tile(world& world, global_coords pos);
private:
enum selection_mode : std::uint8_t {
@@ -67,7 +70,7 @@ struct editor final
tile_type& floor() { return _floor; }
const tile_type& floor() const { return _floor; }
- void maybe_place_tile(global_coords pos, int mouse_button);
+ void maybe_place_tile(world& world, global_coords pos, int mouse_button);
editor();
editor(editor&&) noexcept = default;
@@ -76,7 +79,7 @@ struct editor final
private:
tile_type _floor{editor_mode::floor, "floor"};
- editor_mode _mode = {};
+ editor_mode _mode = editor_mode::select;
bool _dirty = false;
};