From afc63fbba0e6009ec4132922545335594a20493e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 12 Dec 2023 17:58:17 +0100 Subject: w --- editor/wall-editor.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'editor/wall-editor.cpp') diff --git a/editor/wall-editor.cpp b/editor/wall-editor.cpp index faa7a260..eba9dc66 100644 --- a/editor/wall-editor.cpp +++ b/editor/wall-editor.cpp @@ -1,6 +1,7 @@ #include "wall-editor.hpp" #include "src/wall-defs.hpp" #include "src/wall-atlas.hpp" +#include "src/world.hpp" #include "loader/loader.hpp" #include "loader/wall-info.hpp" #include @@ -69,4 +70,14 @@ void wall_editor::clear_selection() { _selected_atlas = nullptr; } bool wall_editor::is_atlas_selected(const std::shared_ptr& atlas) const { return _selected_atlas == atlas; } bool wall_editor::is_anything_selected() const { return _selected_atlas != nullptr; } +void wall_editor::place_tile(world& w, global_coords coords, const std::shared_ptr& atlas) +{ + auto [c, t] = w[coords]; + switch (_r) + { + case rotation::N: t.wall_north() = { atlas, (uint8_t)-1 }; break; + case rotation::W: t.wall_west() = { atlas, (uint8_t)-1 }; break; + } +} + } // namespace floormat -- cgit v1.2.3