28 lines
978 B
C++
28 lines
978 B
C++
#pragma once
|
|
|
|
#include "asset.h"
|
|
#include "resource_loader.h"
|
|
#include <memory>
|
|
|
|
// Extensión de Asset que integra ResourceLoader
|
|
class AssetIntegrated : public Asset {
|
|
public:
|
|
// Inicializa Asset con ResourceLoader
|
|
static void initWithResourcePack(const std::string &executable_path,
|
|
const std::string &resource_pack_path = "resources.pack");
|
|
|
|
// Carga un archivo usando ResourceLoader como primera opción
|
|
std::vector<uint8_t> loadFile(const std::string &filename);
|
|
|
|
// Verifica si un archivo existe (pack o filesystem)
|
|
bool fileExists(const std::string &filename) const;
|
|
|
|
// Obtiene la ruta completa para archivos del sistema/config
|
|
std::string getSystemPath(const std::string &filename) const;
|
|
|
|
private:
|
|
static bool resource_pack_enabled_;
|
|
|
|
// Determina si un archivo debe cargarse del pack o del filesystem
|
|
bool shouldUseResourcePack(const std::string &filepath) const;
|
|
}; |