neteja tidy a source/core i encamina Texture::loadFromFile pel ResourceHelper
This commit is contained in:
@@ -11,29 +11,29 @@ class ResourcePack;
|
||||
class ResourceLoader {
|
||||
private:
|
||||
static std::unique_ptr<ResourceLoader> instance;
|
||||
ResourcePack* resource_pack_;
|
||||
ResourcePack* resource_pack_{nullptr};
|
||||
std::string pack_path_;
|
||||
bool fallback_to_files_;
|
||||
bool fallback_to_files_{true};
|
||||
|
||||
ResourceLoader();
|
||||
|
||||
public:
|
||||
static ResourceLoader& getInstance();
|
||||
static auto getInstance() -> ResourceLoader&;
|
||||
~ResourceLoader();
|
||||
|
||||
bool initialize(const std::string& pack_file, bool enable_fallback = true);
|
||||
auto initialize(const std::string& pack_file, bool enable_fallback = true) -> bool;
|
||||
void shutdown();
|
||||
|
||||
std::vector<uint8_t> loadResource(const std::string& filename);
|
||||
bool resourceExists(const std::string& filename);
|
||||
auto loadResource(const std::string& filename) -> std::vector<uint8_t>;
|
||||
auto resourceExists(const std::string& filename) -> bool;
|
||||
|
||||
void setFallbackToFiles(bool enable) { fallback_to_files_ = enable; }
|
||||
bool getFallbackToFiles() const { return fallback_to_files_; }
|
||||
[[nodiscard]] auto getFallbackToFiles() const -> bool { return fallback_to_files_; }
|
||||
|
||||
size_t getLoadedResourceCount() const;
|
||||
std::vector<std::string> getAvailableResources() const;
|
||||
[[nodiscard]] auto getLoadedResourceCount() const -> size_t;
|
||||
[[nodiscard]] auto getAvailableResources() const -> std::vector<std::string>;
|
||||
|
||||
private:
|
||||
static std::vector<uint8_t> loadFromFile(const std::string& filename);
|
||||
static std::string getDataPath(const std::string& filename);
|
||||
static auto loadFromFile(const std::string& filename) -> std::vector<uint8_t>;
|
||||
static auto getDataPath(const std::string& filename) -> std::string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user