diff options
Diffstat (limited to 'loader')
-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 |
14 files changed, 23 insertions, 23 deletions
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); |