El color de fondo de la habitación se pinta en la textura del mapa

This commit is contained in:
2022-12-01 11:40:35 +01:00
parent 06ecabc676
commit 4911282777
3 changed files with 4 additions and 3 deletions

View File

@@ -164,8 +164,8 @@ void Demo::render()
{ {
// Prepara para dibujar el frame // Prepara para dibujar el frame
screen->start(); screen->start();
screen->clean(room->getBGColor());
// Dibuja los elementos del juego en orden
room->renderMap(); room->renderMap();
room->renderEnemies(); room->renderEnemies();
room->renderItems(); room->renderItems();

View File

@@ -256,8 +256,8 @@ void Game::render()
{ {
// Prepara para dibujar el frame // Prepara para dibujar el frame
screen->start(); screen->start();
screen->clean(room->getBGColor());
// Dibuja los elementos del juego en orden
room->renderMap(); room->renderMap();
room->renderEnemies(); room->renderEnemies();
room->renderItems(); room->renderItems();

View File

@@ -534,8 +534,9 @@ color_t Room::getBorderColor()
// Crea la textura con el mapeado de la habitación // Crea la textura con el mapeado de la habitación
void Room::fillMapTexture() void Room::fillMapTexture()
{ {
const color_t color = stringToColor(options->palette, bgColor);
SDL_SetRenderTarget(renderer, mapTexture); SDL_SetRenderTarget(renderer, mapTexture);
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00); SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, 0xFF);
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
// Los tileSetFiles son de 20x20 tiles. El primer tile es el 0. Cuentan hacia la derecha y hacia abajo // Los tileSetFiles son de 20x20 tiles. El primer tile es el 0. Cuentan hacia la derecha y hacia abajo