Imposible canviar la rendererSurface

This commit is contained in:
2025-03-05 18:51:36 +01:00
parent d41b0cb31c
commit 70a50f5117
16 changed files with 199 additions and 257 deletions

View File

@@ -22,11 +22,11 @@ LoadingScreen::LoadingScreen()
color_loading_screen_surface_(Resource::get()->getSurface("loading_screen_color.gif")),
mono_loading_screen_sprite_(std::make_shared<SSprite>(mono_loading_screen_surface_, 0, 0, mono_loading_screen_surface_->getWidth(), mono_loading_screen_surface_->getHeight())),
color_loading_screen_sprite_(std::make_shared<SSprite>(color_loading_screen_surface_, 0, 0, color_loading_screen_surface_->getWidth(), color_loading_screen_surface_->getHeight())),
screen_surface_(std::make_shared<Surface>(Screen::get()->getRenderSurfaceData(), options.game.width, options.game.height))
screen_surface_(std::make_shared<Surface>(Screen::get()->getRendererSurface(), options.game.width, options.game.height))
{
// Cambia el destino de las surfaces
mono_loading_screen_surface_->setSurfaceDataDestRaw(screen_surface_->getSurfaceData());
color_loading_screen_surface_->setSurfaceDataDestRaw(screen_surface_->getSurfaceData());
mono_loading_screen_surface_->setSurfaceDest(screen_surface_);
color_loading_screen_surface_->setSurfaceDest(screen_surface_);
// Configura la superficie donde se van a pintar los sprites
screen_surface_->setColor(0, 0xFF000000);
@@ -156,7 +156,7 @@ void LoadingScreen::renderBorder()
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_data = *(Screen::get()->getRenderSurfaceData());
auto surface = Screen::get()->getRendererSurface();
int row = 0;
while (row < HEIGHT)
@@ -166,7 +166,7 @@ void LoadingScreen::renderBorder()
{
for (int i = row; i < row + ROW_HEIGHT; ++i)
{
screen_surface_->drawLine(surface_data, 0, i, WIDTH, i, color);
surface->drawLine(0, i, WIDTH, i, color);
}
}
row += ROW_HEIGHT;