diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 19:26:45 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 19:26:45 +0100 |
commit | 618af3c94ca418511a658c7a3e074b249b6e6937 (patch) | |
tree | 0b5c5032e6b7bd2419dfbb94e23599da46e3241c | |
parent | e990e7c14228acf7090db19adb8ed4643e54aeb3 (diff) |
a
-rw-r--r-- | editor/update.cpp | 33 | ||||
-rw-r--r-- | loader/ground-atlas.cpp | 4 | ||||
-rw-r--r-- | loader/wall-atlas.cpp | 4 |
3 files changed, 10 insertions, 31 deletions
diff --git a/editor/update.cpp b/editor/update.cpp index 3d22c37c..cde6059a 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -15,37 +15,12 @@ namespace floormat { //#define FM_NO_BINDINGS -void app::maybe_initialize_chunk_(const chunk_coords_& pos, chunk& c) +void app::maybe_initialize_chunk_([[maybe_unused]] const chunk_coords_& pos, chunk& c) { - auto floor1 = loader.ground_atlas("ground-tiles"); - auto floor2 = loader.ground_atlas("metal1"); - auto wall1 = loader.ground_atlas("wood2"); - auto wall2 = loader.ground_atlas("wood1"); - auto door = loader.anim_atlas("door-close", loader.SCENERY_PATH); - auto table = loader.anim_atlas("table", loader.SCENERY_PATH); - auto control_panel = loader.anim_atlas("control-panel", loader.SCENERY_PATH); + auto floor1 = loader.ground_atlas("floor-tiles"); - (void)pos; (void)c; - - [[maybe_unused]] constexpr auto N = TILE_MAX_DIM; - for (auto [x, k, pt] : c) { -#if 1 - const auto& atlas = floor1; -#else - const auto& atlas = pt.x == N/2 || pt.y == N/2 ? _floor2 : _floor1; -#endif - x.ground() = { atlas, variant_t(k % atlas->num_tiles()) }; - } -#if 0 - constexpr auto K = N/2; - c[{K, K }].wall_north() = { _wall1, 0 }; - c[{K, K }].wall_west() = { _wall2, 0 }; - c[{K, K+1}].wall_north() = { _wall1, 0 }; - c[{K+1, K }].wall_west() = { _wall2, 0 }; - c[{K+3, K+1}].scenery() = { scenery::door, _door, rotation::N, }; - c[{ 3, 4 }].scenery() = { scenery::generic, _table, rotation::W, }; - c[{K, K+1}].scenery() = { scenery::generic, _control_panel, rotation::N, scenery::frame_t{0}, pass_mode::pass }; -#endif + for (auto [x, k, pt] : c) + x.ground() = { floor1, variant_t(k % floor1->num_tiles()) }; c.mark_modified(); } diff --git a/loader/ground-atlas.cpp b/loader/ground-atlas.cpp index 4d76e7ab..feae0ac5 100644 --- a/loader/ground-atlas.cpp +++ b/loader/ground-atlas.cpp @@ -79,8 +79,10 @@ error: ArrayView<const ground_info> loader_impl::ground_atlas_list() noexcept(false) { if (ground_atlas_map.empty()) [[unlikely]] + { get_ground_atlas_list(); - fm_assert(!ground_atlas_map.empty()); + fm_assert(!ground_atlas_map.empty()); + } return ground_atlas_array; } diff --git a/loader/wall-atlas.cpp b/loader/wall-atlas.cpp index ce0f4e4d..16531aa4 100644 --- a/loader/wall-atlas.cpp +++ b/loader/wall-atlas.cpp @@ -138,8 +138,10 @@ void loader_impl::get_wall_atlas_list() ArrayView<const wall_info> loader_impl::wall_atlas_list() { if (wall_atlas_map.empty()) [[unlikely]] + { get_wall_atlas_list(); - fm_assert(!wall_atlas_map.empty()); + fm_assert(!wall_atlas_map.empty()); + } return wall_atlas_array; } |