X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FSimpleAnimation.h;h=0864d2b024402f2509e01283558ded8f117615b3;hb=0e7b9eca67383e45e04aa419cb783c92722f7801;hp=8374f0825363d3b80b05fe222cdfbd4db36ff61c;hpb=b02da898c7c8a08141df4e797774a61cf5e0163f;p=l2e.git diff --git a/src/graphics/SimpleAnimation.h b/src/graphics/SimpleAnimation.h index 8374f08..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,10 +10,14 @@ 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; } @@ -28,11 +26,12 @@ public: 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; @@ -43,4 +42,4 @@ private: } -#endif /* GRAPHICS_SIMPLEANIMATION_H_ */ +#endif