arreglos en stats.cpp

This commit is contained in:
2026-04-03 08:29:06 +02:00
parent dc1470ec0e
commit 8dcc1d282a
5 changed files with 46 additions and 64 deletions

View File

@@ -189,7 +189,8 @@ namespace Resource {
if (!items.is_sequence()) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"Warning: Type '%s' in category '%s' is not a sequence, skipping",
type_str.c_str(), category.c_str());
type_str.c_str(),
category.c_str());
continue;
}
@@ -208,18 +209,22 @@ namespace Resource {
} else {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"Warning: Invalid item in type '%s', category '%s', skipping",
type_str.c_str(), category.c_str());
type_str.c_str(),
category.c_str());
}
} catch (const std::exception& e) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"Error parsing asset in category '%s', type '%s': %s",
category.c_str(), type_str.c_str(), e.what());
category.c_str(),
type_str.c_str(),
e.what());
}
}
} catch (const std::exception& e) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"Error parsing type in category '%s': %s",
category.c_str(), e.what());
category.c_str(),
e.what());
}
}
} else if (category_assets.is_sequence()) {
@@ -252,7 +257,8 @@ namespace Resource {
} catch (const std::exception& e) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"Error parsing asset in category '%s': %s",
category.c_str(), e.what());
category.c_str(),
e.what());
}
}
} else {

View File

@@ -33,8 +33,8 @@ namespace Resource {
// --- Métodos para la gestión de recursos ---
void add(const std::string& file_path, Type type, bool required = true, bool absolute = false);
void addAsset(const std::string& path, Type type); // Añade al mapa y persiste en assets.yaml
void removeAsset(const std::string& filename); // Quita del mapa y persiste en assets.yaml
void addAsset(const std::string& path, Type type); // Añade al mapa y persiste en assets.yaml
void removeAsset(const std::string& filename); // Quita del mapa y persiste en assets.yaml
void loadFromFile(const std::string& config_file_path, const std::string& prefix = "", const std::string& system_folder = ""); // Con soporte para variables
void loadFromString(const std::string& config_content, const std::string& prefix = "", const std::string& system_folder = ""); // Para cargar desde pack (release)
[[nodiscard]] auto get(const std::string& filename) const -> std::string; // Obtiene la ruta completa