Transició a surface acabada. Ja compila

This commit is contained in:
2025-03-04 12:30:19 +01:00
parent c4033e3663
commit 05f91b2a94
31 changed files with 376 additions and 1078 deletions

View File

@@ -149,15 +149,14 @@ void LoadingScreen::renderBorder()
{
// Pinta el borde de colro azul
Uint8 color = stringToColor("blue");
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), color.r, color.g, color.b, 0xFF);
SDL_RenderClear(Screen::get()->getRenderer());
Screen::get()->clear(color);
// Añade lineas amarillas
color = stringToColor("yellow");
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), color.r, color.g, color.b, 0xFF);
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;
auto surface = Screen::get()->getRenderSurfaceData();
int row = 0;
while (row < HEIGHT)
@@ -167,7 +166,7 @@ void LoadingScreen::renderBorder()
{
for (int i = row; i < row + ROW_HEIGHT; ++i)
{
SDL_RenderDrawLine(Screen::get()->getRenderer(), 0, i, WIDTH, i);
screen_surface_->drawLine(surface, 0, i, WIDTH, i, color);
}
}
row += ROW_HEIGHT;
@@ -221,7 +220,7 @@ void LoadingScreen::run()
// Limpia la pantalla
Screen::get()->start();
Screen::get()->clean();
Screen::get()->clear();
Screen::get()->render();
while (options.section.section == Section::LOADING_SCREEN)