From cf6c5668f1d41a0fe02f97351a522ccfb3f245d4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 9 Oct 2022 12:22:14 +0200 Subject: a --- serialize/anim.cpp | 6 +++--- serialize/anim.hpp | 22 +++++++++++----------- serialize/tile-atlas.cpp | 4 ++-- serialize/tile-atlas.hpp | 8 ++++---- serialize/tile.cpp | 6 +++--- serialize/tile.hpp | 28 ++++++++++++++-------------- 6 files changed, 37 insertions(+), 37 deletions(-) (limited to 'serialize') diff --git a/serialize/anim.cpp b/serialize/anim.cpp index 42ad1de2..0e3b371f 100644 --- a/serialize/anim.cpp +++ b/serialize/anim.cpp @@ -6,15 +6,15 @@ #include #include -namespace Magnum::Examples::Serialize { +namespace floormat::Serialize { NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(anim_frame, ground, offset, size) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(anim_group, name, frames, ground) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(anim, name, nframes, actionframe, fps, groups, width, height) -} // namespace Magnum::Examples::Serialize +} // namespace floormat::Serialize -using namespace Magnum::Examples::Serialize; +using namespace floormat::Serialize; namespace nlohmann { diff --git a/serialize/anim.hpp b/serialize/anim.hpp index 6a78f9dd..244799fb 100644 --- a/serialize/anim.hpp +++ b/serialize/anim.hpp @@ -10,7 +10,7 @@ namespace std::filesystem { class path; } -namespace Magnum::Examples::Serialize { +namespace floormat::Serialize { struct anim_frame final { @@ -41,26 +41,26 @@ struct anim final int actionframe = -1, fps = default_fps; }; -} // namespace Magnum::Examples::Serialize +} // namespace floormat::Serialize namespace nlohmann { template<> -struct adl_serializer { - static void to_json(json& j, const Magnum::Examples::Serialize::anim_frame& val); - static void from_json(const json& j, Magnum::Examples::Serialize::anim_frame& val); +struct adl_serializer { + static void to_json(json& j, const floormat::Serialize::anim_frame& val); + static void from_json(const json& j, floormat::Serialize::anim_frame& val); }; template<> -struct adl_serializer { - static void to_json(json& j, const Magnum::Examples::Serialize::anim_group& val); - static void from_json(const json& j, Magnum::Examples::Serialize::anim_group& val); +struct adl_serializer { + static void to_json(json& j, const floormat::Serialize::anim_group& val); + static void from_json(const json& j, floormat::Serialize::anim_group& val); }; template<> -struct adl_serializer { - static void to_json(json& j, const Magnum::Examples::Serialize::anim& val); - static void from_json(const json& j, Magnum::Examples::Serialize::anim& val); +struct adl_serializer { + static void to_json(json& j, const floormat::Serialize::anim& val); + static void from_json(const json& j, floormat::Serialize::anim& val); }; } // namespace nlohmann diff --git a/serialize/tile-atlas.cpp b/serialize/tile-atlas.cpp index 8021f1d5..ab72fc43 100644 --- a/serialize/tile-atlas.cpp +++ b/serialize/tile-atlas.cpp @@ -7,12 +7,12 @@ #include using namespace Magnum; -using namespace Magnum::Examples; +using namespace floormat; namespace nlohmann { using proxy_atlas = std::tuple; -using shared_atlas = std::shared_ptr; +using shared_atlas = std::shared_ptr; void adl_serializer::to_json(json& j, const shared_atlas& x) { diff --git a/serialize/tile-atlas.hpp b/serialize/tile-atlas.hpp index 8dfa8c86..f4549d7c 100644 --- a/serialize/tile-atlas.hpp +++ b/serialize/tile-atlas.hpp @@ -2,14 +2,14 @@ #include #include -namespace Magnum::Examples { struct tile_atlas; } +namespace floormat { struct tile_atlas; } namespace nlohmann { template<> -struct adl_serializer> final { - static void to_json(json& j, const std::shared_ptr& x); - static void from_json(const json& j, std::shared_ptr& x); +struct adl_serializer> final { + static void to_json(json& j, const std::shared_ptr& x); + static void from_json(const json& j, std::shared_ptr& x); }; } // namespace nlohmann diff --git a/serialize/tile.cpp b/serialize/tile.cpp index a945f171..2e94bfb8 100644 --- a/serialize/tile.cpp +++ b/serialize/tile.cpp @@ -4,17 +4,17 @@ #include "serialize/tile-atlas.hpp" #include -namespace Magnum::Examples { +namespace floormat { NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(tile_image, atlas, variant) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(tile, ground_image, wall_north, wall_west, passability) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(local_coords, x, y) -} // namespace Magnum::Examples +} // namespace floormat namespace nlohmann { -using namespace Magnum::Examples; +using namespace floormat; void adl_serializer::to_json(json& j, const tile_image& val) { using nlohmann::to_json; if (val.atlas) to_json(j, val); else j = nullptr; } void adl_serializer::from_json(const json& j, tile_image& val) { using nlohmann::from_json; from_json(j, val); } diff --git a/serialize/tile.hpp b/serialize/tile.hpp index f84ebd8d..318c86bb 100644 --- a/serialize/tile.hpp +++ b/serialize/tile.hpp @@ -1,37 +1,37 @@ #pragma once #include -namespace Magnum::Examples { +namespace floormat { struct tile_image; struct tile; struct chunk; struct local_coords; -} // namespace Magnum::Examples +} // namespace floormat namespace nlohmann { template<> -struct adl_serializer { - static void to_json(json& j, const Magnum::Examples::tile_image& val); - static void from_json(const json& j, Magnum::Examples::tile_image& val); +struct adl_serializer { + static void to_json(json& j, const floormat::tile_image& val); + static void from_json(const json& j, floormat::tile_image& val); }; template<> -struct adl_serializer { - static void to_json(json& j, const Magnum::Examples::tile& val); - static void from_json(const json& j, Magnum::Examples::tile& val); +struct adl_serializer { + static void to_json(json& j, const floormat::tile& val); + static void from_json(const json& j, floormat::tile& val); }; template<> -struct adl_serializer { - static void to_json(json& j, const Magnum::Examples::chunk& val); - static void from_json(const json& j, Magnum::Examples::chunk& val); +struct adl_serializer { + static void to_json(json& j, const floormat::chunk& val); + static void from_json(const json& j, floormat::chunk& val); }; template<> -struct adl_serializer { - static void to_json(json& j, const Magnum::Examples::local_coords& val); - static void from_json(const json& j, Magnum::Examples::local_coords& val); +struct adl_serializer { + static void to_json(json& j, const floormat::local_coords& val); + static void from_json(const json& j, floormat::local_coords& val); }; } // namespace nlohmann -- cgit v1.2.3