#ifndef _X_ #define _X_ #include"SDL.h" #include #include #include namespace mx { typedef union mxRGB { unsigned char c[4]; unsigned int value; } mxrgb; // for rgb type conversions using std::string; enum { cLEFT = 0, cRIGHT = 1, cUP = 2, cDOWN, UP_RIGHT, DOWN_RIGHT, UP_LEFT, DOWN_LEFT}; const int DIR_MAX = 8; class __Cell { public: __Cell(); __Cell(const __Cell &c); __Cell(const mxrgb &color, const int &x, const int &y, const int &dir); __Cell& operator=(const __Cell &c); __Cell& operator+=(const __Cell &c); __Cell& operator&=(const __Cell &c); void setPos(const int x, const int y); void setColor(unsigned int value); void setColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a); void swapColors(__Cell &c); void setBaseColor(Uint32 bcolor); void addAlpha(float num); void setDirection(const int c); Uint32 toSourceColor(SDL_Surface *surf); int getX() const; int getY() const; mxrgb &getRGB() ; Uint32 getBase() const; int getDirection() const; protected: mxrgb color; int x,y; int direction; Uint32 base_color; float alpha; }; } #endif