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

@@ -247,7 +247,7 @@ void Resource::loadSurfaces()
for (const auto &l : list)
{
auto name = getFileName(l);
surfaces_.emplace_back(ResourceSurface(name, std::make_shared<Surface>(Screen::get()->getRenderSurfaceData(), l)));
surfaces_.emplace_back(ResourceSurface(name, std::make_shared<Surface>(Screen::get()->getRendererSurface(), l)));
updateLoadingProgress();
}
}
@@ -407,15 +407,14 @@ void Resource::renderProgress()
Screen::get()->start();
Screen::get()->clearSurface();
auto surface = std::make_shared<Surface>(Screen::get()->getRenderSurfaceData(), 1, 1);
auto surface_data = *(Screen::get()->getRenderSurfaceData());
auto surface = Screen::get()->getRendererSurface();
const int wired_bar_width = options.game.width - (X_PADDING * 2);
SDL_Rect rect_wired = {X_PADDING, bar_position, wired_bar_width, X_PADDING};
surface->fillRect(surface_data, &rect_wired, stringToColor("blue"));
surface->fillRect(&rect_wired, stringToColor("blue"));
const int full_bar_width = wired_bar_width * count_.getPercentage();
SDL_Rect rect_full = {X_PADDING, bar_position, full_bar_width, X_PADDING};
surface->fillRect(surface_data, &rect_full, stringToColor("white"));
surface->fillRect(&rect_full, stringToColor("white"));
Screen::get()->renderWithoutNotifier();
}