- void Start(app::State &ctrl) {
- timer = ctrl.GraphicsTimers().StartInterval(frameTime);
- }
- void Start(app::Application &ctrl) {
- timer = ctrl.GlobalTimers().StartInterval(frameTime);
- }
- void Stop() {
- timer = app::Timer<Uint32>();
- }
- bool Running() const {
- return timer.Running() && (repeat || timer.Iteration() < numFrames);
- }
- void Draw(SDL_Surface *dest, geometry::Point<int> position) {
- sprite->Draw(dest, position, col, Running() ? row + (timer.Iteration() % numFrames) : row);
- }
- void DrawCenterBottom(SDL_Surface *dest, geometry::Point<int> position) const {
- sprite->DrawCenterBottom(dest, position, col, Running() ? row + (timer.Iteration() % numFrames) : row);
- }
+ 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;
+ virtual int Col(int frame) const;
+ virtual int Row(int frame) const;