From 4911282777b8f6d5b180b2c6903c2b76db2b4263 Mon Sep 17 00:00:00 2001 From: Sergio Valor Martinez Date: Thu, 1 Dec 2022 11:40:35 +0100 Subject: [PATCH] =?UTF-8?q?El=20color=20de=20fondo=20de=20la=20habitaci?= =?UTF-8?q?=C3=B3n=20se=20pinta=20en=20la=20textura=20del=20mapa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/demo.cpp | 2 +- source/game.cpp | 2 +- source/room.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/demo.cpp b/source/demo.cpp index ac3a820..33c35af 100644 --- a/source/demo.cpp +++ b/source/demo.cpp @@ -164,8 +164,8 @@ void Demo::render() { // Prepara para dibujar el frame screen->start(); - screen->clean(room->getBGColor()); + // Dibuja los elementos del juego en orden room->renderMap(); room->renderEnemies(); room->renderItems(); diff --git a/source/game.cpp b/source/game.cpp index 8b145f9..e32e844 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -256,8 +256,8 @@ void Game::render() { // Prepara para dibujar el frame screen->start(); - screen->clean(room->getBGColor()); + // Dibuja los elementos del juego en orden room->renderMap(); room->renderEnemies(); room->renderItems(); diff --git a/source/room.cpp b/source/room.cpp index c1349a8..980eaad 100644 --- a/source/room.cpp +++ b/source/room.cpp @@ -534,8 +534,9 @@ color_t Room::getBorderColor() // Crea la textura con el mapeado de la habitación void Room::fillMapTexture() { + const color_t color = stringToColor(options->palette, bgColor); SDL_SetRenderTarget(renderer, mapTexture); - SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00); + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, 0xFF); SDL_RenderClear(renderer); // Los tileSetFiles son de 20x20 tiles. El primer tile es el 0. Cuentan hacia la derecha y hacia abajo