X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FComplexAnimation.cpp;h=942db777e0f72eeaec4e5b0e52777dc8db5a8fc6;hb=5cca794c5b6549b7750c88b5c2217d659fa963dd;hp=bd2eaf8732b7044b28a1d770d87539301a4f474a;hpb=67f6bb1d9727e7d1e2140cf2913aa89ebba84bf5;p=l2e.git diff --git a/src/graphics/ComplexAnimation.cpp b/src/graphics/ComplexAnimation.cpp index bd2eaf8..942db77 100644 --- a/src/graphics/ComplexAnimation.cpp +++ b/src/graphics/ComplexAnimation.cpp @@ -3,7 +3,7 @@ #include "../loader/Interpreter.h" #include "../loader/TypeDescription.h" -using geometry::Vector; +using math::Vector; using loader::FieldDescription; using loader::Interpreter; using loader::TypeDescription; @@ -26,6 +26,11 @@ ComplexAnimation::ComplexAnimation( } +ComplexAnimation::ComplexAnimation(loader::noinit_t n) +: Animation(n) { + +} + int ComplexAnimation::NumFrames() const { return numFrames; @@ -51,11 +56,12 @@ void ComplexAnimation::CreateTypeDescription() { TypeDescription &td(TypeDescription::Create(TYPE_ID, "ComplexAnimation")); td.SetDescription("Complex animation type that supports per-frame disposition and non-linear sprite offset selection."); td.SetConstructor(&Construct); + td.SetInitializer(&Initialize); td.SetSize(sizeof(ComplexAnimation)); td.AddSupertype(Animation::TYPE_ID, ((char *)a) - ((char *)&ca)); Animation::AddFields(td, ca, ((char *)a) - ((char *)&ca)); - td.AddField("frames", FieldDescription(((char *)&ca.frames) - ((char *)&ca), FrameProp::TYPE_ID).SetReferenced().SetAggregate().SetDescription("a variable number of frames")); + td.AddField("frames", FieldDescription(((char *)&ca.frames) - ((char *)&ca), FrameProp::TYPE_ID).SetAggregate().SetDescription("a variable number of frames")); FrameProp fp; @@ -73,4 +79,8 @@ void ComplexAnimation::Construct(void *data) { new (data) ComplexAnimation; } +void ComplexAnimation::Initialize(void *data) { + new (data) ComplexAnimation(loader::noinit); +} + }