From a6514d1a95d0f84f0935866215463ef6aed23e19 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 7 Feb 2024 23:38:31 +0100 Subject: loader: work toward removing duplicate atlas code --- serialize/ground-atlas.cpp | 6 ++---- serialize/ground-atlas.hpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'serialize') diff --git a/serialize/ground-atlas.cpp b/serialize/ground-atlas.cpp index 71c53510..d5c04332 100644 --- a/serialize/ground-atlas.cpp +++ b/serialize/ground-atlas.cpp @@ -38,10 +38,8 @@ void adl_serializer>::to_json(json& j, const std:: void adl_serializer>::from_json(const json& j, std::shared_ptr& val) { - char buf[FILENAME_MAX]; - ground_def info = j; - auto path = loader.make_atlas_path(buf, loader.GROUND_TILESET_PATH, info.name); - val = std::make_shared(std::move(info), path, loader.texture(""_s, path)); + ground_def def = j; + val = std::make_shared(std::move(def), loader.texture(loader.GROUND_TILESET_PATH, def.name)); } } // namespace nlohmann diff --git a/serialize/ground-atlas.hpp b/serialize/ground-atlas.hpp index fc8acec5..a423ebbe 100644 --- a/serialize/ground-atlas.hpp +++ b/serialize/ground-atlas.hpp @@ -4,7 +4,7 @@ namespace floormat { -struct ground_info; +struct ground_cell; } // namespace floormat -- cgit v1.2.3