He posat punteros dobles i tampoc va res

This commit is contained in:
2025-03-05 12:31:54 +01:00
parent 33038e8509
commit d41b0cb31c
11 changed files with 151 additions and 144 deletions

View File

@@ -25,8 +25,8 @@ LoadingScreen::LoadingScreen()
screen_surface_(std::make_shared<Surface>(Screen::get()->getRenderSurfaceData(), options.game.width, options.game.height))
{
// Cambia el destino de las surfaces
mono_loading_screen_surface_->setSurfaceDataDest(screen_surface_->getSurfaceData());
color_loading_screen_surface_->setSurfaceDataDest(screen_surface_->getSurfaceData());
mono_loading_screen_surface_->setSurfaceDataDestRaw(screen_surface_->getSurfaceData());
color_loading_screen_surface_->setSurfaceDataDestRaw(screen_surface_->getSurfaceData());
// Configura la superficie donde se van a pintar los sprites
screen_surface_->setColor(0, 0xFF000000);
@@ -155,22 +155,22 @@ void LoadingScreen::renderBorder()
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 drawEnabled = rand() % 2 == 0 ? true : false;
auto surface = Screen::get()->getRenderSurfaceData();
bool draw_enabled = rand() % 2 == 0 ? true : false;
auto surface_data = *(Screen::get()->getRenderSurfaceData());
int row = 0;
while (row < HEIGHT)
{
const int ROW_HEIGHT = (rand() % 4) + 3;
if (drawEnabled)
if (draw_enabled)
{
for (int i = row; i < row + ROW_HEIGHT; ++i)
{
screen_surface_->drawLine(surface, 0, i, WIDTH, i, color);
screen_surface_->drawLine(surface_data, 0, i, WIDTH, i, color);
}
}
row += ROW_HEIGHT;
drawEnabled = !drawEnabled;
draw_enabled = !draw_enabled;
}
}