Fixed build warnings on MSVC14 x64 in the debone process.

pull/1083/head
Jared Mulconry 2016-11-19 03:45:25 +11:00
parent 43ef4ec715
commit 0469a5c2e4
1 changed files with 7 additions and 7 deletions

View File

@ -137,7 +137,7 @@ void DeboneProcess::Execute( aiScene* pScene)
const aiString *find = newMeshes[b].second?&newMeshes[b].second->mName:0; const aiString *find = newMeshes[b].second?&newMeshes[b].second->mName:0;
aiNode *theNode = find?pScene->mRootNode->FindNode(*find):0; aiNode *theNode = find?pScene->mRootNode->FindNode(*find):0;
std::pair<unsigned int,aiNode*> push_pair(meshes.size(),theNode); std::pair<unsigned int,aiNode*> push_pair(static_cast<unsigned int>(meshes.size()),theNode);
mSubMeshIndices[a].push_back(push_pair); mSubMeshIndices[a].push_back(push_pair);
meshes.push_back(newMeshes[b].first); meshes.push_back(newMeshes[b].first);
@ -156,13 +156,13 @@ void DeboneProcess::Execute( aiScene* pScene)
} }
else { else {
// Mesh is kept unchanged - store it's new place in the mesh array // Mesh is kept unchanged - store it's new place in the mesh array
mSubMeshIndices[a].push_back(std::pair<unsigned int,aiNode*>(meshes.size(),(aiNode*)0)); mSubMeshIndices[a].push_back(std::pair<unsigned int,aiNode*>(static_cast<unsigned int>(meshes.size()),(aiNode*)0));
meshes.push_back(srcMesh); meshes.push_back(srcMesh);
} }
} }
// rebuild the scene's mesh array // rebuild the scene's mesh array
pScene->mNumMeshes = meshes.size(); pScene->mNumMeshes = static_cast<unsigned int>(meshes.size());
delete [] pScene->mMeshes; delete [] pScene->mMeshes;
pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]; pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
std::copy( meshes.begin(), meshes.end(), pScene->mMeshes); std::copy( meshes.begin(), meshes.end(), pScene->mMeshes);
@ -382,7 +382,7 @@ void DeboneProcess::UpdateNode(aiNode* pNode) const
// this will require two passes // this will require two passes
unsigned int m = pNode->mNumMeshes, n = mSubMeshIndices.size(); unsigned int m = static_cast<unsigned int>(pNode->mNumMeshes), n = static_cast<unsigned int>(mSubMeshIndices.size());
// first pass, look for meshes which have not moved // first pass, look for meshes which have not moved
@ -390,7 +390,7 @@ void DeboneProcess::UpdateNode(aiNode* pNode) const
unsigned int srcIndex = pNode->mMeshes[a]; unsigned int srcIndex = pNode->mMeshes[a];
const std::vector< std::pair< unsigned int,aiNode* > > &subMeshes = mSubMeshIndices[srcIndex]; const std::vector< std::pair< unsigned int,aiNode* > > &subMeshes = mSubMeshIndices[srcIndex];
unsigned int nSubmeshes = subMeshes.size(); unsigned int nSubmeshes = static_cast<unsigned int>(subMeshes.size());
for(unsigned int b=0;b<nSubmeshes;b++) { for(unsigned int b=0;b<nSubmeshes;b++) {
if(!subMeshes[b].second) { if(!subMeshes[b].second) {
@ -404,7 +404,7 @@ void DeboneProcess::UpdateNode(aiNode* pNode) const
for(unsigned int a=0;a<n;a++) for(unsigned int a=0;a<n;a++)
{ {
const std::vector< std::pair< unsigned int,aiNode* > > &subMeshes = mSubMeshIndices[a]; const std::vector< std::pair< unsigned int,aiNode* > > &subMeshes = mSubMeshIndices[a];
unsigned int nSubmeshes = subMeshes.size(); unsigned int nSubmeshes = static_cast<unsigned int>(subMeshes.size());
for(unsigned int b=0;b<nSubmeshes;b++) { for(unsigned int b=0;b<nSubmeshes;b++) {
if(subMeshes[b].second == pNode) { if(subMeshes[b].second == pNode) {
@ -417,7 +417,7 @@ void DeboneProcess::UpdateNode(aiNode* pNode) const
delete [] pNode->mMeshes; pNode->mMeshes = NULL; delete [] pNode->mMeshes; pNode->mMeshes = NULL;
} }
pNode->mNumMeshes = newMeshList.size(); pNode->mNumMeshes = static_cast<unsigned int>(newMeshList.size());
if(pNode->mNumMeshes) { if(pNode->mNumMeshes) {
pNode->mMeshes = new unsigned int[pNode->mNumMeshes]; pNode->mMeshes = new unsigned int[pNode->mNumMeshes];