thingToDraw = IMG_Load(filename.c_str()); if(thingToDraw == NULL) { cout << "Unable to load " << filename << " " << IMG_GetError() << endl; return(-1); }
Uint32 tmpColor; tmpColor = SDL_MapRGB(thingToDraw->format, 255,255,255); SDL_SetColorKey( thingToDraw, SDL_SRCCOLORKEY | SDL_RLEACCEL , tmpColor);
void hexCorner(int a, int b, int & x, int & y, int r1, int r2) { // a, b is the center of the hex in hex coordinates // x,y is the upper right corner in screen coordinates // r1 is the major radius, r2 is the minor radius x = ((a/2)*3+1)*r1; y = (b)*r2; if (a%2 == 0) { x -= int(1.5*r1); } x -= r1; y -= r2; }