actualitzada la carpeta release a SDL3

migrat a resources.pack
This commit is contained in:
2025-10-31 22:58:37 +01:00
parent 70bfced50d
commit 8c6bea897c
513 changed files with 377587 additions and 29821 deletions
+42
View File
@@ -0,0 +1,42 @@
// resource_helper.hpp
// Helper functions for resource loading (bridge to pack system)
#ifndef RESOURCE_HELPER_HPP
#define RESOURCE_HELPER_HPP
#include <string>
#include <vector>
namespace jdd {
namespace ResourceHelper {
// Initialize the resource system
// pack_file: Path to resources.pack
// enable_fallback: Allow loading from filesystem if pack not available
auto initializeResourceSystem(const std::string& pack_file = "resources.pack",
bool enable_fallback = true) -> bool;
// Shutdown the resource system
void shutdownResourceSystem();
// Load a file (tries pack first, then filesystem if fallback enabled)
auto loadFile(const std::string& filepath) -> std::vector<uint8_t>;
// Check if a file exists
auto fileExists(const std::string& filepath) -> bool;
// Convert an asset path to a pack path
// Example: "data/music/title.ogg" -> "music/title.ogg"
auto getPackPath(const std::string& asset_path) -> std::string;
// Check if a file should use the resource pack
// Returns false for config/ files (always from filesystem)
auto shouldUseResourcePack(const std::string& filepath) -> bool;
// Check if pack is loaded
auto isPackLoaded() -> bool;
} // namespace ResourceHelper
} // namespace jdd
#endif // RESOURCE_HELPER_HPP