more compiler compliant cleanups plus a full set of tsMesh::foo to tsmesh::mFoo class var conversions for consistency

This commit is contained in:
Azaezel 2018-03-13 14:53:23 -05:00
parent b55db9a143
commit 4615bd6db8
13 changed files with 293 additions and 293 deletions

View file

@ -592,11 +592,11 @@ void TSShape::initObjects()
if (mesh->mParentMesh >= 0 && mesh->mParentMesh < meshes.size())
{
mesh->parentMeshObject = meshes[mesh->mParentMesh];
mesh->mParentMeshObject = meshes[mesh->mParentMesh];
}
else
{
mesh->parentMeshObject = NULL;
mesh->mParentMeshObject = NULL;
}
mesh->mVertexFormat = &mVertexFormat;
@ -623,7 +623,7 @@ void TSShape::initVertexBuffers()
continue;
destIndices += mesh->mIndices.size();
destPrims += mesh->primitives.size();
destPrims += mesh->mPrimitives.size();
}
// For HW skinning we can just use the static buffer
@ -660,14 +660,14 @@ void TSShape::initVertexBuffers()
AssertFatal(mesh->mVertOffset / mVertexSize == vertStart, "offset mismatch");
vertStart += mesh->mNumVerts;
primStart += mesh->primitives.size();
primStart += mesh->mPrimitives.size();
indStart += mesh->mIndices.size();
mesh->mVB = mShapeVertexBuffer;
mesh->mPB = mShapeVertexIndices;
// Advance
piInput += mesh->primitives.size();
piInput += mesh->mPrimitives.size();
ibIndices += mesh->mIndices.size();
if (TSSkinMesh::smDebugSkinVerts && mesh->getMeshType() == TSMesh::SkinMeshType)
@ -906,12 +906,12 @@ void TSShape::initVertexFeatures()
mesh->mVertexData.setReady(true);
#ifdef TORQUE_DEBUG
AssertFatal(mesh->mNumVerts == mesh->verts.size(), "vert mismatch");
AssertFatal(mesh->mNumVerts == mesh->mVerts.size(), "vert mismatch");
for (U32 i = 0; i < mesh->mNumVerts; i++)
{
Point3F v1 = mesh->verts[i];
Point3F v1 = mesh->mVerts[i];
Point3F v2 = mesh->mVertexData.getBase(i).vert();
AssertFatal(mesh->verts[i] == mesh->mVertexData.getBase(i).vert(), "vert data mismatch");
AssertFatal(mesh->mVerts[i] == mesh->mVertexData.getBase(i).vert(), "vert data mismatch");
}
if (mesh->getMeshType() == TSMesh::SkinMeshType)
@ -987,11 +987,11 @@ void TSShape::initMaterialList()
if (!mesh)
continue;
for (k=0; k<mesh->primitives.size(); k++)
for (k=0; k<mesh->mPrimitives.size(); k++)
{
if (mesh->primitives[k].matIndex & TSDrawPrimitive::NoMaterial)
if (mesh->mPrimitives[k].matIndex & TSDrawPrimitive::NoMaterial)
continue;
S32 flags = materialList->getFlags(mesh->primitives[k].matIndex & TSDrawPrimitive::MaterialMask);
S32 flags = materialList->getFlags(mesh->mPrimitives[k].matIndex & TSDrawPrimitive::MaterialMask);
if (flags & TSMaterialList::AuxiliaryMap)
continue;
if (flags & TSMaterialList::Translucent)
@ -1001,7 +1001,7 @@ void TSShape::initMaterialList()
break;
}
}
if (k!=mesh->primitives.size())
if (k!=mesh->mPrimitives.size())
break;
}
if (j!=obj.numMeshes)
@ -1521,15 +1521,15 @@ void TSShape::assembleShape()
// fill in location of verts, tverts, and normals for detail levels
if (mesh && meshType!=TSMesh::DecalMeshType)
{
TSMesh::smVertsList[i] = mesh->verts.address();
TSMesh::smTVertsList[i] = mesh->tverts.address();
TSMesh::smVertsList[i] = mesh->mVerts.address();
TSMesh::smTVertsList[i] = mesh->mTverts.address();
if (smReadVersion >= 26)
{
TSMesh::smTVerts2List[i] = mesh->tverts2.address();
TSMesh::smColorsList[i] = mesh->colors.address();
TSMesh::smTVerts2List[i] = mesh->mTverts2.address();
TSMesh::smColorsList[i] = mesh->mColors.address();
}
TSMesh::smNormsList[i] = mesh->norms.address();
TSMesh::smEncodedNormsList[i] = mesh->encodedNorms.address();
TSMesh::smNormsList[i] = mesh->mNorms.address();
TSMesh::smEncodedNormsList[i] = mesh->mEncodedNorms.address();
TSMesh::smDataCopied[i] = !skip; // as long as we didn't skip this mesh, the data should be in shape now
if (meshType==TSMesh::SkinMeshType)
{
@ -1617,9 +1617,9 @@ void TSShape::assembleShape()
if (skin)
{
TSMesh::smVertsList[i] = skin->batchData.initialVerts.address();
TSMesh::smTVertsList[i] = skin->tverts.address();
TSMesh::smTVertsList[i] = skin->mTverts.address();
TSMesh::smNormsList[i] = skin->batchData.initialNorms.address();
TSMesh::smEncodedNormsList[i] = skin->encodedNorms.address();
TSMesh::smEncodedNormsList[i] = skin->mEncodedNorms.address();
TSMesh::smDataCopied[i] = !skip; // as long as we didn't skip this mesh, the data should be in shape now
TSSkinMesh::smInitTransformList[i] = skin->batchData.initialTransforms.address();
TSSkinMesh::smVertexIndexList[i] = skin->vertexIndex.address();
@ -1805,15 +1805,15 @@ bool TSShape::canWriteOldFormat() const
continue;
// Cannot use old format if using the new functionality (COLORs, 2nd UV set)
if (meshes[i]->tverts2.size() || meshes[i]->colors.size())
if (meshes[i]->mTverts2.size() || meshes[i]->mColors.size())
return false;
// Cannot use old format if any primitive has too many triangles
// (ie. cannot fit in a S16)
for (S32 j = 0; j < meshes[i]->primitives.size(); j++)
for (S32 j = 0; j < meshes[i]->mPrimitives.size(); j++)
{
if ((meshes[i]->primitives[j].start +
meshes[i]->primitives[j].numElements) >= (1 << 15))
if ((meshes[i]->mPrimitives[j].start +
meshes[i]->mPrimitives[j].numElements) >= (1 << 15))
{
return false;
}