Fix not being able to dump t6 xmodels without surface

This commit is contained in:
Jan 2022-07-09 14:16:24 +02:00
parent da79ce2463
commit 5ee541c0ff

View File

@ -349,6 +349,9 @@ void AssetDumperXModel::AddXModelVertices(AbstractXModelWriter& writer, const XM
const auto* surfs = &model->surfs[model->lodInfo[lod].surfIndex];
const auto surfCount = model->lodInfo[lod].numsurfs;
if (!surfs)
return;
for (auto surfIndex = 0u; surfIndex < surfCount; surfIndex++)
{
const auto& surface = surfs[surfIndex];
@ -388,6 +391,9 @@ void AssetDumperXModel::AllocateXModelBoneWeights(const XModel* model, const uns
const auto* surfs = &model->surfs[model->lodInfo[lod].surfIndex];
const auto surfCount = model->lodInfo[lod].numsurfs;
if (!surfs)
return;
weightCollection.totalWeightCount = 0u;
for (auto surfIndex = 0u; surfIndex < surfCount; surfIndex++)
{
@ -415,6 +421,9 @@ void AssetDumperXModel::AddXModelVertexBoneWeights(AbstractXModelWriter& writer,
const auto* surfs = &model->surfs[model->lodInfo[lod].surfIndex];
const auto surfCount = model->lodInfo[lod].numsurfs;
if (!surfs)
return;
size_t weightOffset = 0u;
for (auto surfIndex = 0u; surfIndex < surfCount; surfIndex++)
@ -581,6 +590,9 @@ void AssetDumperXModel::AddXModelFaces(AbstractXModelWriter& writer, const Disti
const auto surfCount = model->lodInfo[lod].numsurfs;
const auto baseSurfIndex = model->lodInfo[lod].surfIndex;
if (!surfs)
return;
for (auto surfIndex = 0u; surfIndex < surfCount; surfIndex++)
{
const auto& surface = surfs[surfIndex];