millorat printWithDots() i Resource::List per a calcular el nom de fitxer mes llarg correctament
This commit is contained in:
@@ -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};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user