add code to debug collision rectangles
[supertux.git] / src / sprite / sprite.hpp
index 1c16632..0bcc4e7 100644 (file)
@@ -46,11 +46,14 @@ public:
   /** Set action (or state) */
   void set_action(const std::string& act, int loops = -1);
 
+  /** Set framerate */
+  void set_fps(float new_fps);
+
   /* Stop animation */
   void stop_animation()
   { animation_loops = 0; }
   /** Check if animation is stopped or not */
-  bool check_animation();
+  bool animation_done();
 
   float get_fps() const
   { return action->fps; }
@@ -71,8 +74,10 @@ public:
   int get_frame() const
   { return (int)frame; }
   /** Set current frame */
-  void set_frame(int frame_)
-  { if(frame_ > get_frames()) frame = 0; else frame = frame_; }
+  void set_frame(int frame)
+  { 
+    this->frame = (frame % get_frames()); 
+  }
   Surface* get_frame(unsigned int frame)
   {
     assert(frame < action->surfaces.size());