- Timestamp:
- 07/08/14 18:29:24 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/formats/assimp_loader.cc
r279 r280 143 143 } 144 144 145 mesh_raw_ index_channel* ichannel = mesh_raw_index_channel::create( USHORT, mesh->mNumFaces * 3 );146 result-> set_index_channel( ichannel );145 mesh_raw_channel* ichannel = mesh_raw_channel::create_index( USHORT, mesh->mNumFaces * 3 ); 146 result->add_channel( ichannel ); 147 147 uint16* indices = (uint16*)ichannel->data; 148 148 for (unsigned int i=0; i<mesh->mNumFaces; i++) … … 294 294 { 295 295 mesh_data* mesh = model->meshes[m]; 296 mesh_raw_channel* channel = mesh->get_channel_data()[0]; 296 mesh_raw_channel* channel = mesh->get_raw_channels()[0]; 297 NV_ASSERT( !channel->is_index(), "index channel in release_merged!" ); 297 298 assimp_skinned_vtx* va = (assimp_skinned_vtx*)channel->data; 298 299 for ( unsigned v = 0; v < channel->count; ++v ) -
trunk/src/formats/md2_loader.cc
r240 r280 359 359 } 360 360 361 mesh_raw_ index_channel* ic = mesh_raw_index_channel::create< uint16 >( m_new_indexes.size() );361 mesh_raw_channel* ic = mesh_raw_channel::create_index< uint16 >( m_new_indexes.size() ); 362 362 if ( m_new_indexes.size() > 0 ) 363 363 { … … 369 369 result->add_channel( mc_pn ); 370 370 result->add_channel( mc_t ); 371 result-> set_index_channel( ic );371 result->add_channel( ic ); 372 372 return result; 373 373 } -
trunk/src/formats/md3_loader.cc
r241 r280 377 377 index = 0; 378 378 sint32 index_base = 0; 379 mesh_raw_ index_channel* ic = mesh_raw_index_channel::create< uint16 >( index_count );379 mesh_raw_channel* ic = mesh_raw_channel::create_index< uint16 >( index_count ); 380 380 uint16* icp = (uint16*)ic->data; 381 381 for ( sint32 i = 0; i < num_surfaces; ++i ) … … 396 396 result->add_channel( mc_pn ); 397 397 result->add_channel( mc_t ); 398 result-> set_index_channel( ic );398 result->add_channel( ic ); 399 399 return result; 400 400 } -
trunk/src/formats/md5_loader.cc
r261 r280 145 145 sstream >> num_tris; 146 146 147 mesh_raw_ index_channel* ch_i = mesh_raw_index_channel::create<uint32>( num_tris * 3 );147 mesh_raw_channel* ch_i = mesh_raw_channel::create_index<uint32>( num_tris * 3 ); 148 148 uint32* vtx_i = (uint32*)ch_i->data; 149 149 mesh->m_idata = vtx_i; 150 150 uint32 idx = 0; 151 mesh-> set_index_channel( ch_i );151 mesh->add_channel( ch_i ); 152 152 153 153 next_line( sstream ); -
trunk/src/formats/obj_loader.cc
r240 r280 334 334 channel->desc = m_descriptor; 335 335 channel->count = reader->size * 3; 336 channel->size = reader->raw_size();337 336 338 337 mesh_data* mesh = new mesh_data(); -
trunk/src/gfx/keyframed_mesh.cc
r275 r280 32 32 33 33 m_index_count = m_mesh_data->get_index_channel()->count; 34 m_vertex_count = m_mesh_data->get_channel _data()[1]->count;35 m_frame_count = m_mesh_data->get_channel _data()[0]->count / m_vertex_count;34 m_vertex_count = m_mesh_data->get_channel<vertex_t>()->count; 35 m_frame_count = m_mesh_data->get_channel<vertex_pn>()->count / m_vertex_count; 36 36 } 37 37 … … 167 167 : keyframed_mesh( a_device, a_data, a_tag_map ) 168 168 { 169 m_vb = a_device->create_vertex_buffer( nv::STATIC_DRAW, m_vertex_count * sizeof( vertex_pn ), (void*)m_mesh_data->get_channel _data()[0]->data );170 m_va->add_vertex_buffers( m_vb, m_mesh_data->get_channel _data()[0]);169 m_vb = a_device->create_vertex_buffer( nv::STATIC_DRAW, m_vertex_count * sizeof( vertex_pn ), (void*)m_mesh_data->get_channel<vertex_pn>()->data ); 170 m_va->add_vertex_buffers( m_vb, m_mesh_data->get_channel<vertex_pn>() ); 171 171 172 nv::vertex_buffer* vb = a_device->create_vertex_buffer( nv::STATIC_DRAW, m_vertex_count * sizeof( nv::vec2 ), (void*)m_mesh_data->get_channel _data()[1]->data );173 m_va->add_vertex_buffers( vb, m_mesh_data->get_channel _data()[1]);172 nv::vertex_buffer* vb = a_device->create_vertex_buffer( nv::STATIC_DRAW, m_vertex_count * sizeof( nv::vec2 ), (void*)m_mesh_data->get_channel<vertex_t>()->data ); 173 m_va->add_vertex_buffers( vb, m_mesh_data->get_channel<vertex_t>() ); 174 174 175 nv::index_buffer* ib = a_device->create_index_buffer( nv::STATIC_DRAW, m_mesh_data->get_index_channel()->size , (void*)m_mesh_data->get_index_channel()->data );176 m_va->set_index_buffer( ib, m_mesh_data->get_index_channel()-> etype, true );175 nv::index_buffer* ib = a_device->create_index_buffer( nv::STATIC_DRAW, m_mesh_data->get_index_channel()->size(), (void*)m_mesh_data->get_index_channel()->data ); 176 m_va->set_index_buffer( ib, m_mesh_data->get_index_channel()->desc.slots[0].etype, true ); 177 177 178 178 m_vertex.resize( m_vertex_count ); … … 183 183 keyframed_mesh::update( ms ); 184 184 185 const vertex_pn* data = (const vertex_pn*)(m_mesh_data->get_channel_data()[0]->data);185 const vertex_pn* data = m_mesh_data->get_channel_data<vertex_pn>(); 186 186 const vertex_pn* prev = data + m_vertex_count * m_last_frame; 187 187 const vertex_pn* next = data + m_vertex_count * m_next_frame;
Note: See TracChangeset
for help on using the changeset viewer.