Cambiado el tamaño de la textura usado para pintar el mapa

This commit is contained in:
2022-12-01 22:07:03 +01:00
parent 254ff50ef3
commit d3a5c0e54f
4 changed files with 15 additions and 3 deletions

View File

@@ -473,7 +473,7 @@ Room::Room(room_t *room, SDL_Renderer *renderer, Screen *screen, Asset *asset, o
setAnimatedTiles();
// Crea la textura para el mapa de tiles de la habitación
mapTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT);
mapTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
if (mapTexture == nullptr)
{
if (options->console)
@@ -665,7 +665,8 @@ void Room::fillMapTexture()
void Room::renderMap()
{
// Dibuja la textura con el mapa en pantalla
SDL_RenderCopy(renderer, mapTexture, nullptr, nullptr);
static SDL_Rect dest = {0, 0, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT};
SDL_RenderCopy(renderer, mapTexture, nullptr, &dest);
// Dibuja los tiles animados
#ifdef DEBUG