Asset recognise bugfix #204
|
@ -560,6 +560,34 @@ namespace SHADE
|
||||||
assetCollection.emplace(newAsset.id, newAsset);
|
assetCollection.emplace(newAsset.id, newAsset);
|
||||||
SHAssetMetaHandler::WriteMetaData(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;
|
return newAsset.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -571,8 +599,11 @@ namespace SHADE
|
||||||
|
|
||||||
for (auto& file : toGenNew)
|
for (auto& file : toGenNew)
|
||||||
{
|
{
|
||||||
auto newID{ GenerateNewMeta(file->path).value() };
|
auto newID{ GenerateNewMeta(file->path) };
|
||||||
file->assetMeta = &assetCollection[newID];
|
if (newID.has_value())
|
||||||
|
{
|
||||||
|
file->assetMeta = &assetCollection[newID.value()];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& asset : std::ranges::views::values(assetCollection))
|
for (auto& asset : std::ranges::views::values(assetCollection))
|
||||||
|
|
Loading…
Reference in New Issue