]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Animation.cpp
added partial type description of Spell
[l2e.git] / src / graphics / Animation.cpp
1 /*
2  * Animation.cpp
3  *
4  *  Created on: Sep 5, 2012
5  *      Author: holy
6  */
7
8 #include "Animation.h"
9
10 #include "../loader/TypeDescription.h"
11
12 using loader::FieldDescription;
13 using loader::TypeDescription;
14
15 namespace graphics {
16
17 void AddFields(TypeDescription &td, const Animation &a, std::ptrdiff_t offset) {
18         int boolId(TypeDescription::GetTypeId("Boolean"));
19         int numberId(TypeDescription::GetTypeId("Number"));
20         int spriteId(TypeDescription::GetTypeId("Sprite"));
21
22         td.AddField("sprite", FieldDescription(((char *)&a.sprite) - ((char *)&a) - offset, spriteId, true));
23         td.AddField("frametime", FieldDescription(((char *)&a.frameTime) - ((char *)&a) - offset, numberId, false));
24         td.AddField("repeat", FieldDescription(((char *)&a.repeat) - ((char *)&a) - offset, boolId, false));
25 }
26
27 }