- sounds are on both channels
[supertux.git] / src / sprite / sprite.hpp
index b2ec201..79d12ae 100644 (file)
@@ -18,6 +18,7 @@
 #define HEADER_SUPERTUX_SPRITE_SPRITE_HPP
 
 #include "sprite/sprite_data.hpp"
+#include "sprite/sprite_ptr.hpp"
 #include "video/drawing_context.hpp"
 
 class Surface;
@@ -28,9 +29,10 @@ class Sprite
 {
 public:
   Sprite(SpriteData& data);
-  Sprite(const Sprite& other);
   ~Sprite();
 
+  SpritePtr clone() const;
+
   /** Draw sprite, automatically calculates next frame */
   void draw(DrawingContext& context, const Vector& pos, int layer);
 
@@ -47,9 +49,6 @@ public:
   void set_animation_loops(int loops = -1)
   { animation_loops = loops; }
 
-  /** Set framerate */
-  void set_fps(float new_fps);
-
   /* Stop animation */
   void stop_animation()
   { animation_loops = 0; }
@@ -104,7 +103,7 @@ public:
   {
     this->frame = (float) (frame_ % get_frames());
   }
-  Surface* get_frame(unsigned int frame_)
+  SurfacePtr get_frame(unsigned int frame_)
   {
     assert(frame_ < action->surfaces.size());
     return action->surfaces[frame_];
@@ -122,9 +121,10 @@ private:
   Color color;
   Blend blend;
 
-  SpriteData::Action* action;
+  const SpriteData::Action* action;
 
 private:
+  Sprite(const Sprite& other);
   Sprite& operator=(const Sprite&);
 };