Ya se dibuja el grafico de fondo en el mapa

This commit is contained in:
2022-08-12 12:43:51 +02:00
parent 0afc0cf629
commit 60a969a9bc

View File

@@ -184,12 +184,15 @@ void Map::fillMapTexture()
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00); SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00);
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
SDL_Rect clip = {0, 0, 320, 240};
texture_bg->render(renderer, 0, 0, &clip);
const int tile_size = 16; const int tile_size = 16;
const int tileset_width_in_tiles = 16; const int tileset_width_in_tiles = 16;
const int map_width_in_tiles = 20; const int map_width_in_tiles = 20;
const int map_height_in_tiles = 13; const int map_height_in_tiles = 13;
SDL_Rect clip = {0, 0, tile_size, tile_size}; clip = {0, 0, tile_size, tile_size};
for (int y = 0; y < map_height_in_tiles; y++) for (int y = 0; y < map_height_in_tiles; y++)
for (int x = 0; x < map_width_in_tiles; x++) for (int x = 0; x < map_width_in_tiles; x++)