summaryrefslogtreecommitdiffhomepage
path: root/src/anim.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/anim.hpp')
-rw-r--r--src/anim.hpp41
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