unificats els resources en un namespace

This commit is contained in:
2025-11-11 10:04:57 +01:00
parent 1821b84e73
commit 54fc6d2902
35 changed files with 356 additions and 341 deletions

View File

@@ -21,7 +21,7 @@
// Carga una paleta desde un archivo .gif
auto loadPalette(const std::string& file_path) -> Palette {
// Load file using ResourceHelper (supports both filesystem and pack)
auto buffer = Jdd::ResourceHelper::loadFile(file_path);
auto buffer = Resource::Helper::loadFile(file_path);
if (buffer.empty()) {
throw std::runtime_error("Error opening file: " + file_path);
}
@@ -48,7 +48,7 @@ auto readPalFile(const std::string& file_path) -> Palette {
palette.fill(0); // Inicializar todo con 0 (transparente por defecto)
// Load file using ResourceHelper (supports both filesystem and pack)
auto file_data = Jdd::ResourceHelper::loadFile(file_path);
auto file_data = Resource::Helper::loadFile(file_path);
if (file_data.empty()) {
throw std::runtime_error("No se pudo abrir el archivo .pal: " + file_path);
}
@@ -106,7 +106,7 @@ Surface::Surface(const std::string& file_path)
// Carga una superficie desde un archivo
auto Surface::loadSurface(const std::string& file_path) -> SurfaceData {
// Load file using ResourceHelper (supports both filesystem and pack)
std::vector<Uint8> buffer = Jdd::ResourceHelper::loadFile(file_path);
std::vector<Uint8> buffer = Resource::Helper::loadFile(file_path);
if (buffer.empty()) {
std::cerr << "Error opening file: " << file_path << '\n';
throw std::runtime_error("Error opening file");