added jam build system, please try it out - the advantage would be that it already...
[supertux.git] / lib / video / surface.h
index 23d0c2e..1491e84 100644 (file)
@@ -17,7 +17,6 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //  02111-1307, USA.
-
 #ifndef SUPERTUX_TEXTURE_H
 #define SUPERTUX_TEXTURE_H
 
@@ -25,7 +24,7 @@
 #include <list>
 
 #ifndef NOOPENGL
-#include "SDL_opengl.h"
+#include <SDL_opengl.h>
 #endif
 
 #include "SDL.h"
@@ -59,7 +58,9 @@ namespace SuperTux
 
   /// types of filters
   enum {
-    MASK_FILTER
+    HORIZONTAL_FLIP_FILTER,
+    MASK_FILTER,
+    NONE_FILTER
   };
 
   /** This class holds all the data necessary to construct a surface */
@@ -70,6 +71,10 @@ namespace SuperTux
       ConstructorType type;
       SDL_Surface* surface;
       std::string file;
+
+      struct Filter { int type; Color color; };
+      std::vector<Filter> applied_filters;
+
       bool use_alpha;
       int x;
       int y;
@@ -116,9 +121,7 @@ namespace SuperTux
       /** Reload the surface, which is necesarry in case of a mode swich */
       void reload();
 
-      void resize(int widht, int height);
-
-      void apply_mask(Color color);
+      void apply_filter(int filter, Color color = Color(0,0,0));
     };
 
   /** Surface implementation, all implementation have to inherit from
@@ -142,11 +145,9 @@ namespace SuperTux
       virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, Uint32 effect = NONE_EFFECT) = 0;
 
 
-      int resize(int w_, int h_);
-
       SDL_Surface* get_sdl_surface() const; // @evil@ try to avoid this function
 
-      virtual void apply_mask(Color color) = 0;
+      virtual void apply_filter(int filter, Color color = Color(0,0,0)) = 0;
     };
 
   class SurfaceSDL : public SurfaceImpl
@@ -162,7 +163,7 @@ namespace SuperTux
       int draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha, Uint32 effect = NONE_EFFECT);
       int draw_stretched(float x, float y, int w, int h, Uint8 alpha, Uint32 effect = NONE_EFFECT);
 
-      void apply_mask(Color color);
+      void apply_filter(int filter, Color color);
     };
 
 #ifndef NOOPENGL
@@ -183,7 +184,7 @@ namespace SuperTux
       int draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha, Uint32 effect = NONE_EFFECT);
       int draw_stretched(float x, float y, int w, int h, Uint8 alpha, Uint32 effect = NONE_EFFECT);
 
-      void apply_mask(Color color);
+      void apply_filter(int filter, Color color);
 
     private:
       void create_gl(SDL_Surface * surf, GLuint * tex);