Ignore:
Timestamp:
07/09/15 20:02:58 (10 years ago)
Author:
epyon
Message:
  • naming scheme for data_descriptor changed
  • channels can only be created by data_channel_creators
File:
1 edited

Legend:

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

    r413 r415  
    137137                        assert( m_type == MESH );
    138138                        mesh_data* mesh = new mesh_data("md5_mesh");
    139                         raw_data_channel* ch_pntiw = nullptr;
    140139
    141140                        uint32 num_verts   = 0;
     
    160159                                        md5_vtx_t* tdata = nullptr;
    161160                                        {
    162                                                 data_channel_creator<md5_vtx_pnt> ch_pnt( num_verts );
    163                                                 data_channel_creator<md5_vtx_t>   ch_t( num_verts );
    164                                                 ch_pntiw = raw_data_channel::create<md5_vtx_pntiw>( num_verts );
     161                                                data_channel_creator<md5_vtx_pnt>   ch_pnt( num_verts );
     162                                                data_channel_creator<md5_vtx_t>     ch_t( num_verts );
     163                                                data_channel_creator<md5_vtx_pntiw> ch_pntiw( num_verts );
    165164                                                tdata = ch_t.data();
    166165                                                mesh->add_channel( ch_pnt.release() );
     
    168167                                                // TODO: hack to prevent rendering
    169168                                                //ch_pntiw->m_count = 0;
    170                                                 mesh->add_channel( ch_pntiw );
     169                                                mesh->add_channel( ch_pntiw.release() );
    171170                                        }
    172171                                        weight_info.resize( num_verts );
     
    236235                        }
    237236
    238                         prepare_mesh( reinterpret_cast< md5_vtx_pntiw* >( const_cast< uint8* >( ch_pntiw->raw_data() ) ), nodes, weight_info.size(), mesh, weights.data(), weight_info.data() );
     237                        prepare_mesh( nodes, weight_info.size(), mesh, weights.data(), weight_info.data() );
    239238
    240239                        m_meshes[ num_meshes ] = mesh;
     
    258257                                nodes[i].target_id = -1;
    259258                                nodes[i].data      = new key_data;
    260                                 nodes[i].data->add_channel( raw_data_channel::create< md5_key_t >( num_frames ) );
     259                                data_channel_creator< md5_key_t > fc( num_frames );
     260                                nodes[i].data->add_channel( fc.release() );
    261261                                next_line( sstream );
    262262                        }
     
    335335}
    336336
    337 bool md5_loader::prepare_mesh( md5_vtx_pntiw* vtx_data, mesh_node_data* nodes, uint32 vtx_count, mesh_data* mdata, md5_weight* weights, md5_weight_info* weight_info )
     337bool md5_loader::prepare_mesh( mesh_node_data* nodes, uint32 vtx_count, mesh_data* mdata, md5_weight* weights, md5_weight_info* weight_info )
    338338{
    339339        assert( m_type == MESH );
    340         data_channel_creator< md5_vtx_pnt > pnt( const_cast< raw_data_channel* >( mdata->get_channel< md5_vtx_pnt >() ) );
    341         md5_vtx_pnt* vtcs       = pnt.data();
     340        data_channel_creator< md5_vtx_pnt >   pnt  ( const_cast< raw_data_channel* >( mdata->get_channel< md5_vtx_pnt >() ) );
     341        data_channel_creator< md5_vtx_pntiw > pntiw( const_cast< raw_data_channel* >( mdata->get_channel< md5_vtx_pntiw >() ) );
     342        md5_vtx_pntiw* vtx_data = pntiw.data();
     343        md5_vtx_pnt* vtcs = pnt.data();
    342344
    343345        for ( uint32 i = 0; i < vtx_count; ++i )
     
    488490                        const transform* ptv = reinterpret_cast< const transform* >( pjoint.data->get_channel(0)->raw_data() );
    489491                        transform ptr;
    490                         if ( pjoint.data->get_channel(0)->element_count() > index ) ptr = ptv[ index ];
     492                        if ( pjoint.data->get_channel(0)->size() > index ) ptr = ptv[ index ];
    491493                        vec3 rot_pos = ptr.get_orientation() * pos;
    492494
Note: See TracChangeset for help on using the changeset viewer.