void SimpleAnimation::CreateTypeDescription() {
SimpleAnimation sa;
Animation *a(&sa);
- TypeDescription &td(TypeDescription::CreateOrGet("SimpleAnimation"));
-
- td.SetSize(sizeof(SimpleAnimation));
- td.AddSupertype(TypeDescription::GetTypeId("Animation"), ((char *)a) - ((char *)&sa));
+ int animationId(TypeDescription::GetTypeId("Animation"));
+ int boolId(TypeDescription::GetTypeId("Boolean"));
int numberId(TypeDescription::GetTypeId("Number"));
+ int spriteId(TypeDescription::GetTypeId("Sprite"));
+
+ TypeDescription &td(TypeDescription::CreateOrGet("SimpleAnimation"));
+ td.SetConstructor(&Construct);
+ td.SetSize(sizeof(SimpleAnimation));
+ td.AddSupertype(animationId, ((char *)a) - ((char *)&sa));
+ Animation::AddFields(td, sa, ((char *)a) - ((char *)&sa), boolId, numberId, spriteId);
td.AddField("framecount", FieldDescription(((char *)&sa.numFrames) - ((char *)&sa), numberId, false));
td.AddField("col", FieldDescription(((char *)&sa.col) - ((char *)&sa), numberId, false));
td.AddField("row", FieldDescription(((char *)&sa.row) - ((char *)&sa), numberId, false));
}
+void SimpleAnimation::Construct(void *data) {
+ new (data) SimpleAnimation;
+}
+
}