X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FSimpleAnimation.h;h=0864d2b024402f2509e01283558ded8f117615b3;hb=0e7b9eca67383e45e04aa419cb783c92722f7801;hp=d15c1d9a1258e19bd1ff1f08021fe2f3620c74bd;hpb=843c216fec572902bfae1fce95671b0d17aef946;p=l2e.git diff --git a/src/graphics/SimpleAnimation.h b/src/graphics/SimpleAnimation.h index d15c1d9..0864d2b 100644 --- a/src/graphics/SimpleAnimation.h +++ b/src/graphics/SimpleAnimation.h @@ -1,14 +1,8 @@ -/* - * SimpleAnimation.h - * - * Created on: Aug 11, 2012 - * Author: holy - */ - #ifndef GRAPHICS_SIMPLEANIMATION_H_ #define GRAPHICS_SIMPLEANIMATION_H_ #include "Animation.h" +#include "../loader/noinit.h" namespace graphics { @@ -16,15 +10,28 @@ class SimpleAnimation : public Animation { public: - SimpleAnimation() - : numFrames(0), col(0), row(0) { } - SimpleAnimation(const Sprite *sprite, int frameTime, int numFrames, int col = 0, int row = 0, bool repeat = false) - : Animation(sprite, frameTime, repeat), numFrames(numFrames), col(col), row(row) { } + static const int TYPE_ID = 408; + +public: + SimpleAnimation(); + SimpleAnimation(const Sprite *sprite, int frameTime, int numFrames, + int col = 0, int row = 0, bool repeat = false); +protected: + SimpleAnimation(loader::noinit_t); + +public: + void SetNumFrames(int n) { numFrames = n; } + void SetCol(int c) { col = c; } + void SetRow(int r) { row = r; } + + static void CreateTypeDescription(); + static void Construct(void *); + static void Initialize(void *); protected: - virtual int NumFrames() const { return numFrames; }; - virtual int Col(int frame) const { return col; } - virtual int Row(int frame) const { return row + frame; } + virtual int NumFrames() const; + virtual int Col(int frame) const; + virtual int Row(int frame) const; private: int numFrames; @@ -35,4 +42,4 @@ private: } -#endif /* GRAPHICS_SIMPLEANIMATION_H_ */ +#endif