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

@@ -142,6 +142,7 @@ void Credits::fillTexture()
iniTexts();
// Rellena la textura de texto
auto previuos_renderer = Screen::get()->getRendererSurface();
Screen::get()->setRendererSurface(text_surface_);
text_surface_->clear(stringToColor("black"));
@@ -164,10 +165,8 @@ void Credits::fillTexture()
// Recoloca el sprite del brillo
shining_sprite_->setPosX(POS_X + 2);
Screen::get()->setRendererSurface(nullptr);
// Rellena la textura que cubre el texto con color transparente
Screen::get()->setRendererSurface(text_surface_);
text_surface_->clear(stringToColor("transparent"));
// Los primeros 8 pixels crea una malla
@@ -203,7 +202,7 @@ void Credits::fillTexture()
rect = {0, 8, 256, 192};
surface->fillRect(&rect, color);
Screen::get()->setRendererSurface(nullptr);
Screen::get()->setRendererSurface(previuos_renderer);
}
// Actualiza el contador