4 * Created on: Sep 5, 2012
10 #include "../loader/TypeDescription.h"
12 using loader::FieldDescription;
13 using loader::TypeDescription;
17 void Animation::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"));
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));