From 7a685c0cc896ce9197688526c7ed2ab97be0dbe4 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 28 Feb 2025 13:40:30 +0100 Subject: [PATCH] fix: no pintava el efecte de carrega del borde en LoadingScreen --- source/loading_screen.cpp | 4 ++-- source/screen.cpp | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/loading_screen.cpp b/source/loading_screen.cpp index 310e16b0..cd32f390 100644 --- a/source/loading_screen.cpp +++ b/source/loading_screen.cpp @@ -165,8 +165,8 @@ void LoadingScreen::renderBorder() // AƱade lineas amarillas color = stringToColor(options.video.palette, "yellow"); SDL_SetRenderDrawColor(renderer_, color.r, color.g, color.b, 0xFF); - const int width = GAMECANVAS_WIDTH + (options.video.border.width * 2); - const int height = GAMECANVAS_HEIGHT + (options.video.border.height * 2); + const int width = options.game.width + (options.video.border.width * 2); + const int height = options.game.height + (options.video.border.height * 2); bool drawEnabled = rand() % 2 == 0 ? true : false; int row = 0; int rowSize = 1; diff --git a/source/screen.cpp b/source/screen.cpp index e1fc472e..368af34e 100644 --- a/source/screen.cpp +++ b/source/screen.cpp @@ -280,8 +280,6 @@ void Screen::gameCanvasToBorderCanvas() { auto temp = SDL_GetRenderTarget(renderer_); SDL_SetRenderTarget(renderer_, border_canvas_); - SDL_SetRenderDrawColor(renderer_, border_color_.r, border_color_.g, border_color_.b, 0xFF); - SDL_RenderClear(renderer_); SDL_RenderCopy(renderer_, game_canvas_, nullptr, &game_canvas_rect_); SDL_SetRenderTarget(renderer_, temp); }