diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-06-11 11:45:40 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-06-11 11:45:40 +0200 |
| commit | a7187fa1a4d3f816c8ad2fc865a19b26a41d05f1 (patch) | |
| tree | 5d76bcde66922ebd7baa7d777a013b13a682fe58 /anim/serialize.hpp | |
| parent | a22ae93a02226027ef3fa3dccb689e789fa59e90 (diff) | |
a
Diffstat (limited to 'anim/serialize.hpp')
| -rw-r--r-- | anim/serialize.hpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/anim/serialize.hpp b/anim/serialize.hpp index 10fd9e18..8c049978 100644 --- a/anim/serialize.hpp +++ b/anim/serialize.hpp @@ -1,12 +1,15 @@ #pragma once -#include "../defs.hpp" +#include "defs.hpp" + #include <string> #include <array> #include <vector> -#include <optional> -#include <filesystem> -#include <Magnum/Trade/ImageData.h> + +#include <Magnum/Magnum.h> +#include <Magnum/Math/Vector2.h> + +namespace std::filesystem { class path; } struct anim_frame final { @@ -24,15 +27,12 @@ struct anim_group final std::string name; std::vector<anim_frame> frames; Magnum::Vector2i ground; - - static const char* direction_to_string(anim_direction group); - static anim_direction string_to_direction(const std::string& str); }; struct anim final { - static std::optional<anim> from_json(const std::filesystem::path& pathname); - bool to_json(const std::filesystem::path& pathname); + static std::tuple<anim, bool> from_json(const std::filesystem::path& pathname); + [[nodiscard]] bool to_json(const std::filesystem::path& pathname); static constexpr int default_fps = 24; std::string name; |
