diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-15 01:35:24 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-15 01:35:24 +0200 |
commit | 0ce27b41cc735b02f42fe4a67dbe8ee2f4fd2ffc (patch) | |
tree | c91e60692a2b6436334cd2f8c5f7f9b67d534673 | |
parent | 2bb57f847acc9b611d696240423ed0aa68dcc452 (diff) |
editor: cleanup hardcoded seed tile
-rw-r--r-- | editor/app.cpp | 9 | ||||
-rw-r--r-- | editor/app.hpp | 2 | ||||
-rw-r--r-- | editor/update.cpp | 11 |
3 files changed, 11 insertions, 11 deletions
diff --git a/editor/app.cpp b/editor/app.cpp index 8b47bb10..020f39dc 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -19,14 +19,7 @@ namespace floormat { app::app(fm_settings&& opts) : - M{floormat_main::create(*this, std::move(opts))}, - _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)) + M{floormat_main::create(*this, std::move(opts))} { reset_world(); auto& w = M->world(); diff --git a/editor/app.hpp b/editor/app.hpp index 2e9efd7d..258225a9 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -142,8 +142,6 @@ private: Containers::Pointer<floormat_main> M; ImGuiIntegration::Context _imgui{NoCreate}; - std::shared_ptr<tile_atlas> _floor1, _floor2, _wall1, _wall2; - std::shared_ptr<anim_atlas> _door, _table, _control_panel; GL::Texture2D _wireframe_texture = wireframe::make_constant_texture(); wireframe_mesh<wireframe::quad_floor> _wireframe_quad {_wireframe_texture}; wireframe_mesh<wireframe::quad_wall_n> _wireframe_wall_n {_wireframe_texture}; diff --git a/editor/update.cpp b/editor/update.cpp index d5eb2039..64090973 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -8,6 +8,7 @@ #include "src/character.hpp" #include "src/tile-iterator.hpp" #include "keys.hpp" +#include "loader/loader.hpp" #include <cmath> namespace floormat { @@ -16,12 +17,20 @@ namespace floormat { void app::maybe_initialize_chunk_(const chunk_coords_& pos, chunk& c) { + auto floor1 = loader.tile_atlas("floor-tiles", {44, 4}, pass_mode::pass); + auto floor2 = loader.tile_atlas("metal1", {2, 2}, pass_mode::pass); + auto wall1 = loader.tile_atlas("wood2", {2, 1}, pass_mode::blocked); + auto wall2 = loader.tile_atlas("wood1", {2, 1}, pass_mode::blocked); + 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); + (void)pos; (void)c; [[maybe_unused]] constexpr auto N = TILE_MAX_DIM; for (auto [x, k, pt] : c) { #if 1 - const auto& atlas = _floor1; + const auto& atlas = floor1; #else const auto& atlas = pt.x == N/2 || pt.y == N/2 ? _floor2 : _floor1; #endif |