4 #include "../loader/Interpreter.h"
5 #include "../loader/TypeDescription.h"
7 using loader::FieldDescription;
8 using loader::Interpreter;
9 using loader::TypeDescription;
13 void Animation::CreateTypeDescription() {
14 TypeDescription &td(TypeDescription::Create(TYPE_ID, "Animation"));
15 td.SetDescription("Abstract base type for animations.");
16 td.SetSize(sizeof(Animation));
19 void Animation::AddFields(TypeDescription &td, const Animation &a, std::ptrdiff_t offset) {
20 td.AddField("sprite", FieldDescription(((char *)&a.sprite) - ((char *)&a) - offset, Sprite::TYPE_ID).SetReferenced().SetDescription("the sprite used for cutting out frames"));
21 td.AddField("frametime", FieldDescription(((char *)&a.frameTime) - ((char *)&a) - offset, Interpreter::NUMBER_ID).SetDescription("duration of a frame in miliseconds"));
22 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"));