]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/SimpleAnimation.h
switched to static type IDs
[l2e.git] / src / graphics / SimpleAnimation.h
index 3354328b5e6cb5281ba69d6f35d14df05f40704c..d5d758fc7c3a88978a47aa2f0e898335a99a6b7c 100644 (file)
@@ -15,16 +15,27 @@ namespace graphics {
 class SimpleAnimation
 : public Animation {
 
+public:
+       static const int TYPE_ID = 408;
+
 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) { }
 
+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 *);
+
 protected:
-       virtual int Col() const { return col; }
-       virtual int Row() const { return row + Frame(); }
        virtual int NumFrames() const { return numFrames; };
+       virtual int Col(int frame) const { return col; }
+       virtual int Row(int frame) const { return row + frame; }
 
 private:
        int numFrames;