4 * Created on: Sep 5, 2012
8 #include "SimpleAnimation.h"
10 #include "../loader/TypeDescription.h"
12 using loader::FieldDescription;
13 using loader::TypeDescription;
17 void SimpleAnimation::CreateTypeDescription() {
21 int animationId(TypeDescription::GetTypeId("Animation"));
22 int boolId(TypeDescription::GetTypeId("Boolean"));
23 int numberId(TypeDescription::GetTypeId("Number"));
24 int spriteId(TypeDescription::GetTypeId("Sprite"));
26 TypeDescription &td(TypeDescription::CreateOrGet("SimpleAnimation"));
27 td.SetConstructor(&Construct);
28 td.SetSize(sizeof(SimpleAnimation));
29 td.AddSupertype(animationId, ((char *)a) - ((char *)&sa));
31 Animation::AddFields(td, sa, ((char *)a) - ((char *)&sa), boolId, numberId, spriteId);
32 td.AddField("framecount", FieldDescription(((char *)&sa.numFrames) - ((char *)&sa), numberId, false));
33 td.AddField("col", FieldDescription(((char *)&sa.col) - ((char *)&sa), numberId, false));
34 td.AddField("row", FieldDescription(((char *)&sa.row) - ((char *)&sa), numberId, false));
37 void SimpleAnimation::Construct(void *data) {
38 new (data) SimpleAnimation;