From 47b9691f9bde62ea62f6601503997d93ed7ab64c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jul 2024 12:27:46 +0200 Subject: wa --- loader/anim-atlas.cpp | 6 +++--- loader/anim-cell.hpp | 4 ++-- loader/anim-traits.cpp | 11 ++++++----- loader/anim-traits.hpp | 8 ++++---- loader/atlas-loader.hpp | 1 - loader/atlas-loader.inl | 1 - loader/ground-atlas.cpp | 7 +++---- loader/ground-cell.cpp | 1 + loader/ground-cell.hpp | 4 ++-- loader/ground-traits.cpp | 13 +++++++------ loader/ground-traits.hpp | 8 ++++---- loader/impl.cpp | 1 + loader/impl.hpp | 18 +++++++++--------- loader/loader.hpp | 14 +++++++------- loader/scenery-traits.hpp | 2 +- loader/vobj-cell.hpp | 4 ++-- loader/vobj.cpp | 5 +++-- loader/wall-atlas.cpp | 6 +++--- loader/wall-cell.cpp | 1 + loader/wall-cell.hpp | 4 ++-- loader/wall-traits.cpp | 11 ++++++----- loader/wall-traits.hpp | 8 ++++---- 22 files changed, 71 insertions(+), 67 deletions(-) (limited to 'loader') diff --git a/loader/anim-atlas.cpp b/loader/anim-atlas.cpp index 76a656e4..cfbe7245 100644 --- a/loader/anim-atlas.cpp +++ b/loader/anim-atlas.cpp @@ -2,13 +2,13 @@ #include "atlas-loader.inl" #include "anim-cell.hpp" #include "anim-traits.hpp" -#include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" namespace floormat::loader_detail { template class atlas_loader; -std::shared_ptr loader_impl::get_anim_atlas(StringView path) noexcept(false) +bptr loader_impl::get_anim_atlas(StringView path) noexcept(false) { return _anim_loader->make_atlas(path, {}); } @@ -23,7 +23,7 @@ ArrayView loader_impl::anim_atlas_list() return _anim_loader->atlas_list(); } -std::shared_ptr loader_impl::anim_atlas(StringView name, StringView dir, loader_policy p) noexcept(false) +bptr loader_impl::anim_atlas(StringView name, StringView dir, loader_policy p) noexcept(false) { char buf[fm_FILENAME_MAX]; auto path = make_atlas_path(buf, dir, name); diff --git a/loader/anim-cell.hpp b/loader/anim-cell.hpp index 37bbb7d8..ce3f6d54 100644 --- a/loader/anim-cell.hpp +++ b/loader/anim-cell.hpp @@ -1,5 +1,5 @@ #pragma once -#include +#include "compat/borrowed-ptr.hpp" #include namespace floormat { @@ -8,7 +8,7 @@ class anim_atlas; struct anim_cell { - std::shared_ptr atlas; + bptr atlas; String name; }; diff --git a/loader/anim-traits.cpp b/loader/anim-traits.cpp index 524f4c24..09da71e8 100644 --- a/loader/anim-traits.cpp +++ b/loader/anim-traits.cpp @@ -7,6 +7,7 @@ #include "serialize/json-helper.hpp" #include "serialize/anim.hpp" #include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" #include #include #include @@ -19,8 +20,8 @@ namespace floormat::loader_detail { using anim_traits = atlas_loader_traits; StringView anim_traits::loader_name() { return "anim_atlas"_s; } -auto anim_traits::atlas_of(const Cell& x) -> const std::shared_ptr& { return x.atlas; } -auto anim_traits::atlas_of(Cell& x) -> std::shared_ptr& { return x.atlas; } +auto anim_traits::atlas_of(const Cell& x) -> const bptr& { return x.atlas; } +auto anim_traits::atlas_of(Cell& x) -> bptr& { return x.atlas; } StringView anim_traits::name_of(const Cell& x) { return x.name; } String& anim_traits::name_of(Cell& x) { return x.name; } @@ -57,7 +58,7 @@ auto anim_traits::make_invalid_atlas(Storage& s) -> Cell .scale = anim_scale::fixed{size.x(), true}, .nframes = 1, }; - auto atlas = std::make_shared(loader.INVALID, loader.make_error_texture(size), move(def)); + auto atlas = bptr{InPlace, loader.INVALID, loader.make_error_texture(size), move(def)}; auto info = anim_cell { .atlas = atlas, .name = loader.INVALID, @@ -65,7 +66,7 @@ auto anim_traits::make_invalid_atlas(Storage& s) -> Cell return info; } -auto anim_traits::make_atlas(StringView name, const Cell&) -> std::shared_ptr +auto anim_traits::make_atlas(StringView name, const Cell&) -> bptr { char buf[fm_FILENAME_MAX]; auto json_path = loader.make_atlas_path(buf, {}, name, ".json"_s); @@ -96,7 +97,7 @@ auto anim_traits::make_atlas(StringView name, const Cell&) -> std::shared_ptr(name, tex, move(anim_info)); + auto atlas = bptr{InPlace, name, tex, move(anim_info)}; return atlas; } diff --git a/loader/anim-traits.hpp b/loader/anim-traits.hpp index 517a3097..85c71612 100644 --- a/loader/anim-traits.hpp +++ b/loader/anim-traits.hpp @@ -1,6 +1,6 @@ #pragma once #include "atlas-loader-fwd.hpp" -#include +#include "compat/borrowed-ptr.hpp" #include namespace floormat { struct anim_cell; class anim_atlas; } @@ -15,13 +15,13 @@ template<> struct atlas_loader_traits using Storage = atlas_storage; static StringView loader_name(); - static const std::shared_ptr& atlas_of(const Cell& x); - static std::shared_ptr& atlas_of(Cell& x); + static const bptr& atlas_of(const Cell& x); + static bptr& atlas_of(Cell& x); static StringView name_of(const Cell& x); static String& name_of(Cell& x); static void atlas_list(Storage& st); static Cell make_invalid_atlas(Storage& st); - static std::shared_ptr make_atlas(StringView name, const Cell& c); + static bptr make_atlas(StringView name, const Cell& c); static Optional make_cell(StringView name); }; diff --git a/loader/atlas-loader.hpp b/loader/atlas-loader.hpp index 226918f0..e56297c1 100644 --- a/loader/atlas-loader.hpp +++ b/loader/atlas-loader.hpp @@ -2,7 +2,6 @@ #include "compat/defs.hpp" #include "atlas-loader-fwd.hpp" #include "policy.hpp" -#include namespace floormat::loader_detail { diff --git a/loader/atlas-loader.inl b/loader/atlas-loader.inl index 8f1d1db6..6c5fedd4 100644 --- a/loader/atlas-loader.inl +++ b/loader/atlas-loader.inl @@ -5,7 +5,6 @@ #include "atlas-loader.hpp" #include "atlas-loader-storage.hpp" #include "loader/loader.hpp" -#include #include #include #include diff --git a/loader/ground-atlas.cpp b/loader/ground-atlas.cpp index d46b0dfc..4b3495a0 100644 --- a/loader/ground-atlas.cpp +++ b/loader/ground-atlas.cpp @@ -2,14 +2,14 @@ #include "atlas-loader.inl" #include "ground-traits.hpp" #include "ground-cell.hpp" +#include "compat/borrowed-ptr.inl" #include namespace floormat::loader_detail { template class atlas_loader; -std::shared_ptr -loader_impl::get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) +bptr loader_impl::get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) { return _ground_loader->make_atlas(name, { .atlas = {}, .name = {}, .size = size, .pass = pass, @@ -31,8 +31,7 @@ const ground_cell& loader_impl::invalid_ground_atlas() return _ground_loader->get_invalid_atlas(); } -const std::shared_ptr& -loader_impl::ground_atlas(StringView filename, loader_policy policy) noexcept(false) +const bptr& loader_impl::ground_atlas(StringView filename, loader_policy policy) noexcept(false) { return _ground_loader->get_atlas(filename, policy); } diff --git a/loader/ground-cell.cpp b/loader/ground-cell.cpp index 21982bd0..33696cd6 100644 --- a/loader/ground-cell.cpp +++ b/loader/ground-cell.cpp @@ -4,6 +4,7 @@ //#include "serialize/corrade-string.hpp" #include "serialize/ground-atlas.hpp" #include "serialize/corrade-array.hpp" +#include "compat/borrowed-ptr.inl" #include namespace floormat { diff --git a/loader/ground-cell.hpp b/loader/ground-cell.hpp index 9326cb9c..d96132a0 100644 --- a/loader/ground-cell.hpp +++ b/loader/ground-cell.hpp @@ -1,6 +1,6 @@ #pragma once #include "src/pass-mode.hpp" -#include +#include "compat/borrowed-ptr.hpp" #include #include @@ -10,7 +10,7 @@ class ground_atlas; struct ground_cell { - std::shared_ptr atlas; + bptr atlas; String name; Vector2ub size; pass_mode pass = pass_mode::pass; diff --git a/loader/ground-traits.cpp b/loader/ground-traits.cpp index fd3b2dc1..3061ef4c 100644 --- a/loader/ground-traits.cpp +++ b/loader/ground-traits.cpp @@ -5,6 +5,7 @@ #include "src/tile-defs.hpp" #include "src/ground-atlas.hpp" #include "compat/assert.hpp" +#include "compat/borrowed-ptr.inl" #include #include #include @@ -15,8 +16,8 @@ namespace floormat::loader_detail { using ground_traits = atlas_loader_traits; StringView ground_traits::loader_name() { return "ground_atlas"_s; } -auto ground_traits::atlas_of(const Cell& x) -> const std::shared_ptr& { return x.atlas; } -auto ground_traits::atlas_of(Cell& x) -> std::shared_ptr& { return x.atlas; } +auto ground_traits::atlas_of(const Cell& x) -> const bptr& { return x.atlas; } +auto ground_traits::atlas_of(Cell& x) -> bptr& { return x.atlas; } StringView ground_traits::name_of(const Cell& x) { return x.name; } String& ground_traits::name_of(Cell& x) { return x.name; } @@ -30,17 +31,17 @@ void ground_traits::atlas_list(Storage& s) auto ground_traits::make_invalid_atlas(Storage& s) -> Cell { fm_debug_assert(!s.invalid_atlas); - auto atlas = std::make_shared( + auto atlas = bptr{InPlace, ground_def{loader.INVALID, Vector2ub{1,1}, pass_mode::pass}, - loader.make_error_texture(Vector2ui(tile_size_xy))); + loader.make_error_texture(Vector2ui(tile_size_xy))}; return ground_cell{ atlas, atlas->name(), atlas->num_tiles2(), atlas->pass_mode() }; } -auto ground_traits::make_atlas(StringView name, const Cell& c) -> std::shared_ptr +auto ground_traits::make_atlas(StringView name, const Cell& c) -> bptr { auto def = ground_def{name, c.size, c.pass}; auto tex = loader.texture(loader.GROUND_TILESET_PATH, name); - auto atlas = std::make_shared(def, tex); + auto atlas = bptr{InPlace, def, tex}; return atlas; } diff --git a/loader/ground-traits.hpp b/loader/ground-traits.hpp index f3fff4ee..c4d9b905 100644 --- a/loader/ground-traits.hpp +++ b/loader/ground-traits.hpp @@ -1,6 +1,6 @@ #pragma once #include "atlas-loader-fwd.hpp" -#include +#include "compat/borrowed-ptr.hpp" namespace floormat { struct ground_cell; class ground_atlas; } @@ -14,13 +14,13 @@ template<> struct atlas_loader_traits using Storage = atlas_storage; static StringView loader_name(); - static const std::shared_ptr& atlas_of(const Cell& x); - static std::shared_ptr& atlas_of(Cell& x); + static const bptr& atlas_of(const Cell& x); + static bptr& atlas_of(Cell& x); static StringView name_of(const Cell& x); static String& name_of(Cell& x); static void atlas_list(Storage& s); static Cell make_invalid_atlas(Storage& st); - static std::shared_ptr make_atlas(StringView name, const Cell& c); + static bptr make_atlas(StringView name, const Cell& c); static Optional make_cell(StringView name); }; diff --git a/loader/impl.cpp b/loader/impl.cpp index cc37e8c8..86bd76d5 100644 --- a/loader/impl.cpp +++ b/loader/impl.cpp @@ -1,5 +1,6 @@ #include "impl.hpp" #include "compat/assert.hpp" +#include "compat/borrowed-ptr.inl" #include "ground-traits.hpp" #include "ground-cell.hpp" #include "wall-traits.hpp" diff --git a/loader/impl.hpp b/loader/impl.hpp index b873ba82..9b3ab1c0 100644 --- a/loader/impl.hpp +++ b/loader/impl.hpp @@ -1,9 +1,9 @@ #pragma once -#include "compat/safe-ptr.hpp" #include "loader/loader.hpp" +#include "compat/safe-ptr.hpp" +#include "compat/borrowed-ptr-fwd.hpp" #include "atlas-loader-fwd.hpp" #include -#include #include #include #include @@ -45,26 +45,26 @@ struct loader_impl final : loader_ // >-----> ground >-----> [[nodiscard]] static atlas_loader* make_ground_atlas_loader(); safe_ptr> _ground_loader{ make_ground_atlas_loader() }; - const std::shared_ptr& ground_atlas(StringView filename, loader_policy policy) noexcept(false) override; + const bptr& ground_atlas(StringView filename, loader_policy policy) noexcept(false) override; ArrayView ground_atlas_list() noexcept(false) override; const ground_cell& invalid_ground_atlas() override; - std::shared_ptr get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) override; + bptr get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) override; // >-----> walls >-----> [[nodiscard]] static atlas_loader* make_wall_atlas_loader(); safe_ptr> _wall_loader{ make_wall_atlas_loader() }; - const std::shared_ptr& wall_atlas(StringView name, loader_policy policy) override; + const bptr& wall_atlas(StringView name, loader_policy policy) override; ArrayView wall_atlas_list() override; - std::shared_ptr get_wall_atlas(StringView filename) noexcept(false) override; + bptr get_wall_atlas(StringView filename) noexcept(false) override; const wall_cell& invalid_wall_atlas() override; // >-----> anim >-----> [[nodiscard]] static atlas_loader* make_anim_atlas_loader(); safe_ptr> _anim_loader{ make_anim_atlas_loader() }; ArrayView anim_atlas_list() override; - std::shared_ptr anim_atlas(StringView name, StringView dir, loader_policy policy) noexcept(false) override; + bptr anim_atlas(StringView name, StringView dir, loader_policy policy) noexcept(false) override; const anim_cell& invalid_anim_atlas() override; - std::shared_ptr get_anim_atlas(StringView path) noexcept(false) override; + bptr get_anim_atlas(StringView path) noexcept(false) override; // >-----> scenery >-----> [[nodiscard]] static atlas_loader* make_scenery_atlas_loader(); @@ -77,7 +77,7 @@ struct loader_impl final : loader_ // >-----> vobjs >-----> tsl::robin_map vobj_atlas_map; std::vector vobjs; - std::shared_ptr make_vobj_anim_atlas(StringView name, StringView image_filename); + bptr make_vobj_anim_atlas(StringView name, StringView image_filename); const struct vobj_cell& vobj(StringView name) override; ArrayView vobj_list() override; void get_vobj_list(); diff --git a/loader/loader.hpp b/loader/loader.hpp index cf2bbc8a..0ee08148 100644 --- a/loader/loader.hpp +++ b/loader/loader.hpp @@ -1,8 +1,8 @@ #pragma once #include "compat/defs.hpp" +#include "compat/borrowed-ptr-fwd.hpp" #include "src/pass-mode.hpp" #include "loader/policy.hpp" -#include #include //namespace Magnum { using Vector2ub = Math::Vector2; } @@ -35,9 +35,9 @@ struct loader_ virtual Trade::ImageData2D make_error_texture(Vector2ui size, Vector4ub color) = 0; virtual Trade::ImageData2D texture(StringView prefix, StringView filename) noexcept(false) = 0; - virtual const std::shared_ptr& ground_atlas(StringView filename, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0; - virtual const std::shared_ptr& wall_atlas(StringView name, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0; - virtual std::shared_ptr anim_atlas(StringView name, StringView dir, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0; + virtual const bptr& ground_atlas(StringView filename, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0; + virtual const bptr& wall_atlas(StringView name, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0; + virtual bptr anim_atlas(StringView name, StringView dir, loader_policy policy = loader_policy::DEFAULT) noexcept(false) = 0; virtual const struct scenery_proto& scenery(StringView name, loader_policy policy = loader_policy::DEFAULT) = 0; virtual ArrayView ground_atlas_list() noexcept(false) = 0; @@ -58,11 +58,11 @@ struct loader_ virtual const scenery_cell& invalid_scenery_atlas() = 0; /** \deprecated{internal use only}*/ [[nodiscard]] - virtual std::shared_ptr get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) = 0; + virtual bptr get_ground_atlas(StringView name, Vector2ub size, pass_mode pass) noexcept(false) = 0; /** \deprecated{internal use only}*/ [[nodiscard]] - virtual std::shared_ptr get_wall_atlas(StringView name) noexcept(false) = 0; + virtual bptr get_wall_atlas(StringView name) noexcept(false) = 0; /** \deprecated{internal use only}*/ [[nodiscard]] - virtual std::shared_ptr get_anim_atlas(StringView path) noexcept(false) = 0; + virtual bptr get_anim_atlas(StringView path) noexcept(false) = 0; /** \deprecated{internal use only}*/ [[nodiscard]] virtual struct scenery_proto get_scenery(StringView filename, const scenery_cell& c) noexcept(false) = 0; diff --git a/loader/scenery-traits.hpp b/loader/scenery-traits.hpp index 37aaa199..0d7387c7 100644 --- a/loader/scenery-traits.hpp +++ b/loader/scenery-traits.hpp @@ -1,6 +1,6 @@ #pragma once #include "atlas-loader-fwd.hpp" -#include +#include "compat/borrowed-ptr.hpp" namespace floormat { struct scenery_cell; struct scenery_proto; } diff --git a/loader/vobj-cell.hpp b/loader/vobj-cell.hpp index 1fa22ea2..c5882624 100644 --- a/loader/vobj-cell.hpp +++ b/loader/vobj-cell.hpp @@ -1,6 +1,6 @@ #pragma once #include -#include +#include "compat/borrowed-ptr.hpp" namespace floormat { @@ -9,7 +9,7 @@ class anim_atlas; struct vobj_cell final { String name, descr; - std::shared_ptr atlas; + bptr atlas; }; } // namespace floormat diff --git a/loader/vobj.cpp b/loader/vobj.cpp index f09c9581..789854a4 100644 --- a/loader/vobj.cpp +++ b/loader/vobj.cpp @@ -4,6 +4,7 @@ #include "src/anim-atlas.hpp" #include "src/anim.hpp" #include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" #include "loader/vobj-cell.hpp" #include #include @@ -49,7 +50,7 @@ void adl_serializer::from_json(const json& j, vobj& val) namespace floormat::loader_detail { -std::shared_ptr loader_impl::make_vobj_anim_atlas(StringView name, StringView image_filename) +bptr loader_impl::make_vobj_anim_atlas(StringView name, StringView image_filename) { auto tex = texture(VOBJ_PATH, image_filename); anim_def def; @@ -72,7 +73,7 @@ std::shared_ptr loader_impl::make_vobj_anim_atlas(StringView n def.groups = Array{1}; def.groups[0] = move(group); } - auto atlas = std::make_shared(name, tex, move(def)); + auto atlas = bptr(InPlace, name, tex, move(def)); return atlas; } diff --git a/loader/wall-atlas.cpp b/loader/wall-atlas.cpp index 8b2acb09..dbf71c47 100644 --- a/loader/wall-atlas.cpp +++ b/loader/wall-atlas.cpp @@ -3,6 +3,7 @@ #include "loader/wall-cell.hpp" #include "loader/wall-traits.hpp" #include "loader/atlas-loader.inl" +#include "compat/borrowed-ptr.inl" #include #include #include @@ -12,8 +13,7 @@ namespace floormat::loader_detail { template class atlas_loader; -std::shared_ptr -loader_impl::get_wall_atlas(StringView name) noexcept(false) +bptr loader_impl::get_wall_atlas(StringView name) noexcept(false) { return _wall_loader->make_atlas(name, {}); } @@ -33,7 +33,7 @@ const wall_cell& loader_impl::invalid_wall_atlas() return _wall_loader->get_invalid_atlas(); } -const std::shared_ptr& +const bptr& loader_impl::wall_atlas(StringView filename, loader_policy policy) noexcept(false) { return _wall_loader->get_atlas(filename, policy); diff --git a/loader/wall-cell.cpp b/loader/wall-cell.cpp index 8870b891..a385163b 100644 --- a/loader/wall-cell.cpp +++ b/loader/wall-cell.cpp @@ -1,5 +1,6 @@ #include "wall-cell.hpp" #include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" #include "serialize/json-helper.hpp" #include "serialize/corrade-string.hpp" #include "serialize/corrade-array.hpp" diff --git a/loader/wall-cell.hpp b/loader/wall-cell.hpp index 541a8339..690896c2 100644 --- a/loader/wall-cell.hpp +++ b/loader/wall-cell.hpp @@ -1,5 +1,5 @@ #pragma once -#include +#include "compat/borrowed-ptr.hpp" #include namespace floormat { @@ -8,7 +8,7 @@ class wall_atlas; struct wall_cell { - std::shared_ptr atlas; + bptr atlas; String name; static Array load_atlases_from_json(); diff --git a/loader/wall-traits.cpp b/loader/wall-traits.cpp index 07ff7d9c..e5cd7f40 100644 --- a/loader/wall-traits.cpp +++ b/loader/wall-traits.cpp @@ -6,6 +6,7 @@ #include "src/wall-atlas.hpp" #include "compat/array-size.hpp" #include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" #include #include #include @@ -15,8 +16,8 @@ namespace floormat::loader_detail { using wall_traits = atlas_loader_traits; StringView wall_traits::loader_name() { return "wall_atlas"_s; } -auto wall_traits::atlas_of(const Cell& x) -> const std::shared_ptr& { return x.atlas; } -auto wall_traits::atlas_of(Cell& x) -> std::shared_ptr& { return x.atlas; } +auto wall_traits::atlas_of(const Cell& x) -> const bptr& { return x.atlas; } +auto wall_traits::atlas_of(Cell& x) -> bptr& { return x.atlas; } StringView wall_traits::name_of(const Cell& x) { return x.name; } String& wall_traits::name_of(Cell& x) { return x.name; } @@ -33,7 +34,7 @@ auto wall_traits::make_invalid_atlas(Storage& s) -> Cell constexpr auto name = loader_::INVALID; constexpr auto frame_size = Vector2ui{tile_size_xy, tile_size_z}; - auto a = std::make_shared( + auto a = bptr(InPlace, wall_atlas_def { Wall::Info{.name = name, .depth = 8}, array({{ {}, frame_size}, }), @@ -46,7 +47,7 @@ auto wall_traits::make_invalid_atlas(Storage& s) -> Cell return { .atlas = move(a), .name = name, }; } -auto wall_traits::make_atlas(StringView name, const Cell&) -> std::shared_ptr +auto wall_traits::make_atlas(StringView name, const Cell&) -> bptr { char file_buf[fm_FILENAME_MAX], json_buf[fm_FILENAME_MAX]; auto file = loader.make_atlas_path(file_buf, loader.WALL_TILESET_PATH, name); @@ -57,7 +58,7 @@ auto wall_traits::make_atlas(StringView name, const Cell&) -> std::shared_ptr(move(def), file, tex); + auto atlas = bptr(InPlace, move(def), file, tex); return atlas; } diff --git a/loader/wall-traits.hpp b/loader/wall-traits.hpp index 9233cb97..587555ef 100644 --- a/loader/wall-traits.hpp +++ b/loader/wall-traits.hpp @@ -1,6 +1,6 @@ #pragma once #include "atlas-loader-fwd.hpp" -#include +#include "compat/borrowed-ptr.hpp" namespace floormat { struct wall_cell; class wall_atlas; } @@ -14,13 +14,13 @@ template<> struct atlas_loader_traits using Storage = atlas_storage; static StringView loader_name(); - static const std::shared_ptr& atlas_of(const Cell& x); - static std::shared_ptr& atlas_of(Cell& x); + static const bptr& atlas_of(const Cell& x); + static bptr& atlas_of(Cell& x); static StringView name_of(const Cell& x); static String& name_of(Cell& x); static void atlas_list(Storage& st); static Cell make_invalid_atlas(Storage& st); - static std::shared_ptr make_atlas(StringView name, const Cell& c); + static bptr make_atlas(StringView name, const Cell& c); static Optional make_cell(StringView name); }; -- cgit v1.2.3