]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/SimpleAnimation.cpp
added type description of simple animation
[l2e.git] / src / graphics / SimpleAnimation.cpp
diff --git a/src/graphics/SimpleAnimation.cpp b/src/graphics/SimpleAnimation.cpp
new file mode 100644 (file)
index 0000000..4e16b81
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * SimpleAnimation.cpp
+ *
+ *  Created on: Sep 5, 2012
+ *      Author: holy
+ */
+
+#include "SimpleAnimation.h"
+
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
+namespace graphics {
+
+void SimpleAnimation::CreateTypeDescription() {
+       SimpleAnimation sa;
+       Animation *a(&sa);
+       TypeDescription &td(TypeDescription::CreateOrGet("SimpleAnimation"));
+
+       td.SetSize(sizeof(SimpleAnimation));
+       td.AddSupertype(TypeDescription::GetTypeId("Animation"), ((char *)a) - ((char *)&sa));
+
+       int numberId(TypeDescription::GetTypeId("Number"));
+
+       td.AddField("framecount", FieldDescription(((char *)&sa.numFrames) - ((char *)&sa), numberId, false));
+       td.AddField("col", FieldDescription(((char *)&sa.col) - ((char *)&sa), numberId, false));
+       td.AddField("row", FieldDescription(((char *)&sa.row) - ((char *)&sa), numberId, false));
+}
+
+}