+
+public:
+ SurfaceImpl();
+ virtual ~SurfaceImpl();
+
+ /** Return 0 on success, -2 if surface needs to be reloaded */
+ virtual int draw(float x, float y, Uint8 alpha, bool upside_down, bool update) = 0;
+ virtual int draw_bg(Uint8 alpha, bool update) = 0;
+ virtual int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, bool update) = 0;
+ virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update) = 0;
+ int resize(int w_, int h_);
+
+ SDL_Surface* get_sdl_surface() const; // @evil@ try to avoid this function
+};
+
+class SurfaceSDL : public SurfaceImpl
+{
+public:
+ SurfaceSDL(SDL_Surface* surf, int use_alpha);
+ SurfaceSDL(const std::string& file, int use_alpha);
+ SurfaceSDL(const std::string& file, int x, int y, int w, int h, int use_alpha);
+ virtual ~SurfaceSDL();
+
+ int draw(float x, float y, Uint8 alpha, bool upside_down, bool update);
+ int draw_bg(Uint8 alpha, bool update);
+ int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, bool update);
+ int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update);