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

pull/1083/head
Jared Mulconry 2016-11-19 01:21:59 +11:00
parent a2dadbbe52
commit bf5fc593eb
1 changed files with 16 additions and 16 deletions

View File

@ -331,7 +331,7 @@ void B3DImporter::ReadVRTS(){
int sz=12+(_vflags&1?12:0)+(_vflags&2?16:0)+(_tcsets*_tcsize*4); int sz=12+(_vflags&1?12:0)+(_vflags&2?16:0)+(_tcsets*_tcsize*4);
int n_verts=ChunkSize()/sz; int n_verts=ChunkSize()/sz;
int v0=_vertices.size(); int v0=static_cast<int>(_vertices.size());
_vertices.resize( v0+n_verts ); _vertices.resize( v0+n_verts );
for( int i=0;i<n_verts;++i ){ for( int i=0;i<n_verts;++i ){
@ -404,7 +404,7 @@ void B3DImporter::ReadTRIS( int v0 ){
void B3DImporter::ReadMESH(){ void B3DImporter::ReadMESH(){
/*int matid=*/ReadInt(); /*int matid=*/ReadInt();
int v0=_vertices.size(); int v0= static_cast<int>(_vertices.size());
while( ChunkSize() ){ while( ChunkSize() ){
string t=ReadChunk(); string t=ReadChunk();
@ -462,17 +462,17 @@ void B3DImporter::ReadKEYS( aiNodeAnim *nodeAnim ){
} }
if( flags & 1 ){ if( flags & 1 ){
nodeAnim->mNumPositionKeys=trans.size(); nodeAnim->mNumPositionKeys=static_cast<unsigned int>(trans.size());
nodeAnim->mPositionKeys=to_array( trans ); nodeAnim->mPositionKeys=to_array( trans );
} }
if( flags & 2 ){ if( flags & 2 ){
nodeAnim->mNumScalingKeys=scale.size(); nodeAnim->mNumScalingKeys=static_cast<unsigned int>(scale.size());
nodeAnim->mScalingKeys=to_array( scale ); nodeAnim->mScalingKeys=to_array( scale );
} }
if( flags & 4 ){ if( flags & 4 ){
nodeAnim->mNumRotationKeys=rot.size(); nodeAnim->mNumRotationKeys=static_cast<unsigned int>(rot.size());
nodeAnim->mRotationKeys=to_array( rot ); nodeAnim->mRotationKeys=to_array( rot );
} }
} }
@ -506,7 +506,7 @@ aiNode *B3DImporter::ReadNODE( aiNode *parent ){
aiMatrix4x4 tform=trans * rot * scale; aiMatrix4x4 tform=trans * rot * scale;
int nodeid=_nodes.size(); int nodeid=static_cast<int>(_nodes.size());
aiNode *node=new aiNode( name ); aiNode *node=new aiNode( name );
_nodes.push_back( node ); _nodes.push_back( node );
@ -521,9 +521,9 @@ aiNode *B3DImporter::ReadNODE( aiNode *parent ){
while( ChunkSize() ){ while( ChunkSize() ){
string t=ReadChunk(); string t=ReadChunk();
if( t=="MESH" ){ if( t=="MESH" ){
int n=_meshes.size(); unsigned int n= static_cast<unsigned int>(_meshes.size());
ReadMESH(); ReadMESH();
for( int i=n;i<(int)_meshes.size();++i ){ for( unsigned int i=n;i<static_cast<unsigned int>(_meshes.size());++i ){
meshes.push_back( i ); meshes.push_back( i );
} }
}else if( t=="BONE" ){ }else if( t=="BONE" ){
@ -544,10 +544,10 @@ aiNode *B3DImporter::ReadNODE( aiNode *parent ){
ExitChunk(); ExitChunk();
} }
node->mNumMeshes=meshes.size(); node->mNumMeshes= static_cast<unsigned int>(meshes.size());
node->mMeshes=to_array( meshes ); node->mMeshes=to_array( meshes );
node->mNumChildren=children.size(); node->mNumChildren=static_cast<unsigned int>(children.size());
node->mChildren=to_array( children ); node->mChildren=to_array( children );
return node; return node;
@ -645,7 +645,7 @@ void B3DImporter::ReadBB3D( aiScene *scene ){
aiNode *bnode=_nodes[i]; aiNode *bnode=_nodes[i];
bone->mName=bnode->mName; bone->mName=bnode->mName;
bone->mNumWeights=weights.size(); bone->mNumWeights= static_cast<unsigned int>(weights.size());
bone->mWeights=to_array( weights ); bone->mWeights=to_array( weights );
aiMatrix4x4 mat=bnode->mTransformation; aiMatrix4x4 mat=bnode->mTransformation;
@ -655,7 +655,7 @@ void B3DImporter::ReadBB3D( aiScene *scene ){
} }
bone->mOffsetMatrix=mat.Inverse(); bone->mOffsetMatrix=mat.Inverse();
} }
mesh->mNumBones=bones.size(); mesh->mNumBones= static_cast<unsigned int>(bones.size());
mesh->mBones=to_array( bones ); mesh->mBones=to_array( bones );
} }
} }
@ -667,21 +667,21 @@ void B3DImporter::ReadBB3D( aiScene *scene ){
if( !_materials.size() ){ if( !_materials.size() ){
_materials.push_back( new aiMaterial ); _materials.push_back( new aiMaterial );
} }
scene->mNumMaterials=_materials.size(); scene->mNumMaterials= static_cast<unsigned int>(_materials.size());
scene->mMaterials=to_array( _materials ); scene->mMaterials=to_array( _materials );
//meshes //meshes
scene->mNumMeshes=_meshes.size(); scene->mNumMeshes= static_cast<unsigned int>(_meshes.size());
scene->mMeshes=to_array( _meshes ); scene->mMeshes=to_array( _meshes );
//animations //animations
if( _animations.size()==1 && _nodeAnims.size() ){ if( _animations.size()==1 && _nodeAnims.size() ){
aiAnimation *anim=_animations.back(); aiAnimation *anim=_animations.back();
anim->mNumChannels=_nodeAnims.size(); anim->mNumChannels=static_cast<unsigned int>(_nodeAnims.size());
anim->mChannels=to_array( _nodeAnims ); anim->mChannels=to_array( _nodeAnims );
scene->mNumAnimations=_animations.size(); scene->mNumAnimations=static_cast<unsigned int>(_animations.size());
scene->mAnimations=to_array( _animations ); scene->mAnimations=to_array( _animations );
} }