val! ja pinta coses en altres surfaces

This commit is contained in:
2025-03-05 19:41:55 +01:00
parent 70a50f5117
commit 5a8747cc4b
5 changed files with 15 additions and 13 deletions

View File

@@ -82,6 +82,8 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
border_surface_ = std::make_shared<Surface>(nullptr, options.game.width + options.video.border.width * 2, options.game.height + options.video.border.height * 2);
border_surface_->loadPalette(palettes_.front());
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(game_surface_);
// Establece el modo de video
setVideoMode(options.video.mode);
@@ -379,7 +381,9 @@ void Screen::resetShaders()
// Establece el renderizador para las surfaces
void Screen::setRendererSurface(std::shared_ptr<Surface> surface)
{
(surface) ? game_surface_->setSurfaceDest(surface) : game_surface_->setSurfaceDest(nullptr);
(surface) ?
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(surface):
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(game_surface_);
}
// Cambia la paleta