4 * Created on: Sep 5, 2012
11 #include "../loader/Interpreter.h"
12 #include "../loader/TypeDescription.h"
14 using loader::FieldDescription;
15 using loader::Interpreter;
16 using loader::TypeDescription;
20 void Animation::CreateTypeDescription() {
21 TypeDescription &td(TypeDescription::Create(TYPE_ID, "Animation"));
22 td.SetDescription("Abstract base type for animations.");
23 td.SetSize(sizeof(Animation));
26 void Animation::AddFields(TypeDescription &td, const Animation &a, std::ptrdiff_t offset) {
27 td.AddField("sprite", FieldDescription(((char *)&a.sprite) - ((char *)&a) - offset, Sprite::TYPE_ID).SetReferenced().SetDescription("the sprite used for cutting out frames"));
28 td.AddField("frametime", FieldDescription(((char *)&a.frameTime) - ((char *)&a) - offset, Interpreter::NUMBER_ID).SetDescription("duration of a frame in miliseconds"));
29 td.AddField("repeat", FieldDescription(((char *)&a.repeat) - ((char *)&a) - offset, Interpreter::BOOLEAN_ID).SetDescription("whether the animation should start over at the beginning after reaching the last frame"));