neteja tidy a source/core i encamina Texture::loadFromFile pel ResourceHelper

This commit is contained in:
2026-05-14 20:22:54 +02:00
parent 88fa3f296f
commit 1912200b21
40 changed files with 699 additions and 578 deletions
+10 -10
View File
@@ -17,9 +17,9 @@ class ResourcePack {
private:
std::unordered_map<std::string, ResourceEntry> resources_;
std::vector<uint8_t> data_;
bool loaded_;
bool loaded_{false};
static uint32_t calculateChecksum(const std::vector<uint8_t>& data);
static auto calculateChecksum(const std::vector<uint8_t>& data) -> uint32_t;
static void encryptData(std::vector<uint8_t>& data, const std::string& key);
static void decryptData(std::vector<uint8_t>& data, const std::string& key);
@@ -27,18 +27,18 @@ class ResourcePack {
ResourcePack();
~ResourcePack();
bool loadPack(const std::string& pack_file);
bool savePack(const std::string& pack_file);
auto loadPack(const std::string& pack_file) -> bool;
auto savePack(const std::string& pack_file) -> bool;
bool addFile(const std::string& filename, const std::string& filepath);
bool addDirectory(const std::string& directory);
auto addFile(const std::string& filename, const std::string& filepath) -> bool;
auto addDirectory(const std::string& directory) -> bool;
std::vector<uint8_t> getResource(const std::string& filename);
bool hasResource(const std::string& filename) const;
auto getResource(const std::string& filename) -> std::vector<uint8_t>;
auto hasResource(const std::string& filename) const -> bool;
void clear();
size_t getResourceCount() const;
std::vector<std::string> getResourceList() const;
auto getResourceCount() const -> size_t;
auto getResourceList() const -> std::vector<std::string>;
static const std::string DEFAULT_ENCRYPT_KEY;
};