Changeset 415 for trunk/src/formats/md5_loader.cc
- Timestamp:
- 07/09/15 20:02:58 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/formats/md5_loader.cc
r413 r415 137 137 assert( m_type == MESH ); 138 138 mesh_data* mesh = new mesh_data("md5_mesh"); 139 raw_data_channel* ch_pntiw = nullptr;140 139 141 140 uint32 num_verts = 0; … … 160 159 md5_vtx_t* tdata = nullptr; 161 160 { 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 ); 165 164 tdata = ch_t.data(); 166 165 mesh->add_channel( ch_pnt.release() ); … … 168 167 // TODO: hack to prevent rendering 169 168 //ch_pntiw->m_count = 0; 170 mesh->add_channel( ch_pntiw );169 mesh->add_channel( ch_pntiw.release() ); 171 170 } 172 171 weight_info.resize( num_verts ); … … 236 235 } 237 236 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() ); 239 238 240 239 m_meshes[ num_meshes ] = mesh; … … 258 257 nodes[i].target_id = -1; 259 258 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() ); 261 261 next_line( sstream ); 262 262 } … … 335 335 } 336 336 337 bool md5_loader::prepare_mesh( m d5_vtx_pntiw* vtx_data, mesh_node_data* nodes, uint32 vtx_count, mesh_data* mdata, md5_weight* weights, md5_weight_info* weight_info )337 bool md5_loader::prepare_mesh( mesh_node_data* nodes, uint32 vtx_count, mesh_data* mdata, md5_weight* weights, md5_weight_info* weight_info ) 338 338 { 339 339 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(); 342 344 343 345 for ( uint32 i = 0; i < vtx_count; ++i ) … … 488 490 const transform* ptv = reinterpret_cast< const transform* >( pjoint.data->get_channel(0)->raw_data() ); 489 491 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 ]; 491 493 vec3 rot_pos = ptr.get_orientation() * pos; 492 494
Note: See TracChangeset
for help on using the changeset viewer.