mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
add 'separate' atlas type & get rid of assets loading entries duplicates
This commit is contained in:
parent
0144709e03
commit
784f93666c
3 changed files with 42 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include <filesystem>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
|
|
@ -37,6 +38,17 @@ struct SoundCfg : AssetCfg {
|
|||
}
|
||||
};
|
||||
|
||||
enum class AtlasType {
|
||||
ATLAS, SEPARATE
|
||||
};
|
||||
|
||||
struct AtlasCfg : AssetCfg {
|
||||
AtlasType type;
|
||||
|
||||
AtlasCfg(AtlasType type) : type(type) {
|
||||
}
|
||||
};
|
||||
|
||||
using aloader_func = std::function<
|
||||
assetload::
|
||||
postfunc(AssetsLoader*, const ResPaths*, const std::string&, const std::string&, std::shared_ptr<AssetCfg>)>;
|
||||
|
|
@ -52,6 +64,7 @@ class AssetsLoader {
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue