Quan canvia de RendererSurface, torna a deixar la que havia, no la de per defecte

This commit is contained in:
2025-03-06 12:09:59 +01:00
parent 60c926a9c9
commit f2bfc970bc
11 changed files with 75 additions and 59 deletions

View File

@@ -474,6 +474,7 @@ void Room::initializeRoom(const RoomData &room)
void Room::fillMapTexture()
{
const Uint8 color = stringToColor(bg_color_);
auto previuos_renderer = Screen::get()->getRendererSurface();
Screen::get()->setRendererSurface(map_surface_);
map_surface_->clear(color);
@@ -593,7 +594,7 @@ void Room::fillMapTexture()
}
#endif
Screen::get()->setRendererSurface(nullptr);
Screen::get()->setRendererSurface(previuos_renderer);
}
// Dibuja el mapa en pantalla