mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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
|
|
@ -43,7 +43,11 @@ void AssetsLoader::add(
|
|||
const std::string& alias,
|
||||
std::shared_ptr<AssetCfg> settings
|
||||
) {
|
||||
if (enqueued.find({tag, alias}) != enqueued.end()){
|
||||
return;
|
||||
}
|
||||
entries.push(aloader_entry {tag, filename, alias, std::move(settings)});
|
||||
enqueued.insert({tag, alias});
|
||||
}
|
||||
|
||||
bool AssetsLoader::hasNext() const {
|
||||
|
|
@ -148,6 +152,16 @@ void AssetsLoader::processPreload(
|
|||
std::make_shared<SoundCfg>(map.at("keep-pcm").get(keepPCM)));
|
||||
break;
|
||||
}
|
||||
case AssetType::ATLAS: {
|
||||
std::string typeName = "atlas";
|
||||
map.at("type").get(typeName);
|
||||
auto type = AtlasType::ATLAS;
|
||||
if (typeName == "separate") {
|
||||
type = AtlasType::SEPARATE;
|
||||
}
|
||||
add(tag, path, name, std::make_shared<AtlasCfg>(type));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
add(tag, path, name);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue