Graphics/Model: Add mesh callback parameter

It allows to query/save/update the mesh before it's used to create a GraphicalMesh and disposed of
This commit is contained in:
SirLynix
2024-02-07 15:56:16 +01:00
parent 5a46ebda36
commit 18b6d14670
2 changed files with 10 additions and 0 deletions

View File

@@ -26,6 +26,13 @@ namespace Nz::Loaders
if (!mesh)
return Err(ResourceLoadingError::Unrecognized);
if (parameters.meshCallback)
{
Result res = parameters.meshCallback(mesh);
if (!res)
return Err(res.GetError());
}
std::shared_ptr<GraphicalMesh> gfxMesh = GraphicalMesh::BuildFromMesh(*mesh);
if (!gfxMesh)
return Err(ResourceLoadingError::Internal);