fix more warnings.

This commit is contained in:
Kim Kulling
2020-02-16 15:37:20 +01:00
parent 4a3ecbea14
commit c2bfbdacf4
15 changed files with 133 additions and 110 deletions

View File

@@ -62,7 +62,7 @@ bool ArmaturePopulate::IsActive(unsigned int pFlags) const {
return (pFlags & aiProcess_PopulateArmatureData) != 0;
}
void ArmaturePopulate::SetupProperties(const Importer *pImp) {
void ArmaturePopulate::SetupProperties(const Importer *) {
// do nothing
}
@@ -162,7 +162,7 @@ void ArmaturePopulate::BuildNodeList(const aiNode *current_node,
// A bone stack allows us to have multiple armatures, with the same bone names
// A bone stack allows us also to retrieve bones true transform even with
// duplicate names :)
void ArmaturePopulate::BuildBoneStack(aiNode *current_node,
void ArmaturePopulate::BuildBoneStack(aiNode *,
const aiNode *root_node,
const aiScene *scene,
const std::vector<aiBone *> &bones,

View File

@@ -238,7 +238,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
// FIX: check whether we can reuse the SpatialSort of a previous step
SpatialSort* vertexFinder = NULL;
SpatialSort _vertexFinder;
float posEpsilon;
float posEpsilon = 10e-6f;
if (shared)
{
std::vector<std::pair<SpatialSort,float> >* avf;

View File

@@ -99,8 +99,8 @@ void UpdateMeshReferences(aiNode* node, const std::vector<unsigned int>& meshMap
}
// just let the members that are unused, that's much cheaper
// than a full array realloc'n'copy party ...
if(!(node->mNumMeshes = out)) {
node->mNumMeshes = out;
if ( 0 == out ) {
delete[] node->mMeshes;
node->mMeshes = NULL;
}
@@ -122,9 +122,8 @@ void FindInvalidDataProcess::Execute( aiScene* pScene) {
// Process meshes
for( unsigned int a = 0; a < pScene->mNumMeshes; a++) {
int result;
if ((result = ProcessMesh( pScene->mMeshes[a]))) {
int result = ProcessMesh(pScene->mMeshes[a]);
if (0 == result ) {
out = true;
if (2 == result) {
@@ -141,8 +140,8 @@ void FindInvalidDataProcess::Execute( aiScene* pScene) {
}
// Process animations
for (unsigned int a = 0; a < pScene->mNumAnimations;++a) {
ProcessAnimation( pScene->mAnimations[a]);
for (unsigned int animIdx = 0; animIdx < pScene->mNumAnimations; ++animIdx) {
ProcessAnimation(pScene->mAnimations[animIdx]);
}

View File

@@ -132,11 +132,9 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
// need to build a clean list of bones, too
for (unsigned int i = 0;i < pcMesh->mNumBones;++i)
{
for (unsigned int a = 0; a < pcMesh->mBones[i]->mNumWeights;a++)
{
const aiVertexWeight& w = pcMesh->mBones[i]->mWeights[a];
if(pcFace->mIndices[q] == w.mVertexId)
{
for (unsigned int boneIdx = 0; boneIdx < pcMesh->mBones[i]->mNumWeights; ++boneIdx) {
const aiVertexWeight &w = pcMesh->mBones[i]->mWeights[boneIdx];
if(pcFace->mIndices[q] == w.mVertexId) {
aiVertexWeight wNew;
wNew.mVertexId = iIndex;
wNew.mWeight = w.mWeight;
@@ -157,17 +155,17 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
pvBitangents[iIndex] = pcMesh->mBitangents[pcFace->mIndices[q]];
}
unsigned int p = 0;
while (pcMesh->HasTextureCoords(p))
unsigned int pp = 0;
while (pcMesh->HasTextureCoords(pp))
{
apvTextureCoords[p][iIndex] = pcMesh->mTextureCoords[p][pcFace->mIndices[q]];
++p;
apvTextureCoords[pp][iIndex] = pcMesh->mTextureCoords[pp][pcFace->mIndices[q]];
++pp;
}
p = 0;
while (pcMesh->HasVertexColors(p))
pp = 0;
while (pcMesh->HasVertexColors(pp))
{
apvColorSets[p][iIndex] = pcMesh->mColors[p][pcFace->mIndices[q]];
++p;
apvColorSets[pp][iIndex] = pcMesh->mColors[pp][pcFace->mIndices[q]];
++pp;
}
pcFace->mIndices[q] = iIndex;
}

View File

@@ -179,7 +179,7 @@ void OptimizeGraphProcess::CollectNewChildren(aiNode *nd, std::list<aiNode *> &n
// copy all mesh references in one array
if (out_meshes) {
unsigned int *meshes = new unsigned int[out_meshes + join_master->mNumMeshes], *tmp = meshes;
unsigned int *meshIdxs = new unsigned int[out_meshes + join_master->mNumMeshes], *tmp = meshIdxs;
for (unsigned int n = 0; n < join_master->mNumMeshes; ++n) {
*tmp++ = join_master->mMeshes[n];
}
@@ -217,7 +217,7 @@ void OptimizeGraphProcess::CollectNewChildren(aiNode *nd, std::list<aiNode *> &n
delete join_node; // bye, node
}
delete[] join_master->mMeshes;
join_master->mMeshes = meshes;
join_master->mMeshes = meshIdxs;
join_master->mNumMeshes += out_meshes;
}
}

View File

@@ -330,19 +330,23 @@ void SortByPTypeProcess::Execute( aiScene* pScene) {
ai_assert(outFaces == out->mFaces + out->mNumFaces);
// now generate output bones
for (unsigned int q = 0; q < mesh->mNumBones;++q)
if (!tempBones[q].empty())++out->mNumBones;
for (unsigned int q = 0; q < mesh->mNumBones; ++q) {
if (!tempBones[q].empty()) {
++out->mNumBones;
}
}
if (out->mNumBones)
{
if (out->mNumBones) {
out->mBones = new aiBone*[out->mNumBones];
for (unsigned int q = 0, real = 0; q < mesh->mNumBones;++q)
for (unsigned int q = 0, boneIdx = 0; q < mesh->mNumBones;++q)
{
TempBoneInfo& in = tempBones[q];
if (in.empty())continue;
if (in.empty()) {
continue;
}
aiBone* srcBone = mesh->mBones[q];
aiBone* bone = out->mBones[real] = new aiBone();
aiBone *bone = out->mBones[boneIdx] = new aiBone();
bone->mName = srcBone->mName;
bone->mOffsetMatrix = srcBone->mOffsetMatrix;
@@ -352,7 +356,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene) {
::memcpy(bone->mWeights,&in[0],bone->mNumWeights*sizeof(aiVertexWeight));
++real;
++boneIdx;
}
}
}
@@ -364,7 +368,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene) {
delete mesh;
// avoid invalid pointer
pScene->mMeshes[i] = NULL;
pScene->mMeshes[i] = nullptr;
}
if (outMeshes.empty())

View File

@@ -419,7 +419,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
num = 0;
break;
curOut -= (max-num); /* undo all previous work */
/*curOut -= (max-num); // undo all previous work
for (tmp = 0; tmp < max-2; ++tmp) {
aiFace& nface = *curOut++;
@@ -433,7 +433,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
}
num = 0;
break;
break;*/
}
aiFace& nface = *curOut++;

View File

@@ -612,7 +612,7 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
bool bNoSpecified = true;
for (unsigned int i = 0; i < pMaterial->mNumProperties;++i) {
aiMaterialProperty* prop = pMaterial->mProperties[i];
if (prop->mSemantic != type) {
if (static_cast<aiTextureType>(prop->mSemantic) != type) {
continue;
}