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 numberId(TypeDescription::GetTypeId("Number"));
+ TypeDescription &td(TypeDescription::CreateOrGet("SimpleAnimation"));
+ td.SetSize(sizeof(SimpleAnimation));
+ td.AddSupertype(animationId, ((char *)a) - ((char *)&sa));
+
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));