diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/app.cpp | 8 | ||||
-rw-r--r-- | editor/tile-editor.cpp | 10 |
2 files changed, 13 insertions, 5 deletions
diff --git a/editor/app.cpp b/editor/app.cpp index ed374dd8..ed1bac7b 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -12,10 +12,10 @@ namespace floormat { app::app(fm_settings&& opts) : M{floormat_main::create(*this, std::move(opts))}, - _floor1{loader.tile_atlas("floor-tiles", {44, 4})}, - _floor2{loader.tile_atlas("metal1", {2, 2})}, - _wall1{loader.tile_atlas("wood2", {2, 1})}, - _wall2{loader.tile_atlas("wood1", {2, 1})}, + _floor1{loader.tile_atlas("floor-tiles", {44, 4}, pass_mode::pass)}, + _floor2{loader.tile_atlas("metal1", {2, 2}, pass_mode::pass)}, + _wall1{loader.tile_atlas("wood2", {2, 1}, pass_mode::blocked)}, + _wall2{loader.tile_atlas("wood1", {2, 1}, pass_mode::blocked)}, _door{loader.anim_atlas("door-close", loader.SCENERY_PATH)}, _table{loader.anim_atlas("table", loader.SCENERY_PATH)}, _control_panel(loader.anim_atlas("control-panel", loader.SCENERY_PATH)) diff --git a/editor/tile-editor.cpp b/editor/tile-editor.cpp index d5743220..ffee3b66 100644 --- a/editor/tile-editor.cpp +++ b/editor/tile-editor.cpp @@ -16,8 +16,16 @@ tile_editor::tile_editor(editor_mode mode, StringView name) : _name{name}, _mode void tile_editor::load_atlases() { + pass_mode default_pass_mode; + switch (_mode) + { + case editor_mode::floor: default_pass_mode = pass_mode::pass; break; + case editor_mode::walls: default_pass_mode = pass_mode::blocked; break; + default: default_pass_mode = pass_mode::see_through; break; + } + const auto filename = _name + ".json"; - for (const auto& atlas : loader.tile_atlases(filename)) + for (const auto& atlas : loader.tile_atlases(filename, default_pass_mode)) { const auto [name, _ext] = Path::splitExtension(atlas->name()); auto& [_, vec] = _permutation; |