Cleanup pass

This commit is contained in:
ackwell 2024-01-11 21:54:52 +11:00
parent 2e473a62f4
commit b81f3f423c
2 changed files with 8 additions and 8 deletions

View file

@ -136,14 +136,14 @@ public partial class ModelImporter(ModelRoot model)
var mesh = MeshImporter.Import(subMeshNodes); var mesh = MeshImporter.Import(subMeshNodes);
var meshStartIndex = (uint)(mesh.MeshStruct.StartIndex + indexOffset); var meshStartIndex = (uint)(mesh.MeshStruct.StartIndex + indexOffset);
ushort materialIndex = 0; var materialIndex = mesh.Material != null
if (mesh.Material != null) ? GetMaterialIndex(mesh.Material)
materialIndex = GetMaterialIndex(mesh.Material); : (ushort)0;
// If no bone table is used for a mesh, the index is set to 255. // If no bone table is used for a mesh, the index is set to 255.
ushort boneTableIndex = 255; var boneTableIndex = mesh.Bones != null
if (mesh.Bones != null) ? BuildBoneTable(mesh.Bones)
boneTableIndex = BuildBoneTable(mesh.Bones); : (ushort)255;
_meshes.Add(mesh.MeshStruct with _meshes.Add(mesh.MeshStruct with
{ {
@ -196,7 +196,7 @@ public partial class ModelImporter(ModelRoot model)
private ushort GetMaterialIndex(string materialName) private ushort GetMaterialIndex(string materialName)
{ {
// If we already have this material, grab the current one // If we already have this material, grab the current index.
var index = _materials.IndexOf(materialName); var index = _materials.IndexOf(materialName);
if (index >= 0) if (index >= 0)
return (ushort)index; return (ushort)index;