Ignore:
Timestamp:
06/20/15 00:05:17 (10 years ago)
Author:
epyon
Message:
  • code compiles cleanly on maximum warning level
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/formats/md5_loader.cc

    r401 r406  
    162162                                                mesh_raw_channel* ch_t   = mesh_raw_channel::create<md5_vtx_t>( num_verts );
    163163                                                mesh_raw_channel* ch_pntiw = mesh_raw_channel::create<md5_vtx_pntiw>( num_verts );
    164                                                 tdata = (md5_vtx_t*)ch_t->data;
     164                                                tdata = reinterpret_cast< md5_vtx_t* >( ch_t->data );
    165165                                                mesh->add_channel( ch_pnt );
    166166                                                mesh->add_channel( ch_t );
     
    191191
    192192                                        mesh_raw_channel* ch_i = mesh_raw_channel::create_index<uint32>( num_tris * 3 );
    193                                         uint32* vtx_i                = (uint32*)ch_i->data;
     193                                        uint32* vtx_i                = reinterpret_cast< uint32* >( ch_i->data );
    194194                                        uint32 idx = 0;
    195195                                        mesh->add_channel( ch_i );
     
    199199                                        for ( uint32 i = 0; i < num_tris; ++i )
    200200                                        {
    201                                                 size_t ti0;
    202                                                 size_t ti1;
    203                                                 size_t ti2;
     201                                                unsigned ti0;
     202                                                unsigned ti1;
     203                                                unsigned ti2;
    204204
    205205                                                std::getline( sstream, line );
    206206                                                sscanf( line.c_str(), "%*s %*u %u %u %u )", &(ti0), &(ti1), &(ti2));
    207207
    208                                                 vtx_i[idx++] = (uint32)ti0;
    209                                                 vtx_i[idx++] = (uint32)ti1;
    210                                                 vtx_i[idx++] = (uint32)ti2;
     208                                                vtx_i[idx++] = ti0;
     209                                                vtx_i[idx++] = ti1;
     210                                                vtx_i[idx++] = ti2;
    211211                                        }             
    212212                                }
     
    244244                        assert( nodes == nullptr );
    245245                        nodes = new mesh_node_data[ num_joints ];
    246                         m_nodes = new mesh_nodes_data( "md5_animation", num_joints, nodes, (nv::uint16)frame_rate, (float)num_frames, true );
     246                        m_nodes = new mesh_nodes_data( "md5_animation", num_joints, nodes, static_cast< nv::uint16 >( frame_rate ), static_cast< float >( num_frames ), true );
    247247                        joint_infos.resize( num_joints );
    248248
     
    318318                        {
    319319                                sstream >> buf;
    320                                 frame.push_back((float)atof(buf));
     320                                frame.push_back( static_cast< float >( atof(buf) ) );
    321321                        }
    322322
     
    336336{
    337337        assert( m_type == MESH );
    338         md5_vtx_pnt* vtcs = (md5_vtx_pnt*)mdata->get_channel< md5_vtx_pnt >()->data;
    339         md5_vtx_pntiw* vtx_data = (md5_vtx_pntiw*)mdata->get_channel< md5_vtx_pntiw >()->data;
     338        md5_vtx_pnt* vtcs       = reinterpret_cast< md5_vtx_pnt* >( mdata->get_channel< md5_vtx_pnt >()->data );
     339        md5_vtx_pntiw* vtx_data = reinterpret_cast< md5_vtx_pntiw* >( mdata->get_channel< md5_vtx_pntiw >()->data );
    340340
    341341        for ( uint32 i = 0; i < vtx_count; ++i )
     
    368368                }
    369369
    370                 for ( size_t j = 0; j < 4; ++j )
    371                 {
    372                         if ( j < weight_count )
    373                         {
    374                                 vdata.boneindex[j]  = (int)weights[start_weight + j].joint_id;
    375                                 vdata.boneweight[j] = weights[start_weight + j].bias;
     370                for ( int j = 0; j < 4; ++j )
     371                {
     372                        if ( j < int(weight_count) )
     373                        {
     374                                vdata.boneindex[j]  = int( weights[int(start_weight) + j].joint_id );
     375                                vdata.boneweight[j] = weights[int(start_weight) + j].bias;
    376376                        }
    377377                        else
     
    396396        }
    397397
    398         const uint32*    idata = (uint32*)mdata->get_index_channel()->data;
     398        const uint32*    idata = reinterpret_cast< uint32* >( mdata->get_index_channel()->data );
    399399        const md5_vtx_t* tdata = mdata->get_channel_data<md5_vtx_t>();
    400400
     
    448448                vdata.tangent  = vec3(0);
    449449 
    450                 for ( size_t j = 0; j < 4; ++j )
     450                for ( int j = 0; j < 4; ++j )
    451451                {
    452452                        const mesh_node_data&  joint = nodes[vdata.boneindex[j]];
     
    484484                {
    485485                        const mesh_node_data& pjoint = nodes[parent_id];
    486                         const transform* ptv = (const transform*)pjoint.data->get_channel(0)->data;
     486                        const transform* ptv = reinterpret_cast< const transform* >( pjoint.data->get_channel(0)->data );
    487487                        transform ptr;
    488488                        if ( pjoint.data->get_channel(0)->count > index ) ptr = ptv[ index ];
     
    495495                }
    496496
    497                 ((transform*)joint.data->get_channel(0)->data)[index] = transform( pos, orient );
     497                reinterpret_cast< transform* >( joint.data->get_channel(0)->data )[index] = transform( pos, orient );
    498498        }
    499499}
Note: See TracChangeset for help on using the changeset viewer.