i per fi ja comença a tornar tot a la normalitat

This commit is contained in:
2025-03-05 20:52:34 +01:00
parent 5a8747cc4b
commit 241732752a
25 changed files with 75 additions and 81 deletions

View File

@@ -75,13 +75,14 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
}
// Crea la surface donde se dibujan los graficos del juego
game_surface_ = std::make_shared<Surface>(nullptr, options.game.width, options.game.height);
game_surface_ = std::make_shared<Surface>(options.game.width, options.game.height);
game_surface_->loadPalette(palettes_.front());
// Crea la surface donde se dibujan los graficos del juego
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_ = std::make_shared<Surface>(options.game.width + options.video.border.width * 2, options.game.height + options.video.border.height * 2);
border_surface_->loadPalette(palettes_.front());
// Establece la surface que actuará como renderer para recibir las llamadas a render()
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(game_surface_);
// Establece el modo de video
@@ -127,11 +128,12 @@ void Screen::startDrawOnBorder()
// Vuelca el contenido del renderizador en pantalla
void Screen::render()
{
// Renderiza sobre game_surface_ los overlays
//renderNotifications();
// Copia la surface a game_texture_
game_surface_->copyToTexture(renderer_, game_texture_);
// Renderiza sobre gameCanvas los overlays
// renderNotifications();
// Si está el borde activo, vuelca gameCanvas sobre borderCanvas
if (options.video.border.enabled)
@@ -381,9 +383,7 @@ void Screen::resetShaders()
// Establece el renderizador para las surfaces
void Screen::setRendererSurface(std::shared_ptr<Surface> surface)
{
(surface) ?
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(surface):
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(game_surface_);
(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