Ja torna a funcionar el borde

This commit is contained in:
2025-03-06 13:14:57 +01:00
parent 72efa0dc46
commit 12e27a1062
5 changed files with 38 additions and 63 deletions

View File

@@ -145,16 +145,17 @@ void LoadingScreen::renderLoad()
// Dibuja el efecto de carga en el borde
void LoadingScreen::renderBorder()
{
// Pinta el borde de colro azul
Uint8 color = stringToColor("blue");
Screen::get()->clearSurface(color);
// Obtiene la Surface del borde
auto border = Screen::get()->getBorderSurface();
// Pinta el borde de color azul
border->clear(stringToColor("blue"));
// Añade lineas amarillas
color = stringToColor("yellow");
const Uint8 COLOR = stringToColor("yellow");
const int WIDTH = options.game.width + (options.video.border.width * 2);
const int HEIGHT = options.game.height + (options.video.border.height * 2);
bool draw_enabled = rand() % 2 == 0 ? true : false;
auto surface = Screen::get()->getRendererSurface();
int row = 0;
while (row < HEIGHT)
@@ -164,7 +165,7 @@ void LoadingScreen::renderBorder()
{
for (int i = row; i < row + ROW_HEIGHT; ++i)
{
surface->drawLine(0, i, WIDTH, i, color);
border->drawLine(0, i, WIDTH, i, COLOR);
}
}
row += ROW_HEIGHT;
@@ -192,9 +193,6 @@ void LoadingScreen::render()
{
if (options.video.border.enabled)
{
// Prepara para empezar a dibujar en la textura del borde
Screen::get()->startDrawOnBorder();
// Dibuja el efecto de carga en el borde
renderBorder();
}