diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-22 13:41:14 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-22 13:41:14 +0100 |
commit | a5c6ca806b2bde216effbea7cd5d964b3f235b5f (patch) | |
tree | bd859c8082ff1460c957d965aca9f485d97bc973 /serialize/anim.cpp | |
parent | be44dc48469437370abab260fbd2c91a82109f9c (diff) |
a
Diffstat (limited to 'serialize/anim.cpp')
-rw-r--r-- | serialize/anim.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/serialize/anim.cpp b/serialize/anim.cpp index 8d8bc2bb..8cf074c8 100644 --- a/serialize/anim.cpp +++ b/serialize/anim.cpp @@ -11,7 +11,9 @@ namespace floormat { //NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(anim_group, name, frames, ground, offset) //NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(anim_def, object_name, anim_name, pixel_size, nframes, actionframe, fps, groups, scale) -static void to_json(nlohmann::json& j, const anim_frame& val) +using nlohmann::json; + +static void to_json(json& j, const anim_frame& val) { constexpr anim_frame def; @@ -23,7 +25,7 @@ static void to_json(nlohmann::json& j, const anim_frame& val) j["size"] = val.size; } -static void from_json(const nlohmann::json& j, anim_frame& val) +static void from_json(const json& j, anim_frame& val) { val = {}; if (j.contains("ground")) @@ -34,7 +36,7 @@ static void from_json(const nlohmann::json& j, anim_frame& val) val.size = j["size"]; } -static void to_json(nlohmann::json& j, const anim_group& val) +static void to_json(json& j, const anim_group& val) { const anim_group def{}; @@ -53,7 +55,7 @@ static void to_json(nlohmann::json& j, const anim_group& val) j["depth-offset"] = val.depth_offset; } -static void from_json(const nlohmann::json& j, anim_group& val) +static void from_json(const json& j, anim_group& val) { val = {}; val.name = j["name"]; @@ -75,7 +77,7 @@ static void from_json(const nlohmann::json& j, anim_group& val) val.depth_offset = j["depth-offset"]; } -static void to_json(nlohmann::json& j, const anim_def& val) +static void to_json(json& j, const anim_def& val) { const anim_def def{}; @@ -96,7 +98,7 @@ static void to_json(nlohmann::json& j, const anim_def& val) j["scale"] = val.scale; } -static void from_json(const nlohmann::json& j, anim_def& val) +static void from_json(const json& j, anim_def& val) { val = {}; val.object_name = j["object_name"]; |