Fixed build warnings on MSVC14 x64 in the write dumb source.

pull/1083/head
Jared Mulconry 2016-11-27 15:16:19 +11:00
parent f22d78a3d3
commit dc3f265803
1 changed files with 14 additions and 14 deletions

View File

@ -292,14 +292,14 @@ uint32_t WriteBinaryTexture(const aiTexture* tex)
len += Write<unsigned int>(tex->mWidth);
len += Write<unsigned int>(tex->mHeight);
len += fwrite(tex->achFormatHint,1,4,out);
len += static_cast<uint32_t>(fwrite(tex->achFormatHint,1,4,out));
if(!shortened) {
if (!tex->mHeight) {
len += fwrite(tex->pcData,1,tex->mWidth,out);
len += static_cast<uint32_t>(fwrite(tex->pcData,1,tex->mWidth,out));
}
else {
len += fwrite(tex->pcData,1,tex->mWidth*tex->mHeight*4,out);
len += static_cast<uint32_t>(fwrite(tex->pcData,1,tex->mWidth*tex->mHeight*4,out));
}
}
@ -321,7 +321,7 @@ uint32_t WriteBinaryBone(const aiBone* b)
if (shortened) {
len += WriteBounds(b->mWeights,b->mNumWeights);
} // else write as usual
else len += fwrite(b->mWeights,1,b->mNumWeights*sizeof(aiVertexWeight),out);
else len += static_cast<uint32_t>(fwrite(b->mWeights,1,b->mNumWeights*sizeof(aiVertexWeight),out));
ChangeInteger(old,len);
return len;
@ -368,13 +368,13 @@ uint32_t WriteBinaryMesh(const aiMesh* mesh)
if (shortened) {
len += WriteBounds(mesh->mVertices,mesh->mNumVertices);
} // else write as usual
else len += fwrite(mesh->mVertices,1,12*mesh->mNumVertices,out);
else len += static_cast<uint32_t>(fwrite(mesh->mVertices,1,12*mesh->mNumVertices,out));
}
if (mesh->mNormals) {
if (shortened) {
len += WriteBounds(mesh->mNormals,mesh->mNumVertices);
} // else write as usual
else len += fwrite(mesh->mNormals,1,12*mesh->mNumVertices,out);
else len += static_cast<uint32_t>(fwrite(mesh->mNormals,1,12*mesh->mNumVertices,out));
}
if (mesh->mTangents && mesh->mBitangents) {
if (shortened) {
@ -382,8 +382,8 @@ uint32_t WriteBinaryMesh(const aiMesh* mesh)
len += WriteBounds(mesh->mBitangents,mesh->mNumVertices);
} // else write as usual
else {
len += fwrite(mesh->mTangents,1,12*mesh->mNumVertices,out);
len += fwrite(mesh->mBitangents,1,12*mesh->mNumVertices,out);
len += static_cast<uint32_t>(fwrite(mesh->mTangents,1,12*mesh->mNumVertices,out));
len += static_cast<uint32_t>(fwrite(mesh->mBitangents,1,12*mesh->mNumVertices,out));
}
}
for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) {
@ -393,7 +393,7 @@ uint32_t WriteBinaryMesh(const aiMesh* mesh)
if (shortened) {
len += WriteBounds(mesh->mColors[n],mesh->mNumVertices);
} // else write as usual
else len += fwrite(mesh->mColors[n],16*mesh->mNumVertices,1,out);
else len += static_cast<uint32_t>(fwrite(mesh->mColors[n],16*mesh->mNumVertices,1,out));
}
for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) {
if (!mesh->mTextureCoords[n])
@ -405,7 +405,7 @@ uint32_t WriteBinaryMesh(const aiMesh* mesh)
if (shortened) {
len += WriteBounds(mesh->mTextureCoords[n],mesh->mNumVertices);
} // else write as usual
else len += fwrite(mesh->mTextureCoords[n],12*mesh->mNumVertices,1,out);
else len += static_cast<uint32_t>(fwrite(mesh->mTextureCoords[n],12*mesh->mNumVertices,1,out));
}
// write faces. There are no floating-point calculations involved
@ -472,7 +472,7 @@ uint32_t WriteBinaryMaterialProperty(const aiMaterialProperty* prop)
len += Write<unsigned int>(prop->mDataLength);
len += Write<unsigned int>((unsigned int)prop->mType);
len += fwrite(prop->mData,1,prop->mDataLength,out);
len += static_cast<uint32_t>(fwrite(prop->mData,1,prop->mDataLength,out));
ChangeInteger(old,len);
return len;
@ -509,21 +509,21 @@ uint32_t WriteBinaryNodeAnim(const aiNodeAnim* nd)
len += WriteBounds(nd->mPositionKeys,nd->mNumPositionKeys);
} // else write as usual
else len += fwrite(nd->mPositionKeys,1,nd->mNumPositionKeys*sizeof(aiVectorKey),out);
else len += static_cast<uint32_t>(fwrite(nd->mPositionKeys,1,nd->mNumPositionKeys*sizeof(aiVectorKey),out));
}
if (nd->mRotationKeys) {
if (shortened) {
len += WriteBounds(nd->mRotationKeys,nd->mNumRotationKeys);
} // else write as usual
else len += fwrite(nd->mRotationKeys,1,nd->mNumRotationKeys*sizeof(aiQuatKey),out);
else len += static_cast<uint32_t>(fwrite(nd->mRotationKeys,1,nd->mNumRotationKeys*sizeof(aiQuatKey),out));
}
if (nd->mScalingKeys) {
if (shortened) {
len += WriteBounds(nd->mScalingKeys,nd->mNumScalingKeys);
} // else write as usual
else len += fwrite(nd->mScalingKeys,1,nd->mNumScalingKeys*sizeof(aiVectorKey),out);
else len += static_cast<uint32_t>(fwrite(nd->mScalingKeys,1,nd->mNumScalingKeys*sizeof(aiVectorKey),out));
}
ChangeInteger(old,len);