optimitzacions en Surface

This commit is contained in:
2026-04-18 12:40:13 +02:00
parent f5b6bc3ef9
commit 412df1316f
6 changed files with 105 additions and 167 deletions

View File

@@ -384,7 +384,11 @@ void MiniMap::handleEvent(const SDL_Event& event, const std::string& current_roo
Screen::get()->setRendererSurface(prev);
}
auto game_surface = Screen::get()->getRendererSurface();
if (game_surface) { map_surface_->setPalette(game_surface->getPalette()); }
if (game_surface) {
Palette src_palette{};
for (int i = 0; i < 256; ++i) { src_palette[i] = game_surface->getPaletteColor(static_cast<Uint8>(i)); }
map_surface_->setPalette(src_palette);
}
std::string file = Screenshot::save(*map_surface_);
if (!file.empty()) { std::cout << "MiniMap screenshot: " << file << "\n"; }
// Recomponer para limpiar los números de la surface