diff options
-rw-r--r-- | editor/ground-editor.cpp | 2 | ||||
-rw-r--r-- | editor/wall-editor.cpp | 2 | ||||
-rw-r--r-- | loader/anim-atlas.cpp | 4 | ||||
-rw-r--r-- | loader/anim-traits.cpp | 2 | ||||
-rw-r--r-- | loader/anim-traits.hpp | 2 | ||||
-rw-r--r-- | loader/atlas-loader.hpp | 2 | ||||
-rw-r--r-- | loader/atlas-loader.inl | 6 | ||||
-rw-r--r-- | loader/ground-atlas.cpp | 4 | ||||
-rw-r--r-- | loader/ground-traits.cpp | 2 | ||||
-rw-r--r-- | loader/ground-traits.hpp | 2 | ||||
-rw-r--r-- | loader/impl.hpp | 6 | ||||
-rw-r--r-- | loader/loader.hpp | 6 | ||||
-rw-r--r-- | loader/scenery.cpp | 2 | ||||
-rw-r--r-- | loader/wall-atlas.cpp | 4 | ||||
-rw-r--r-- | loader/wall-traits.cpp | 2 | ||||
-rw-r--r-- | loader/wall-traits.hpp | 2 | ||||
-rw-r--r-- | test/dijkstra.cpp | 2 | ||||
-rw-r--r-- | test/json.cpp | 4 | ||||
-rw-r--r-- | test/loader.cpp | 12 | ||||
-rw-r--r-- | test/path-search.cpp | 2 | ||||
-rw-r--r-- | test/raycast.cpp | 4 | ||||
-rw-r--r-- | test/wall-atlas2.cpp | 4 |
22 files changed, 39 insertions, 39 deletions
diff --git a/editor/ground-editor.cpp b/editor/ground-editor.cpp index 653ad122..4ab697ee 100644 --- a/editor/ground-editor.cpp +++ b/editor/ground-editor.cpp @@ -33,7 +33,7 @@ void ground_editor::load_atlases() if (g.name != loader.INVALID) [[likely]] (void)loader.ground_atlas(g.name); else - loader.make_invalid_ground_atlas(); + loader.invalid_ground_atlas(); fm_assert(g.atlas); _atlases[g.name] = &g; } diff --git a/editor/wall-editor.cpp b/editor/wall-editor.cpp index 1d2e7cb3..1e50290b 100644 --- a/editor/wall-editor.cpp +++ b/editor/wall-editor.cpp @@ -55,7 +55,7 @@ void wall_editor::load_atlases() if (wa.name != loader.INVALID) [[likely]] (void)loader.wall_atlas(wa.name); else - loader.make_invalid_wall_atlas(); + loader.invalid_wall_atlas(); fm_assert(wa.atlas); _atlases[wa.name] = &wa; } diff --git a/loader/anim-atlas.cpp b/loader/anim-atlas.cpp index 1c1a7ec0..76a656e4 100644 --- a/loader/anim-atlas.cpp +++ b/loader/anim-atlas.cpp @@ -20,7 +20,7 @@ atlas_loader<class anim_atlas>* loader_impl::make_anim_atlas_loader() ArrayView<const anim_cell> loader_impl::anim_atlas_list() { - return _anim_loader->ensure_atlas_list(); + return _anim_loader->atlas_list(); } std::shared_ptr<anim_atlas> loader_impl::anim_atlas(StringView name, StringView dir, loader_policy p) noexcept(false) @@ -30,7 +30,7 @@ std::shared_ptr<anim_atlas> loader_impl::anim_atlas(StringView name, StringView return _anim_loader->get_atlas(path, p); } -const anim_cell& loader_impl::make_invalid_anim_atlas() +const anim_cell& loader_impl::invalid_anim_atlas() { return _anim_loader->get_invalid_atlas(); } diff --git a/loader/anim-traits.cpp b/loader/anim-traits.cpp index dafed985..f5a9e03a 100644 --- a/loader/anim-traits.cpp +++ b/loader/anim-traits.cpp @@ -26,7 +26,7 @@ StringView anim_traits::name_of(const Cell& x) { return x.name; } StringView anim_traits::name_of(const Atlas& x) { return x.name(); } String& anim_traits::name_of(Cell& x) { return x.name; } -void anim_traits::load_atlas_list(Storage& s) +void anim_traits::atlas_list(Storage& s) { fm_debug_assert(s.name_map.empty()); s.cell_array = {}; diff --git a/loader/anim-traits.hpp b/loader/anim-traits.hpp index 70ddcd89..78bf6b45 100644 --- a/loader/anim-traits.hpp +++ b/loader/anim-traits.hpp @@ -19,7 +19,7 @@ template<> struct atlas_loader_traits<anim_atlas> static StringView name_of(const Cell& x); static StringView name_of(const Atlas& x); static String& name_of(Cell& x); - static void load_atlas_list(Storage& st); + static void atlas_list(Storage& st); static Pointer<Cell> make_invalid_atlas(Storage& st); static std::shared_ptr<Atlas> make_atlas(StringView name, const Cell& c); static Optional<Cell> make_cell(StringView name); diff --git a/loader/atlas-loader.hpp b/loader/atlas-loader.hpp index 919e4c90..e4afb5a0 100644 --- a/loader/atlas-loader.hpp +++ b/loader/atlas-loader.hpp @@ -24,7 +24,7 @@ public: atlas_loader(TRAITS&& traits); atlas_loader() requires std::is_default_constructible_v<TRAITS>; - ArrayView<const Cell> ensure_atlas_list(); + ArrayView<const Cell> atlas_list(); const std::shared_ptr<Atlas>& get_atlas(StringView name, loader_policy p); std::shared_ptr<Atlas> make_atlas(StringView name, const Cell& cell); diff --git a/loader/atlas-loader.inl b/loader/atlas-loader.inl index 78bafaac..3a07f2ab 100644 --- a/loader/atlas-loader.inl +++ b/loader/atlas-loader.inl @@ -24,12 +24,12 @@ template<typename TRAITS> atlas_loader(TRAITS&& traits) noexcept -> atlas_loader<TRAITS, typename TRAITS::Atlas>; template<typename ATLAS, typename TRAITS> -auto atlas_loader<ATLAS, TRAITS>::ensure_atlas_list() -> ArrayView<const Cell> +auto atlas_loader<ATLAS, TRAITS>::atlas_list() -> ArrayView<const Cell> { if (!s.name_map.empty()) [[likely]] return { s.cell_array.data(), s.cell_array.size() }; - t.load_atlas_list(s); + t.atlas_list(s); for (Cell& c : s.cell_array) { @@ -64,7 +64,7 @@ auto atlas_loader<ATLAS, TRAITS>::ensure_atlas_list() -> ArrayView<const Cell> template<typename ATLAS, typename TRAITS> const std::shared_ptr<ATLAS>& atlas_loader<ATLAS, TRAITS>::get_atlas(StringView name, loader_policy p) { - ensure_atlas_list(); + atlas_list(); const std::shared_ptr<Atlas>& invalid_atlas = t.atlas_of(get_invalid_atlas()); switch (p) diff --git a/loader/ground-atlas.cpp b/loader/ground-atlas.cpp index 6e829b13..d46b0dfc 100644 --- a/loader/ground-atlas.cpp +++ b/loader/ground-atlas.cpp @@ -23,10 +23,10 @@ atlas_loader<class ground_atlas>* loader_impl::make_ground_atlas_loader() auto loader_impl::ground_atlas_list() noexcept(false) -> ArrayView<const ground_cell> { - return _ground_loader->ensure_atlas_list(); + return _ground_loader->atlas_list(); } -const ground_cell& loader_impl::make_invalid_ground_atlas() +const ground_cell& loader_impl::invalid_ground_atlas() { return _ground_loader->get_invalid_atlas(); } diff --git a/loader/ground-traits.cpp b/loader/ground-traits.cpp index e913d385..4ad1d1c4 100644 --- a/loader/ground-traits.cpp +++ b/loader/ground-traits.cpp @@ -22,7 +22,7 @@ StringView ground_traits::name_of(const Cell& x) { return x.name; } StringView ground_traits::name_of(const Atlas& x) { return x.name(); } String& ground_traits::name_of(Cell& x) { return x.name; } -void ground_traits::load_atlas_list(Storage& s) +void ground_traits::atlas_list(Storage& s) { fm_debug_assert(s.name_map.empty()); s.cell_array = ground_cell::load_atlases_from_json().vec; diff --git a/loader/ground-traits.hpp b/loader/ground-traits.hpp index 91f6c3aa..bf66419c 100644 --- a/loader/ground-traits.hpp +++ b/loader/ground-traits.hpp @@ -19,7 +19,7 @@ template<> struct atlas_loader_traits<ground_atlas> static StringView name_of(const Cell& x); static StringView name_of(const Atlas& x); static String& name_of(Cell& x); - static void load_atlas_list(Storage& s); + static void atlas_list(Storage& s); static Pointer<Cell> make_invalid_atlas(Storage& st); static std::shared_ptr<Atlas> make_atlas(StringView name, const Cell& c); static Optional<Cell> make_cell(StringView name); diff --git a/loader/impl.hpp b/loader/impl.hpp index 02d28939..58875f78 100644 --- a/loader/impl.hpp +++ b/loader/impl.hpp @@ -47,14 +47,14 @@ struct loader_impl final : loader_ const std::shared_ptr<class wall_atlas>& wall_atlas(StringView name, loader_policy policy) override; ArrayView<const wall_cell> wall_atlas_list() override; std::shared_ptr<class wall_atlas> get_wall_atlas(StringView filename) noexcept(false) override; - const wall_cell& make_invalid_wall_atlas() override; + const wall_cell& invalid_wall_atlas() override; // >-----> ground >-----> [[nodiscard]] static atlas_loader<class ground_atlas>* make_ground_atlas_loader(); safe_ptr<atlas_loader<class ground_atlas>> _ground_loader{ make_ground_atlas_loader() }; const std::shared_ptr<class ground_atlas>& ground_atlas(StringView filename, loader_policy policy) noexcept(false) override; ArrayView<const ground_cell> ground_atlas_list() noexcept(false) override; - const ground_cell& make_invalid_ground_atlas() override; + const ground_cell& invalid_ground_atlas() override; std::shared_ptr<class ground_atlas> get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) override; // >-----> anim >-----> @@ -62,7 +62,7 @@ struct loader_impl final : loader_ safe_ptr<atlas_loader<class anim_atlas>> _anim_loader{ make_anim_atlas_loader() }; ArrayView<const anim_cell> anim_atlas_list() override; std::shared_ptr<class anim_atlas> anim_atlas(StringView name, StringView dir, loader_policy policy) noexcept(false) override; - const anim_cell& make_invalid_anim_atlas() override; + const anim_cell& invalid_anim_atlas() override; std::shared_ptr<class anim_atlas> get_anim_atlas(StringView path) noexcept(false) override; // >-----> scenery >-----> diff --git a/loader/loader.hpp b/loader/loader.hpp index 501e25f5..eca525ab 100644 --- a/loader/loader.hpp +++ b/loader/loader.hpp @@ -47,9 +47,9 @@ struct loader_ static StringView make_atlas_path(char(&buf)[fm_FILENAME_MAX], StringView dir, StringView name, StringView extension = {}); [[nodiscard]] static bool check_atlas_name(StringView name) noexcept; - virtual const wall_cell& make_invalid_wall_atlas() = 0; - virtual const ground_cell& make_invalid_ground_atlas() = 0; - virtual const anim_cell& make_invalid_anim_atlas() = 0; + virtual const wall_cell& invalid_wall_atlas() = 0; + virtual const ground_cell& invalid_ground_atlas() = 0; + virtual const anim_cell& invalid_anim_atlas() = 0; /** \deprecated{internal use only}*/ [[nodiscard]] virtual std::shared_ptr<class ground_atlas> get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) = 0; diff --git a/loader/scenery.cpp b/loader/scenery.cpp index d83cb346..879e72d9 100644 --- a/loader/scenery.cpp +++ b/loader/scenery.cpp @@ -29,7 +29,7 @@ void loader_impl::get_scenery_list() if constexpr(true) // todo! { auto proto = scenery_proto{}; - proto.atlas = make_invalid_anim_atlas().atlas; + proto.atlas = invalid_anim_atlas().atlas; proto.bbox_size = Vector2ub{20}; proto.subtype = generic_scenery_proto{false, true}; sceneries_array.push_back({ .name = INVALID, .proto = proto }); diff --git a/loader/wall-atlas.cpp b/loader/wall-atlas.cpp index 67e4fdf8..8b2acb09 100644 --- a/loader/wall-atlas.cpp +++ b/loader/wall-atlas.cpp @@ -25,10 +25,10 @@ atlas_loader<class wall_atlas>* loader_impl::make_wall_atlas_loader() ArrayView<const wall_cell> loader_impl::wall_atlas_list() noexcept(false) { - return _wall_loader->ensure_atlas_list(); + return _wall_loader->atlas_list(); } -const wall_cell& loader_impl::make_invalid_wall_atlas() +const wall_cell& loader_impl::invalid_wall_atlas() { return _wall_loader->get_invalid_atlas(); } diff --git a/loader/wall-traits.cpp b/loader/wall-traits.cpp index 634659cd..83d6a836 100644 --- a/loader/wall-traits.cpp +++ b/loader/wall-traits.cpp @@ -22,7 +22,7 @@ StringView wall_traits::name_of(const Cell& x) { return x.name; } StringView wall_traits::name_of(const Atlas& x) { return x.name(); } String& wall_traits::name_of(Cell& x) { return x.name; } -void wall_traits::load_atlas_list(Storage& s) +void wall_traits::atlas_list(Storage& s) { fm_debug_assert(s.name_map.empty()); s.cell_array = wall_cell::load_atlases_from_json().vec; diff --git a/loader/wall-traits.hpp b/loader/wall-traits.hpp index e773ef58..2de0d96a 100644 --- a/loader/wall-traits.hpp +++ b/loader/wall-traits.hpp @@ -19,7 +19,7 @@ template<> struct atlas_loader_traits<wall_atlas> static StringView name_of(const Cell& x); static StringView name_of(const Atlas& x); static String& name_of(Cell& x); - static void load_atlas_list(Storage& st); + static void atlas_list(Storage& st); static Pointer<Cell> make_invalid_atlas(Storage& st); static std::shared_ptr<Atlas> make_atlas(StringView name, const Cell& c); static Optional<Cell> make_cell(StringView name); diff --git a/test/dijkstra.cpp b/test/dijkstra.cpp index 6b2eafd4..63a932d9 100644 --- a/test/dijkstra.cpp +++ b/test/dijkstra.cpp @@ -20,7 +20,7 @@ void test_app::test_dijkstra() constexpr auto wpos = global_coords{wch, wt}; auto& ch = w[wch]; - auto wall = wall_image_proto{loader.make_invalid_wall_atlas().atlas, 0}; + auto wall = wall_image_proto{loader.invalid_wall_atlas().atlas, 0}; for (int16_t j = wcy - 1; j <= wcy + 1; j++) for (int16_t i = wcx - 1; i <= wcx + 1; i++) diff --git a/test/json.cpp b/test/json.cpp index aac6fdee..5733c691 100644 --- a/test/json.cpp +++ b/test/json.cpp @@ -39,9 +39,9 @@ void test_app::test_json2() { fm_assert(Path::exists(Path::join(loader.TEMP_PATH, "CMakeCache.txt"))); const auto output_dir = Path::join(loader.TEMP_PATH, "test/."_s); - auto atlas1 = loader.make_invalid_ground_atlas().atlas; + auto atlas1 = loader.invalid_ground_atlas().atlas; json_helper::to_json(atlas1, Path::join(output_dir, "atlas1.json")); - auto atlas2 = loader.make_invalid_wall_atlas().atlas; + auto atlas2 = loader.invalid_wall_atlas().atlas; atlas2->serialize(Path::join(output_dir, "atlas2.json")); } diff --git a/test/loader.cpp b/test/loader.cpp index 01792bd6..b36ca0ca 100644 --- a/test/loader.cpp +++ b/test/loader.cpp @@ -41,13 +41,13 @@ constexpr const char* anim_atlases[] = { void test_app::test_loader() { - fm_assert(loader.make_invalid_ground_atlas().atlas); - fm_assert(&loader.make_invalid_ground_atlas().atlas == &loader.make_invalid_ground_atlas().atlas); - fm_assert(loader.make_invalid_ground_atlas().name == loader.INVALID); + fm_assert(loader.invalid_ground_atlas().atlas); + fm_assert(&loader.invalid_ground_atlas().atlas == &loader.invalid_ground_atlas().atlas); + fm_assert(loader.invalid_ground_atlas().name == loader.INVALID); - fm_assert(loader.make_invalid_wall_atlas().atlas); - fm_assert(&loader.make_invalid_wall_atlas().atlas == &loader.make_invalid_wall_atlas().atlas); - fm_assert(loader.make_invalid_wall_atlas().name == loader.INVALID); + fm_assert(loader.invalid_wall_atlas().atlas); + fm_assert(&loader.invalid_wall_atlas().atlas == &loader.invalid_wall_atlas().atlas); + fm_assert(loader.invalid_wall_atlas().name == loader.INVALID); for (const auto& str : anim_atlases) (void)loader.anim_atlas(str, {}); diff --git a/test/path-search.cpp b/test/path-search.cpp index f602a8b9..caaa55f2 100644 --- a/test/path-search.cpp +++ b/test/path-search.cpp @@ -179,7 +179,7 @@ void test_bbox() return neighbor_tiles(w, { ch, pos }, {}, (object_id)-1, path_search::never_continue()); }; - const auto wall = loader.make_invalid_wall_atlas().atlas; + const auto wall = loader.invalid_wall_atlas().atlas; const auto table = loader.scenery("table1"); { diff --git a/test/raycast.cpp b/test/raycast.cpp index 6e3880cd..c5ba7cfb 100644 --- a/test/raycast.cpp +++ b/test/raycast.cpp @@ -14,8 +14,8 @@ world make_world() { constexpr auto var = (variant_t)-1; #if 1 - auto wall1_ = loader.make_invalid_wall_atlas().atlas; - auto wall2_ = loader.make_invalid_wall_atlas().atlas; + auto wall1_ = loader.invalid_wall_atlas().atlas; + auto wall2_ = loader.invalid_wall_atlas().atlas; #else auto wall1_ = loader.wall_atlas("test1"_s); auto wall2_ = loader.wall_atlas("concrete1"_s); diff --git a/test/wall-atlas2.cpp b/test/wall-atlas2.cpp index f112c1c6..3faa306f 100644 --- a/test/wall-atlas2.cpp +++ b/test/wall-atlas2.cpp @@ -28,8 +28,8 @@ void test_loading() } else { - fm_assert(loader.make_invalid_wall_atlas().atlas); - fm_assert(x.atlas == loader.make_invalid_wall_atlas().atlas); + fm_assert(loader.invalid_wall_atlas().atlas); + fm_assert(x.atlas == loader.invalid_wall_atlas().atlas); } } } |