Fix command-line tools handling when using .vbo files as inputs

This commit is contained in:
walbourn_cp 2015-02-26 14:50:36 -08:00
parent fcf879ee93
commit 00617d9a7d
2 changed files with 5 additions and 4 deletions

View File

@ -2425,6 +2425,7 @@ HRESULT Mesh::ExportToSDKMESH(const wchar_t* szFileName, size_t nMaterials, cons
s.PrimitiveType = PT_TRIANGLE_LIST;
s.IndexCount = mnFaces * 3;
s.VertexCount = mnVerts;
subsetArray.push_back(0);
submeshes.push_back(s);
}

View File

@ -1109,7 +1109,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
}
else if ( !_wcsicmp(outputExt, L".sdkmesh") )
{
hr = inMesh->ExportToSDKMESH(outputPath, inMaterial.size(), &inMaterial.front());
hr = inMesh->ExportToSDKMESH(outputPath, inMaterial.size(), inMaterial.empty() ? nullptr : &inMaterial.front());
}
else if ( !_wcsicmp(outputExt, L".cmo") )
{
@ -1125,7 +1125,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
return 1;
}
hr = inMesh->ExportToCMO(outputPath, inMaterial.size(), &inMaterial.front());
hr = inMesh->ExportToCMO(outputPath, inMaterial.size(), inMaterial.empty() ? nullptr : &inMaterial.front());
}
else if ( !_wcsicmp(outputExt, L".x") )
{
@ -1168,11 +1168,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
}
else if (!_wcsicmp(outputExt, L".sdkmesh"))
{
hr = inMesh->ExportToSDKMESH(outputPath, inMaterial.size(), &inMaterial.front());
hr = inMesh->ExportToSDKMESH(outputPath, inMaterial.size(), inMaterial.empty() ? nullptr : &inMaterial.front());
}
else if (!_wcsicmp(outputExt, L".cmo"))
{
hr = inMesh->ExportToCMO(outputPath, inMaterial.size(), &inMaterial.front());
hr = inMesh->ExportToCMO(outputPath, inMaterial.size(), inMaterial.empty() ? nullptr : &inMaterial.front());
}
if (FAILED(hr))
{