/// types of filters
enum {
- MASK_FILTER
+ HORIZONTAL_FLIP_FILTER,
+ MASK_FILTER,
+ NONE_FILTER
};
/** This class holds all the data necessary to construct a surface */
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;
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
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
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
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);