mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
cleanup AssetsLoader
This commit is contained in:
parent
8c1d8bd794
commit
103ca99d81
4 changed files with 80 additions and 93 deletions
|
|
@ -87,21 +87,6 @@ struct aloader_entry {
|
|||
};
|
||||
|
||||
class AssetsLoader {
|
||||
Engine& engine;
|
||||
Assets& assets;
|
||||
std::map<AssetType, aloader_func> loaders;
|
||||
std::queue<aloader_entry> entries;
|
||||
std::set<std::pair<AssetType, std::string>> enqueued;
|
||||
const ResPaths& paths;
|
||||
|
||||
void tryAddSound(const std::string& name);
|
||||
|
||||
void processPreload(
|
||||
AssetType tag, const std::string& name, const dv::value& map
|
||||
);
|
||||
void processPreloadList(AssetType tag, const dv::value& list);
|
||||
void processPreloadConfig(const io::path& file);
|
||||
void processPreloadConfigs(const Content* content);
|
||||
public:
|
||||
AssetsLoader(Engine& engine, Assets& assets, const ResPaths& paths);
|
||||
AssetsLoader(const AssetsLoader&) = delete;
|
||||
|
|
@ -132,9 +117,8 @@ public:
|
|||
aloader_func getLoader(AssetType tag);
|
||||
|
||||
/// @brief Enqueue core and content assets
|
||||
/// @param loader target loader
|
||||
/// @param content engine content
|
||||
static void addDefaults(AssetsLoader& loader, const Content* content);
|
||||
void addDefaults(const Content* content);
|
||||
|
||||
static bool loadExternalTexture(
|
||||
AssetsLoader& loader,
|
||||
|
|
@ -144,4 +128,18 @@ public:
|
|||
|
||||
Assets& getAssets();
|
||||
Engine& getEngine();
|
||||
private:
|
||||
Engine& engine;
|
||||
Assets& assets;
|
||||
std::map<AssetType, aloader_func> loaders;
|
||||
std::queue<aloader_entry> entries;
|
||||
std::set<std::pair<AssetType, std::string>> enqueued;
|
||||
const ResPaths& paths;
|
||||
|
||||
void processPreload(
|
||||
AssetType tag, const std::string& name, const dv::value& map
|
||||
);
|
||||
void processPreloadList(AssetType tag, const dv::value& list);
|
||||
void processPreloadConfig(const io::path& file);
|
||||
void processPreloadConfigs(const Content* content);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue