Fixed build warnings on MSVC14 x64 in the IRR format sources.

pull/1083/head
Jared Mulconry 2016-11-20 01:52:04 +11:00
parent c7efb50ad1
commit 1e2c0279b0
2 changed files with 9 additions and 9 deletions

View File

@ -215,7 +215,7 @@ void IRRImporter::BuildSkybox(std::vector<aiMesh*>& meshes, std::vector<aiMateri
SkyboxVertex( l,-l,-l, 0, 0, 1, 0.0,1.0), SkyboxVertex( l,-l,-l, 0, 0, 1, 0.0,1.0),
SkyboxVertex( l, l,-l, 0, 0, 1, 0.0,0.0), SkyboxVertex( l, l,-l, 0, 0, 1, 0.0,0.0),
SkyboxVertex(-l, l,-l, 0, 0, 1, 1.0,0.0)) ); SkyboxVertex(-l, l,-l, 0, 0, 1, 1.0,0.0)) );
meshes.back()->mMaterialIndex = materials.size()-6u; meshes.back()->mMaterialIndex = static_cast<unsigned int>(materials.size()-6u);
// LEFT SIDE // LEFT SIDE
meshes.push_back( BuildSingleQuadMesh( meshes.push_back( BuildSingleQuadMesh(
@ -223,7 +223,7 @@ void IRRImporter::BuildSkybox(std::vector<aiMesh*>& meshes, std::vector<aiMateri
SkyboxVertex( l,-l, l, -1, 0, 0, 0.0,1.0), SkyboxVertex( l,-l, l, -1, 0, 0, 0.0,1.0),
SkyboxVertex( l, l, l, -1, 0, 0, 0.0,0.0), SkyboxVertex( l, l, l, -1, 0, 0, 0.0,0.0),
SkyboxVertex( l, l,-l, -1, 0, 0, 1.0,0.0)) ); SkyboxVertex( l, l,-l, -1, 0, 0, 1.0,0.0)) );
meshes.back()->mMaterialIndex = materials.size()-5u; meshes.back()->mMaterialIndex = static_cast<unsigned int>(materials.size()-5u);
// BACK SIDE // BACK SIDE
meshes.push_back( BuildSingleQuadMesh( meshes.push_back( BuildSingleQuadMesh(
@ -231,7 +231,7 @@ void IRRImporter::BuildSkybox(std::vector<aiMesh*>& meshes, std::vector<aiMateri
SkyboxVertex(-l,-l, l, 0, 0, -1, 0.0,1.0), SkyboxVertex(-l,-l, l, 0, 0, -1, 0.0,1.0),
SkyboxVertex(-l, l, l, 0, 0, -1, 0.0,0.0), SkyboxVertex(-l, l, l, 0, 0, -1, 0.0,0.0),
SkyboxVertex( l, l, l, 0, 0, -1, 1.0,0.0)) ); SkyboxVertex( l, l, l, 0, 0, -1, 1.0,0.0)) );
meshes.back()->mMaterialIndex = materials.size()-4u; meshes.back()->mMaterialIndex = static_cast<unsigned int>(materials.size()-4u);
// RIGHT SIDE // RIGHT SIDE
meshes.push_back( BuildSingleQuadMesh( meshes.push_back( BuildSingleQuadMesh(
@ -239,7 +239,7 @@ void IRRImporter::BuildSkybox(std::vector<aiMesh*>& meshes, std::vector<aiMateri
SkyboxVertex(-l,-l,-l, 1, 0, 0, 0.0,1.0), SkyboxVertex(-l,-l,-l, 1, 0, 0, 0.0,1.0),
SkyboxVertex(-l, l,-l, 1, 0, 0, 0.0,0.0), SkyboxVertex(-l, l,-l, 1, 0, 0, 0.0,0.0),
SkyboxVertex(-l, l, l, 1, 0, 0, 1.0,0.0)) ); SkyboxVertex(-l, l, l, 1, 0, 0, 1.0,0.0)) );
meshes.back()->mMaterialIndex = materials.size()-3u; meshes.back()->mMaterialIndex = static_cast<unsigned int>(materials.size()-3u);
// TOP SIDE // TOP SIDE
meshes.push_back( BuildSingleQuadMesh( meshes.push_back( BuildSingleQuadMesh(
@ -247,7 +247,7 @@ void IRRImporter::BuildSkybox(std::vector<aiMesh*>& meshes, std::vector<aiMateri
SkyboxVertex( l, l, l, 0, -1, 0, 0.0,1.0), SkyboxVertex( l, l, l, 0, -1, 0, 0.0,1.0),
SkyboxVertex(-l, l, l, 0, -1, 0, 0.0,0.0), SkyboxVertex(-l, l, l, 0, -1, 0, 0.0,0.0),
SkyboxVertex(-l, l,-l, 0, -1, 0, 1.0,0.0)) ); SkyboxVertex(-l, l,-l, 0, -1, 0, 1.0,0.0)) );
meshes.back()->mMaterialIndex = materials.size()-2u; meshes.back()->mMaterialIndex = static_cast<unsigned int>(materials.size()-2u);
// BOTTOM SIDE // BOTTOM SIDE
meshes.push_back( BuildSingleQuadMesh( meshes.push_back( BuildSingleQuadMesh(
@ -255,7 +255,7 @@ void IRRImporter::BuildSkybox(std::vector<aiMesh*>& meshes, std::vector<aiMateri
SkyboxVertex( l,-l,-l, 0, 1, 0, 1.0,0.0), SkyboxVertex( l,-l,-l, 0, 1, 0, 1.0,0.0),
SkyboxVertex(-l,-l,-l, 0, 1, 0, 1.0,1.0), SkyboxVertex(-l,-l,-l, 0, 1, 0, 1.0,1.0),
SkyboxVertex(-l,-l, l, 0, 1, 0, 0.0,1.0)) ); SkyboxVertex(-l,-l, l, 0, 1, 0, 0.0,1.0)) );
meshes.back()->mMaterialIndex = materials.size()-1u; meshes.back()->mMaterialIndex = static_cast<unsigned int>(materials.size()-1u);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -641,7 +641,7 @@ void SetupMapping (aiMaterial* mat, aiTextureMapping mode, const aiVector3D& axi
delete[] mat->mProperties; delete[] mat->mProperties;
mat->mProperties = new aiMaterialProperty*[p.size()*2]; mat->mProperties = new aiMaterialProperty*[p.size()*2];
mat->mNumAllocated = p.size()*2; mat->mNumAllocated = static_cast<unsigned int>(p.size()*2);
} }
mat->mNumProperties = (unsigned int)p.size(); mat->mNumProperties = (unsigned int)p.size();
::memcpy(mat->mProperties,&p[0],sizeof(void*)*mat->mNumProperties); ::memcpy(mat->mProperties,&p[0],sizeof(void*)*mat->mNumProperties);

View File

@ -92,7 +92,7 @@ public:
// Remove null characters from the input sequence otherwise the parsing will utterly fail // Remove null characters from the input sequence otherwise the parsing will utterly fail
unsigned int size = 0; unsigned int size = 0;
unsigned int size_max = data.size(); unsigned int size_max = static_cast<unsigned int>(data.size());
for(unsigned int i = 0; i < size_max; i++) { for(unsigned int i = 0; i < size_max; i++) {
if(data[i] != '\0') { if(data[i] != '\0') {
data[size++] = data[i]; data[size++] = data[i];
@ -117,7 +117,7 @@ public:
return 0; return 0;
} }
if(t+sizeToRead>data.size()) { if(t+sizeToRead>data.size()) {
sizeToRead = data.size()-t; sizeToRead = static_cast<int>(data.size()-t);
} }
memcpy(buffer,&data.front()+t,sizeToRead); memcpy(buffer,&data.front()+t,sizeToRead);