summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-12-22 10:07:08 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-12-22 10:07:08 +0100
commit424701126b5613badc23dd7354b26294dc1c6c93 (patch)
treed7d87af8c659fde18fdf269ec2cade08e229abfc /editor
parentdba52df4581329a692d889d76cb7f093e7e3f7d9 (diff)
a
Diffstat (limited to 'editor')
-rw-r--r--editor/tile-editor.cpp3
-rw-r--r--editor/tile-editor.hpp1
-rw-r--r--editor/wall-editor.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/editor/tile-editor.cpp b/editor/tile-editor.cpp
index e6d98079..0bccd6d9 100644
--- a/editor/tile-editor.cpp
+++ b/editor/tile-editor.cpp
@@ -17,8 +17,7 @@ tile_editor::tile_editor()
void tile_editor::load_atlases()
{
- const auto filename = _name + ".json";
- for (const auto& atlas : loader.tile_atlases(filename))
+ for (const auto& atlas : loader.tile_atlases("floor.json"_s))
{
auto& [_, vec] = _permutation;
vec.reserve(atlas->num_tiles());
diff --git a/editor/tile-editor.hpp b/editor/tile-editor.hpp
index 57347bf0..a33ed848 100644
--- a/editor/tile-editor.hpp
+++ b/editor/tile-editor.hpp
@@ -23,7 +23,6 @@ class tile_editor final
std::vector<decltype(tile_image_proto::variant)> variant;
};
- String _name;
std::map<StringView, std::shared_ptr<tile_atlas>> _atlases;
tile_image_proto _selected_tile;
tuple _permutation;
diff --git a/editor/wall-editor.cpp b/editor/wall-editor.cpp
index c0bb2b4b..d1bcd650 100644
--- a/editor/wall-editor.cpp
+++ b/editor/wall-editor.cpp
@@ -58,6 +58,7 @@ void wall_editor::load_atlases()
wall_editor::wall_editor()
{
load_atlases();
+ _selected_atlas = _atlases.begin()->second.atlas; // todo
}
StringView wall_editor::name() const { return "wall"_s; }
@@ -79,6 +80,7 @@ void wall_editor::place_tile(world& w, global_coords coords, const std::shared_p
case rotation::W: t.wall_west() = { atlas, (uint8_t)-1 }; break;
default: std::unreachable();
}
+ c.mark_walls_modified();
}
editor_snap_mode wall_editor::check_snap(int mods) const