Revert "Stop crashing on bad meshes like it's the end of the world"
This reverts commit b201fd6dd6.
This commit is contained in:
@@ -14,33 +14,16 @@ const CGrannyModel::TMeshNode* CGrannyModel::GetMeshNodeList(CGrannyMesh::EType
|
|||||||
|
|
||||||
CGrannyMesh * CGrannyModel::GetMeshPointer(int iMesh)
|
CGrannyMesh * CGrannyModel::GetMeshPointer(int iMesh)
|
||||||
{
|
{
|
||||||
if (!CheckMeshIndex(iMesh))
|
assert(CheckMeshIndex(iMesh));
|
||||||
assert(m_meshs != NULL);
|
assert(m_meshs != NULL);
|
||||||
{
|
|
||||||
TraceError("CGrannyModel::GetMeshPointer - Invalid mesh index: %d (max: %d)", iMesh, m_meshNodeSize);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
if (m_meshs == NULL)
|
|
||||||
{
|
|
||||||
TraceError("CGrannyModel::GetMeshPointer - m_meshs is NULL");
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_meshs + iMesh;
|
return m_meshs + iMesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CGrannyMesh* CGrannyModel::GetMeshPointer(int iMesh) const
|
const CGrannyMesh* CGrannyModel::GetMeshPointer(int iMesh) const
|
||||||
{
|
{
|
||||||
if (!CheckMeshIndex(iMesh))
|
assert(CheckMeshIndex(iMesh));
|
||||||
{
|
assert(m_meshs != NULL);
|
||||||
TraceError("CGrannyModel::GetMeshPointer(const) - Invalid mesh index: %d (max: %d)", iMesh, m_meshNodeSize);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
if (m_meshs == NULL)
|
|
||||||
{
|
|
||||||
TraceError("CGrannyModel::GetMeshPointer(const) - m_meshs is NULL");
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_meshs + iMesh;
|
return m_meshs + iMesh;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,10 +101,6 @@ bool CGrannyModelInstance::Intersect(const D3DXMATRIX * c_pMatrix,
|
|||||||
|
|
||||||
granny_matrix_4x4* pgrnMatCompositeBuffer = GrannyGetWorldPoseComposite4x4Array(m_pgrnWorldPose);
|
granny_matrix_4x4* pgrnMatCompositeBuffer = GrannyGetWorldPoseComposite4x4Array(m_pgrnWorldPose);
|
||||||
const CGrannyMesh* c_pMesh = m_pModel->GetMeshPointer(rcurBoundBox.meshIndex);
|
const CGrannyMesh* c_pMesh = m_pModel->GetMeshPointer(rcurBoundBox.meshIndex);
|
||||||
|
|
||||||
if (!c_pMesh)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
const granny_mesh* c_pgrnMesh = c_pMesh->GetGrannyMeshPointer();
|
const granny_mesh* c_pgrnMesh = c_pMesh->GetGrannyMeshPointer();
|
||||||
|
|
||||||
if (!GrannyMeshIsRigid(c_pgrnMesh))
|
if (!GrannyMeshIsRigid(c_pgrnMesh))
|
||||||
|
|||||||
@@ -177,9 +177,6 @@ void CGrannyModelInstance::UpdateWorldMatrices(const D3DXMATRIX* c_pWorldMatrix)
|
|||||||
|
|
||||||
const CGrannyMesh * pMesh = m_pModel->GetMeshPointer(i);
|
const CGrannyMesh * pMesh = m_pModel->GetMeshPointer(i);
|
||||||
|
|
||||||
if (!pMesh)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// WORK
|
// WORK
|
||||||
int * boneIndices = __GetMeshBoneIndices(i);
|
int * boneIndices = __GetMeshBoneIndices(i);
|
||||||
// END_OF_WORK
|
// END_OF_WORK
|
||||||
|
|||||||
Reference in New Issue
Block a user