]> git.localhorst.tv Git - l2e.git/blob - src/graphics/SimpleAnimation.cpp
added type description of simple animation
[l2e.git] / src / graphics / SimpleAnimation.cpp
1 /*
2  * SimpleAnimation.cpp
3  *
4  *  Created on: Sep 5, 2012
5  *      Author: holy
6  */
7
8 #include "SimpleAnimation.h"
9
10 #include "../loader/TypeDescription.h"
11
12 using loader::FieldDescription;
13 using loader::TypeDescription;
14
15 namespace graphics {
16
17 void SimpleAnimation::CreateTypeDescription() {
18         SimpleAnimation sa;
19         Animation *a(&sa);
20         TypeDescription &td(TypeDescription::CreateOrGet("SimpleAnimation"));
21
22         td.SetSize(sizeof(SimpleAnimation));
23         td.AddSupertype(TypeDescription::GetTypeId("Animation"), ((char *)a) - ((char *)&sa));
24
25         int numberId(TypeDescription::GetTypeId("Number"));
26
27         td.AddField("framecount", FieldDescription(((char *)&sa.numFrames) - ((char *)&sa), numberId, false));
28         td.AddField("col", FieldDescription(((char *)&sa.col) - ((char *)&sa), numberId, false));
29         td.AddField("row", FieldDescription(((char *)&sa.row) - ((char *)&sa), numberId, false));
30 }
31
32 }