]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Animation.cpp
removed stupid file headers that eclipse put in
[l2e.git] / src / graphics / Animation.cpp
1 #include "Animation.h"
2
3 #include "Sprite.h"
4 #include "../loader/Interpreter.h"
5 #include "../loader/TypeDescription.h"
6
7 using loader::FieldDescription;
8 using loader::Interpreter;
9 using loader::TypeDescription;
10
11 namespace graphics {
12
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));
17 }
18
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"));
23 }
24
25 }