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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user