4 * Created on: Aug 5, 2012
10 using geometry::Point;
14 void Sprite::Draw(SDL_Surface *dest, const Point<int> &position, int col, int row) const {
15 SDL_Rect srcRect, destRect;
16 srcRect.x = xOffset + col * Width();
17 srcRect.y = yOffset + row * Height();
20 destRect.x = position.X();
21 destRect.y = position.Y();
23 SDL_BlitSurface(surface, &srcRect, dest, &destRect);
26 destRect.h = Height();
28 while (destRect.w > 1 && destRect.h > 1) {
29 SDL_FillRect(dest, &destRect, SDL_MapRGB(dest->format, red ? 0xFF : 0, 0, 0));