|
@@ -87,6 +87,10 @@ int main()
|
|
|
|
|
|
// [2.5] Surface containers
|
|
|
SDL_Surface* tileSet[BLOC_TOTAL] = {water, mountain, grass, desert};
|
|
|
+ SDL_Surface* map = SDL_CreateRGBSurface(SDL_HWSURFACE, WIDTH * BLOC_SIZE, HEIGHT * BLOC_SIZE, 32, 0x0, 0x0, 0x0, 0x0);
|
|
|
+
|
|
|
+ // [2.6] First map render
|
|
|
+ drawWorld(world, tileSet, map);
|
|
|
|
|
|
/// [3] Main loop
|
|
|
bool done(false);
|
|
@@ -118,7 +122,7 @@ int main()
|
|
|
// [3.3] Draw phase
|
|
|
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 255, 255));
|
|
|
|
|
|
- drawWorld(world, tileSet, screen);
|
|
|
+ SDL_BlitSurface(map, NULL, screen, NULL);
|
|
|
|
|
|
SDL_BlitSurface(pawn, NULL, screen, &pawnPos);
|
|
|
|