Changeset 487 for trunk/src/formats
- Timestamp:
- 03/08/16 08:05:51 (9 years ago)
- Location:
- trunk/src/formats
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/formats/assimp_loader.cc
r486 r487 215 215 { 216 216 aiBone* bone = mesh->mBones[m]; 217 for ( unsigned int w=0; w<bone->mNumWeights; w++)217 for ( size_t w=0; w<bone->mNumWeights; w++) 218 218 { 219 219 assimp_skinned_vtx& v = vtx[ bone->mWeights[w].mVertexId ]; 220 220 bool found = false; 221 for ( int i = 0 ; i < 4; ++i )221 for ( size_t i = 0 ; i < 4; ++i ) 222 222 { 223 223 if ( v.boneweight[i] <= 0.0f ) … … 409 409 { 410 410 assimp_skinned_vtx& vertex = channel.data()[v]; 411 for ( int i = 0; i < 4; ++i )411 for ( size_t i = 0; i < 4; ++i ) 412 412 { 413 413 if ( vertex.boneweight[i] > 0.0f ) … … 429 429 mat4 tr = nv::math::inverse( assimp_mat4_cast( m_data->node_by_name[bone_data[i].name]->mTransformation ) ); 430 430 int pid = bone_data[i].parent_id; 431 if ( pid != -1)432 bone_data[i].transform = tr * bone_data[ pid].transform;431 if ( pid >= 0 ) 432 bone_data[i].transform = tr * bone_data[ size_t( pid ) ].transform; 433 433 else 434 434 bone_data[i].transform = tr; … … 492 492 { 493 493 int this_is_incorrect; 494 return m_mesh_count == 0 || m_data->scene->mNumAnimations > 0 && m_data->skeletons.size() == 0; 495 } 496 497 int indent = 0; 494 return m_mesh_count == 0 || ( m_data->scene->mNumAnimations > 0 && m_data->skeletons.size() == 0 ); 495 } 498 496 499 497 void nv::assimp_loader::scan_nodes( const void* node ) const … … 537 535 transform t = nv::transform( nv::assimp_mat4_cast( node->mTransformation ) ); 538 536 539 nodes[ this_id ] = anode ? create_keys( anode, t ) : data_channel_set_creator::create_set( 0 ); 540 541 infos[this_id].name = make_name( name ); 542 infos[this_id].parent_id = parent_id; 537 nodes[ uint32( this_id ) ] = anode ? create_keys( anode, t ) : data_channel_set_creator::create_set( 0 ); 538 infos[ uint32( this_id ) ].name = make_name( name ); 539 infos[ uint32( this_id ) ].parent_id = parent_id; 543 540 // This value is ignored by the create_transformed_keys, but needed by create_direct_keys! 544 541 // TODO: find a common solution! -
trunk/src/formats/nmd_loader.cc
r486 r487 66 66 { 67 67 if ( count == 0 ) return; 68 source.seek( count * sizeof( nmd_attribute), origin::CUR );68 source.seek( long( count * sizeof( nmd_attribute ) ), origin::CUR ); 69 69 } 70 70 … … 220 220 void nv::nmd_dump_bones( stream& stream_out, const data_node_list& nodes ) 221 221 { 222 uint32 total = sizeof( nmd_animation_header ); 223 for ( auto node : nodes ) 224 { 225 total += sizeof( nmd_element_header ); 226 } 222 uint32 total = sizeof( nmd_animation_header ) + sizeof( nmd_element_header ) * nodes.size(); 227 223 228 224 nmd_element_header header;
Note: See TracChangeset
for help on using the changeset viewer.