|
@@ -20,8 +20,9 @@ int main()
|
|
|
|
|
|
|
|
|
|
|
|
- const int width(640), height(480);
|
|
|
- SDL_Surface* screen = SDL_SetVideoMode(width, height, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
|
|
|
+ const int blocSize(16);
|
|
|
+ const int width(100), height(50);
|
|
|
+ SDL_Surface* screen = SDL_SetVideoMode(width * blocSize, height * blocSize, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
|
|
|
if ( !screen )
|
|
|
{
|
|
|
std::cout << "Unable to set " << width << "x" << height << " video: " << SDL_GetError() << std::endl;
|
|
@@ -67,9 +68,12 @@ int main()
|
|
|
|
|
|
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 255, 255));
|
|
|
|
|
|
- for (pos.y = 0; pos.y < height; pos.y += water->h)
|
|
|
- for (pos.x = 0; pos.x < width; pos.x += water->w)
|
|
|
+ for (int y(0); y < height; y++)
|
|
|
+ for (int x(0); x < width; x++) {
|
|
|
+ pos.x = x * blocSize;
|
|
|
+ pos.y = y * blocSize;
|
|
|
SDL_BlitSurface(water, NULL, screen, &pos);
|
|
|
+ }
|
|
|
|
|
|
SDL_BlitSurface(pawn, NULL, screen, &pawnPos);
|
|
|
|