diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-31 08:53:05 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-31 08:53:05 +0100 |
commit | 254ae02e16a7d42053c9e94c6d27189d0af0e874 (patch) | |
tree | 9f2806c1b94404067c0ae829ee80eb77c75233a1 /editor/editor.cpp | |
parent | c602452c8099c4602d9812486573024d3216f832 (diff) |
add tile placement
Diffstat (limited to 'editor/editor.cpp')
-rw-r--r-- | editor/editor.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp index 5419b653..2bfd481f 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -161,10 +161,15 @@ void tile_editor::place_tile(world& world, global_coords pos, tile_image& img) case editor_mode::select: break; case editor_mode::floor: - t.ground = {atlas, variant }; + t.ground = { atlas, variant }; break; case editor_mode::walls: - break; // todo + switch (tile_image x = { atlas, variant }; _rotation) + { + case editor_wall_rotation::N: t.wall_north = x; break; + case editor_wall_rotation::W: t.wall_west = x; break; + } + break; } } @@ -210,7 +215,7 @@ const tile_editor* editor::current() const noexcept case editor_mode::floor: return &_floor; case editor_mode::walls: - return nullptr; // todo + return &_wall; // todo default: fm_warn_once("invalid editor mode '%u'", (unsigned)_mode); return nullptr; |