X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FComplexAnimation.cpp;h=cb125f5ac20f706fd23e4d2ab1b0c2c12f13dda6;hb=9f352d64f920f46a2d5b4fe67408154629933293;hp=b54baf9396aeb7e56b1c26efe3198c3571162327;hpb=20e3191911c173d6c9b97dde6b99bd96f5e342cb;p=l2e.git diff --git a/src/graphics/ComplexAnimation.cpp b/src/graphics/ComplexAnimation.cpp index b54baf9..cb125f5 100644 --- a/src/graphics/ComplexAnimation.cpp +++ b/src/graphics/ComplexAnimation.cpp @@ -17,27 +17,35 @@ namespace graphics { void ComplexAnimation::CreateTypeDescription() { ComplexAnimation ca; Animation *a(&ca); - TypeDescription &td(TypeDescription::CreateOrGet("ComplexAnimation")); - - td.SetSize(sizeof(ComplexAnimation)); - td.AddSupertype(TypeDescription::GetTypeId("Animation"), ((char *)a) - ((char *)&ca)); + int animationId(TypeDescription::GetTypeId("Animation")); + int boolId(TypeDescription::GetTypeId("Boolean")); int frameId(TypeDescription::GetTypeId("ComplexAnimationFrame")); + int numberId(TypeDescription::GetTypeId("Number")); + int spriteId(TypeDescription::GetTypeId("Sprite")); + int vectorId(TypeDescription::GetTypeId("Vector")); + + TypeDescription &td(TypeDescription::CreateOrGet("ComplexAnimation")); + td.SetConstructor(&Construct); + td.SetSize(sizeof(ComplexAnimation)); + td.AddSupertype(animationId, ((char *)a) - ((char *)&ca)); + Animation::AddFields(td, ca, ((char *)a) - ((char *)&ca), boolId, numberId, spriteId); td.AddField("frames", FieldDescription(((char *)&ca.frames) - ((char *)&ca), frameId, true, true)); FrameProp fp; - TypeDescription &ftd(TypeDescription::CreateOrGet("ComplexAnimationFrame")); + TypeDescription &ftd(TypeDescription::CreateOrGet("ComplexAnimationFrame")); ftd.SetSize(sizeof(FrameProp)); - int numberId(TypeDescription::GetTypeId("Number")); - int vectorId(TypeDescription::GetTypeId("Vector")); - ftd.AddField("column", FieldDescription(((char *)&fp.col) - ((char *)&fp), numberId, false)); ftd.AddField("row", FieldDescription(((char *)&fp.row) - ((char *)&fp), numberId, false)); ftd.AddField("disposition", FieldDescription(((char *)&fp.disposition) - ((char *)&fp), vectorId, false)); } +void ComplexAnimation::Construct(void *data) { + new (data) ComplexAnimation; +} + }