#ifndef __MX_SURFACE__H__ #define __MX_SURFACE__H__ extern "C" { #include "SDL_mxf.h" } #include #include "mxpng.h" #include "mx_types.h" namespace mx { using std::cout; typedef struct _mxPoint { int x, y; } mxPoint; class mxSurface : public mxObject { public: mxSurface(SDL_Surface *surface = 0); mxSurface(const mxSurface &c); virtual ~mxSurface(); mxSurface& operator=(const mxSurface &c); mxSurface& operator=(SDL_Surface *surface); SDL_Surface *getSurface() const; operator SDL_Surface *(); mxPoint **buildResizeTable(int nw, int nh, int w, int h, mxPoint **buffer); bool createSurface(int w, int h); bool copyResizeSurface(const mxSurface &c); bool copySurface(const mxSurface &c, SDL_Rect *source, SDL_Rect *dest); bool copySurfaceColorKey(const mxSurface &c, SDL_Rect *source, SDL_Rect *dest, SDL_Color color_key); void Flip(); virtual void noZero(bool noremove); void cleanSurface(); bool LoadPNG(const char *file_name); protected: SDL_Surface *object_surface; void clean_up(); private: bool protected_noremove; mxPoint **p_buffer; }; } #endif