millorat printWithDots() i Resource::List per a calcular el nom de fitxer mes llarg correctament
Some checks failed
Release / build-windows (push) Has been cancelled
Release / create-release (push) Has been cancelled
Release / build-linux (push) Has been cancelled

This commit is contained in:
2025-11-23 22:18:41 +01:00
parent 1a6185b3aa
commit 59e6af62ba
10 changed files with 45 additions and 17 deletions

View File

@@ -16,7 +16,9 @@
#include "core/rendering/gif.hpp" // Para Gif
#include "core/rendering/screen.hpp" // Para Screen
#include "core/resources/resource_list.hpp" // Para Resource::List::get()->getPrintWidth
#include "core/resources/resource_helper.hpp" // Para ResourceHelper
#include "utils/utils.hpp" // Para printWithDots
// Carga una paleta desde un archivo .gif
auto loadPalette(const std::string& file_path) -> Palette {
@@ -37,7 +39,7 @@ auto loadPalette(const std::string& file_path) -> Palette {
std::copy_n(pal.begin(), std::min(pal.size(), palette.size()), palette.begin());
// Mensaje de depuración
printWithDots("Palette : ", file_path.substr(file_path.find_last_of("\\/") + 1), "[ LOADED ]");
printWithDots("Palette : ", file_path.substr(file_path.find_last_of("\\/") + 1), "[ LOADED ]", Resource::List::get()->getPrintWidth());
return palette;
}
@@ -86,7 +88,7 @@ auto readPalFile(const std::string& file_path) -> Palette {
}
}
printWithDots("Palette : ", file_path.substr(file_path.find_last_of("\\/") + 1), "[ LOADED ]");
printWithDots("Palette : ", file_path.substr(file_path.find_last_of("\\/") + 1), "[ LOADED ]", Resource::List::get()->getPrintWidth());
return palette;
}
@@ -128,7 +130,7 @@ auto Surface::loadSurface(const std::string& file_path) -> SurfaceData {
std::memcpy(pixels.get(), raw_pixels.data(), pixel_count);
// Crear y devolver directamente el objeto SurfaceData
printWithDots("Surface : ", file_path.substr(file_path.find_last_of("\\/") + 1), "[ LOADED ]");
printWithDots("Surface : ", file_path.substr(file_path.find_last_of("\\/") + 1), "[ LOADED ]", Resource::List::get()->getPrintWidth());
return {static_cast<float>(w), static_cast<float>(h), pixels};
}