Imposible canviar la rendererSurface

This commit is contained in:
2025-03-05 18:51:36 +01:00
parent d41b0cb31c
commit 70a50f5117
16 changed files with 199 additions and 257 deletions

View File

@@ -415,7 +415,7 @@ Room::Room(const std::string &room_path, std::shared_ptr<ScoreboardData> data)
setAnimatedTiles();
// Crea la textura para el mapa de tiles de la habitación
map_surface_ = std::make_shared<Surface>(Screen::get()->getRenderSurfaceData(), PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
map_surface_ = std::make_shared<Surface>(Screen::get()->getRendererSurface(), PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
// Pinta el mapa de la habitación en la textura
fillMapTexture();
@@ -474,7 +474,7 @@ void Room::initializeRoom(const RoomData &room)
void Room::fillMapTexture()
{
const Uint8 color = stringToColor(bg_color_);
Screen::get()->setRenderSurfaceData(map_surface_);
Screen::get()->setRendererSurface(map_surface_);
Screen::get()->clearSurface(color);
// Los tileSetFiles son de 20x20 tiles. El primer tile es el 0. Cuentan hacia la derecha y hacia abajo
@@ -593,7 +593,7 @@ void Room::fillMapTexture()
}
#endif
Screen::get()->setRenderSurfaceData(nullptr);
Screen::get()->setRendererSurface(nullptr);
}
// Dibuja el mapa en pantalla