summaryrefslogtreecommitdiffhomepage
path: root/editor/wall-editor.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-12-12 17:58:17 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-12-12 17:58:17 +0100
commitafc63fbba0e6009ec4132922545335594a20493e (patch)
tree86dabe87bfdc536e7ffe9fb22c1125dea4e73b1c /editor/wall-editor.cpp
parent6944f24118eee8135f2465bed4f728fe1445f723 (diff)
w
Diffstat (limited to 'editor/wall-editor.cpp')
-rw-r--r--editor/wall-editor.cpp11
1 files changed, 11 insertions, 0 deletions
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 <Corrade/Containers/ArrayView.h>
@@ -69,4 +70,14 @@ void wall_editor::clear_selection() { _selected_atlas = nullptr; }
bool wall_editor::is_atlas_selected(const std::shared_ptr<wall_atlas>& 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<wall_atlas>& 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