]> git.localhorst.tv Git - l2e.git/blob - src/graphics/ComplexAnimation.cpp
added partial type description of Spell
[l2e.git] / src / graphics / ComplexAnimation.cpp
1 /*
2  * ComplexAnimation.cpp
3  *
4  *  Created on: Sep 5, 2012
5  *      Author: holy
6  */
7
8 #include "ComplexAnimation.h"
9
10 #include "../loader/TypeDescription.h"
11
12 using loader::FieldDescription;
13 using loader::TypeDescription;
14
15 namespace graphics {
16
17 void ComplexAnimation::CreateTypeDescription() {
18         ComplexAnimation ca;
19         Animation *a(&ca);
20         TypeDescription &td(TypeDescription::CreateOrGet("ComplexAnimation"));
21
22         td.SetSize(sizeof(ComplexAnimation));
23         td.AddSupertype(TypeDescription::GetTypeId("Animation"), ((char *)a) - ((char *)&ca));
24
25         int frameId(TypeDescription::GetTypeId("ComplexAnimationFrame"));
26
27         td.AddField("frames", FieldDescription(((char *)&ca.frames) - ((char *)&ca), frameId, true, true));
28
29
30         FrameProp fp;
31         TypeDescription &ftd(TypeDescription::CreateOrGet("ComplexAnimationFrame"));
32
33         ftd.SetSize(sizeof(FrameProp));
34
35         int numberId(TypeDescription::GetTypeId("Number"));
36         int vectorId(TypeDescription::GetTypeId("Vector"));
37
38         ftd.AddField("column", FieldDescription(((char *)&fp.col) - ((char *)&fp), numberId, false));
39         ftd.AddField("row", FieldDescription(((char *)&fp.row) - ((char *)&fp), numberId, false));
40         ftd.AddField("disposition", FieldDescription(((char *)&fp.disposition) - ((char *)&fp), vectorId, false));
41 }
42
43 }