Added meta generation recognisation for scene and font extension types on load up
Check for std::optional value exist
This commit is contained in:
parent
874977775d
commit
3cc5ed0dec
|
@ -560,6 +560,34 @@ namespace SHADE
|
|||
assetCollection.emplace(newAsset.id, newAsset);
|
||||
SHAssetMetaHandler::WriteMetaData(newAsset);
|
||||
|
||||
return newAsset.id;
|
||||
}
|
||||
else if (ext == SCENE_EXTENSION)
|
||||
{
|
||||
SHAsset newAsset{
|
||||
path.stem().string(),
|
||||
GenerateAssetID(AssetType::SCENE),
|
||||
AssetType::SCENE,
|
||||
path,
|
||||
false
|
||||
};
|
||||
assetCollection.emplace(newAsset.id, newAsset);
|
||||
SHAssetMetaHandler::WriteMetaData(newAsset);
|
||||
|
||||
return newAsset.id;
|
||||
}
|
||||
else if (ext == FONT_EXTENSION)
|
||||
{
|
||||
SHAsset newAsset{
|
||||
path.stem().string(),
|
||||
GenerateAssetID(AssetType::FONT),
|
||||
AssetType::FONT,
|
||||
path,
|
||||
false
|
||||
};
|
||||
assetCollection.emplace(newAsset.id, newAsset);
|
||||
SHAssetMetaHandler::WriteMetaData(newAsset);
|
||||
|
||||
return newAsset.id;
|
||||
}
|
||||
}
|
||||
|
@ -571,8 +599,11 @@ namespace SHADE
|
|||
|
||||
for (auto& file : toGenNew)
|
||||
{
|
||||
auto newID{ GenerateNewMeta(file->path).value() };
|
||||
file->assetMeta = &assetCollection[newID];
|
||||
auto newID{ GenerateNewMeta(file->path) };
|
||||
if (newID.has_value())
|
||||
{
|
||||
file->assetMeta = &assetCollection[newID.value()];
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& asset : std::ranges::views::values(assetCollection))
|
||||
|
|
Loading…
Reference in New Issue