Asset recognise bugfix #204

Merged
XiaoQiDigipen merged 1 commits from SP3-13-Assets-Manager into main 2022-11-14 18:32:48 +08:00
1 changed files with 33 additions and 2 deletions

View File

@ -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))