X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FSimpleAnimation.cpp;h=cdd3a8e040f784d0bcb4cd76546d0743fc40fb45;hb=a67a3c4f6bc11cd5284d6c5aabf4a3e180517a03;hp=4e16b81658ec4a6dee2eec4a0eaeaffd7a7c2e01;hpb=bcbb72013091db29a085d044f200c10d66b7c47a;p=l2e.git diff --git a/src/graphics/SimpleAnimation.cpp b/src/graphics/SimpleAnimation.cpp index 4e16b81..cdd3a8e 100644 --- a/src/graphics/SimpleAnimation.cpp +++ b/src/graphics/SimpleAnimation.cpp @@ -17,16 +17,25 @@ namespace graphics { 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; +} + }