Implemented mirror actions correctly. Bugfix: right direction of bad guys now working.
[supertux.git] / lib / special / sprite.h
index 184e2f6..15ee35b 100644 (file)
@@ -39,12 +39,19 @@ namespace SuperTux
         {
         std::string name;
 
+        /** Position correction */
         int x_offset;
         int y_offset;
+        /** Drawing priority in queue */
+        int z_order;
 
         /** Frames per second */
         float fps;
 
+        /** Mirror is used to avoid duplicating left and right side
+            sprites */
+        bool mirror;
+
         std::vector<Surface*> surfaces;
         };
 
@@ -58,6 +65,10 @@ namespace SuperTux
       void draw(DrawingContext& context, const Vector& pos, int layer,
                 Uint32 drawing_effect = NONE_EFFECT);
 
+      void draw_part(DrawingContext& context, const Vector& source,
+                    const Vector& size, const Vector& pos, int layer,
+                    Uint32 drawing_effect = NONE_EFFECT);
+
       /** Set action (or state) */
       void set_action(std::string act);
 
@@ -105,6 +116,9 @@ namespace SuperTux
       void init_defaults(Action* act);
       void parse_action(LispReader& lispreader);
 
+      /** Get an action */
+      Action* get_action(std::string act);
+
       void update();
       void reset();