diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-12 08:40:08 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-12 09:57:16 +0100 |
commit | a6af5d7b0cdb037bf8d0fd99aedfedc9789fd74c (patch) | |
tree | 6664758f61d0bee67ba64f231a6ec2e6b4dd72ac /src/anim.hpp | |
parent | 7434d29f3ce0033194b53b44ed881f749e67da75 (diff) |
add offset to anim_group rotations
Diffstat (limited to 'src/anim.hpp')
-rw-r--r-- | src/anim.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/anim.hpp b/src/anim.hpp new file mode 100644 index 00000000..771df5d7 --- /dev/null +++ b/src/anim.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include "compat/integer-types.hpp" +#include <vector> +#include <Corrade/Containers/String.h> +#include <Magnum/Magnum.h> +#include <Magnum/Math/Vector2.h> + +namespace floormat { + +struct anim_frame final +{ + Vector2i ground; + Vector2ui offset, size; +}; + +enum class anim_direction : unsigned char +{ + N, NE, E, SE, S, SW, W, NW, + COUNT, +}; + +struct anim_group final +{ + String name; + std::vector<anim_frame> frames; + Vector2ui ground; + Vector2b offset; +}; + +struct anim_def final +{ + static constexpr int default_fps = 24; + + String object_name, anim_name; + std::vector<anim_group> groups; + Vector2ui pixel_size; + std::size_t nframes = 0, width = 0, height = 0, fps = default_fps, actionframe = 0; +}; + +} // namespace floormat |