From 47b9691f9bde62ea62f6601503997d93ed7ab64c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jul 2024 12:27:46 +0200 Subject: wa --- serialize/ground-atlas.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'serialize/ground-atlas.cpp') diff --git a/serialize/ground-atlas.cpp b/serialize/ground-atlas.cpp index d563bb05..49bcf7b9 100644 --- a/serialize/ground-atlas.cpp +++ b/serialize/ground-atlas.cpp @@ -1,5 +1,6 @@ #include "ground-atlas.hpp" #include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" #include "src/ground-atlas.hpp" #include "src/ground-def.hpp" #include "loader/loader.hpp" @@ -49,15 +50,15 @@ void adl_serializer::from_json(const json& j, ground_cell& val) } -void adl_serializer>::to_json(json& j, const std::shared_ptr& x) +void adl_serializer>::to_json(json& j, const bptr& x) { j = std::tuple{x->name(), x->num_tiles2(), x->pass_mode()}; } -void adl_serializer>::from_json(const json& j, std::shared_ptr& val) +void adl_serializer>::from_json(const json& j, bptr& val) { ground_def def = j; - val = std::make_shared(move(def), loader.texture(loader.GROUND_TILESET_PATH, def.name)); + val = bptr(InPlace, move(def), loader.texture(loader.GROUND_TILESET_PATH, def.name)); } } // namespace nlohmann -- cgit v1.2.3