X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FSimpleAnimation.cpp;h=cdd3a8e040f784d0bcb4cd76546d0743fc40fb45;hb=be7ebd20e65d42e96c43a81f73039beded2c05e7;hp=17a0857832ce8dcfbe75b297f9113515aad4f8a3;hpb=46d158b25b842d2ec4b9734af09ca6006c934498;p=l2e.git diff --git a/src/graphics/SimpleAnimation.cpp b/src/graphics/SimpleAnimation.cpp index 17a0857..cdd3a8e 100644 --- a/src/graphics/SimpleAnimation.cpp +++ b/src/graphics/SimpleAnimation.cpp @@ -19,15 +19,23 @@ void SimpleAnimation::CreateTypeDescription() { Animation *a(&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; +} + }