X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FComplexAnimation.cpp;h=cb125f5ac20f706fd23e4d2ab1b0c2c12f13dda6;hb=a1c89e41e38eca790e168b8acd3beee974685fcd;hp=e4d293cdd920297799adda7225ad5fe59e21e5e5;hpb=46d158b25b842d2ec4b9734af09ca6006c934498;p=l2e.git diff --git a/src/graphics/ComplexAnimation.cpp b/src/graphics/ComplexAnimation.cpp index e4d293c..cb125f5 100644 --- a/src/graphics/ComplexAnimation.cpp +++ b/src/graphics/ComplexAnimation.cpp @@ -19,20 +19,23 @@ void ComplexAnimation::CreateTypeDescription() { Animation *a(&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; - int numberId(TypeDescription::GetTypeId("Number")); - int vectorId(TypeDescription::GetTypeId("Vector")); - TypeDescription &ftd(TypeDescription::CreateOrGet("ComplexAnimationFrame")); ftd.SetSize(sizeof(FrameProp)); @@ -41,4 +44,8 @@ void ComplexAnimation::CreateTypeDescription() { ftd.AddField("disposition", FieldDescription(((char *)&fp.disposition) - ((char *)&fp), vectorId, false)); } +void ComplexAnimation::Construct(void *data) { + new (data) ComplexAnimation; +} + }