Changeset 480 for trunk/src/formats/nmd_loader.cc
- Timestamp:
- 11/03/15 19:06:23 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/formats/nmd_loader.cc
r475 r480 50 50 } 51 51 52 mesh_data_pack* nv::nmd_loader::release_mesh_data_pack()53 {54 uint32 size = m_meshes.size();55 data_channel_set* meshes = data_channel_set_creator::create_set_array( size, 0 );56 for ( uint32 i = 0; i < size; ++i )57 {58 meshes[i] = move( *m_meshes[i] );59 delete m_meshes[i];60 }61 m_meshes.clear();62 return new mesh_data_pack( size, meshes, release_mesh_nodes_data() );63 }64 65 52 void nv::nmd_loader::reset() 66 53 { … … 240 227 } 241 228 242 void nv::nmd_dump( stream& stream_out, const mesh_data_pack* model, const string_table* strings, uint64 name)229 void nv::nmd_dump( stream& stream_out, array_view< data_channel_set* > meshes, const mesh_nodes_data* nodes, const string_table* strings /*= nullptr*/, uint64 name /*= 0 */ ) 243 230 { 244 231 uint32 elements = ( strings ? 1 : 0 ) // +1 string array 245 + m odel->get_count() // meshes246 + ( model->get_node_count() > 0 ? 1 : 0 ); // nodes232 + meshes.size() // meshes 233 + ( nodes && nodes->size() > 0 ? 1 : 0 ); // nodes 247 234 nmd_dump_header( stream_out, elements, name ); 248 235 249 for ( uint32 i = 0; i < model->get_count(); ++i ) 250 { 251 nmd_dump_element( stream_out, *model->get_mesh( i ), nv::nmd_type::MESH ); 252 } 253 254 if ( model->get_node_count() > 0 ) 255 { 256 nmd_dump_nodes( stream_out, *model->get_nodes() ); 236 for ( uint32 i = 0; i < meshes.size(); ++i ) 237 { 238 NV_ASSERT( meshes[i], "mesh is null!" ); 239 nmd_dump_element( stream_out, *meshes[i], nv::nmd_type::MESH ); 240 } 241 242 if ( nodes && nodes->size() > 0 ) 243 { 244 nmd_dump_nodes( stream_out, *nodes ); 257 245 } 258 246 … … 262 250 } 263 251 } 252 253 void nv::nmd_dump( stream& stream_out, const mesh_nodes_data& animation, const string_table* strings, uint64 name ) 254 { 255 uint32 elements = ( strings ? 1 : 0 ) // +1 string array 256 + ( animation.size() > 0 ? 1 : 0 ); // nodes 257 nmd_dump_header( stream_out, elements, name ); 258 259 if ( animation.size() > 0 ) 260 { 261 nmd_dump_nodes( stream_out, animation ); 262 } 263 264 if ( strings ) 265 { 266 nmd_dump_strings( stream_out, *strings ); 267 } 268 }
Note: See TracChangeset
for help on using the changeset viewer.