Refactorizar sistema de recursos: crear ResourceManager centralizado
- Crear ResourceManager singleton para gestión centralizada de recursos - Separar lógica de ResourcePack de la clase Texture - Adaptar TextRenderer para cargar fuentes TTF desde pack - Adaptar LogoScaler para cargar imágenes PNG desde pack - Actualizar main.cpp y engine.cpp para usar ResourceManager - Regenerar resources.pack con fuentes y logos incluidos Fixes: - Resuelve error de carga de fuentes desde disco - Resuelve error de carga de logos (can't fopen) - Implementa fallback automático a disco si no existe pack - Todas las clases ahora pueden cargar recursos desde pack 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#include <iostream> // for cout
|
||||
#include <string> // for string
|
||||
|
||||
#include "resource_manager.h" // for ResourceManager
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h> // for GetModuleFileName
|
||||
#endif
|
||||
@@ -164,9 +166,9 @@ bool Engine::initialize(int width, int height, int zoom, bool fullscreen, AppMod
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Fallback: cargar texturas desde pack usando la lista del ResourcePack
|
||||
if (Texture::isPackLoaded()) {
|
||||
auto pack_resources = Texture::getPackResourceList();
|
||||
// Fallback: cargar texturas desde pack usando la lista del ResourceManager
|
||||
if (ResourceManager::isPackLoaded()) {
|
||||
auto pack_resources = ResourceManager::getResourceList();
|
||||
|
||||
// Filtrar solo los recursos en balls/ con extensión .png
|
||||
for (const auto& resource : pack_resources) {
|
||||
|
||||
Reference in New Issue
Block a user