diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-09 12:22:14 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-09 12:22:14 +0200 |
commit | cf6c5668f1d41a0fe02f97351a522ccfb3f245d4 (patch) | |
tree | 2dd795feb2b735773ca936effa57884986196aca /serialize | |
parent | b581b559fe426f39b1d548ca27f03cb22dd2ed22 (diff) |
a
Diffstat (limited to 'serialize')
-rw-r--r-- | serialize/anim.cpp | 6 | ||||
-rw-r--r-- | serialize/anim.hpp | 22 | ||||
-rw-r--r-- | serialize/tile-atlas.cpp | 4 | ||||
-rw-r--r-- | serialize/tile-atlas.hpp | 8 | ||||
-rw-r--r-- | serialize/tile.cpp | 6 | ||||
-rw-r--r-- | serialize/tile.hpp | 28 |
6 files changed, 37 insertions, 37 deletions
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 <Corrade/Utility/Debug.h> #include <Corrade/Utility/DebugStl.h> -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<Magnum::Examples::Serialize::anim_frame> { - 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<floormat::Serialize::anim_frame> { + 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<Magnum::Examples::Serialize::anim_group> { - 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<floormat::Serialize::anim_group> { + 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<Magnum::Examples::Serialize::anim> { - 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<floormat::Serialize::anim> { + 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 <nlohmann/json.hpp> using namespace Magnum; -using namespace Magnum::Examples; +using namespace floormat; namespace nlohmann { using proxy_atlas = std::tuple<std::string, Vector2ui>; -using shared_atlas = std::shared_ptr<Magnum::Examples::tile_atlas>; +using shared_atlas = std::shared_ptr<floormat::tile_atlas>; void adl_serializer<shared_atlas>::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 <memory> #include <nlohmann/json_fwd.hpp> -namespace Magnum::Examples { struct tile_atlas; } +namespace floormat { struct tile_atlas; } namespace nlohmann { template<> -struct adl_serializer<std::shared_ptr<Magnum::Examples::tile_atlas>> final { - static void to_json(json& j, const std::shared_ptr<Magnum::Examples::tile_atlas>& x); - static void from_json(const json& j, std::shared_ptr<Magnum::Examples::tile_atlas>& x); +struct adl_serializer<std::shared_ptr<floormat::tile_atlas>> final { + static void to_json(json& j, const std::shared_ptr<floormat::tile_atlas>& x); + static void from_json(const json& j, std::shared_ptr<floormat::tile_atlas>& 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 <nlohmann/json.hpp> -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<tile_image>::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<tile_image>::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 <nlohmann/json_fwd.hpp> -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<Magnum::Examples::tile_image> { - 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<floormat::tile_image> { + 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<Magnum::Examples::tile> { - 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<floormat::tile> { + static void to_json(json& j, const floormat::tile& val); + static void from_json(const json& j, floormat::tile& val); }; template<> -struct adl_serializer<Magnum::Examples::chunk> { - 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<floormat::chunk> { + static void to_json(json& j, const floormat::chunk& val); + static void from_json(const json& j, floormat::chunk& val); }; template<> -struct adl_serializer<Magnum::Examples::local_coords> { - 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<floormat::local_coords> { + static void to_json(json& j, const floormat::local_coords& val); + static void from_json(const json& j, floormat::local_coords& val); }; } // namespace nlohmann |