Changeset 153 for trunk/src/formats


Ignore:
Timestamp:
07/08/13 17:22:08 (12 years ago)
Author:
epyon
Message:
  • device & vertex_buffer - void* of data made const for const correctness
  • md3_loader - added keyframed_mesh class
File:
1 edited

Legend:

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

    r149 r153  
    351351}
    352352
    353 sint32 nv::md3_loader::get_max_frames() const
     353sint32 md3_loader::get_max_frames() const
    354354{
    355355        return ((md3_t*)m_md3)->header.num_frames;
     356}
     357
     358void md3_loader::load_tag_names( std::vector< std::string >& tags )
     359{
     360        tags.clear();
     361        md3_t* md3 = (md3_t*)m_md3;
     362        for ( sint32 i = 0; i < md3->header.num_tags; ++i )
     363        {
     364                const md3_tag_t& rtag = md3->tags[i + md3->header.num_tags];
     365                tags.push_back( (char*)(rtag.name) );
     366        }
    356367}
    357368
     
    480491
    481492}
     493
     494keyframed_mesh::keyframed_mesh( md3_loader* loader )
     495{
     496        loader->load_positions( m_positions );
     497        loader->load_normals( m_normals );
     498        loader->load_texcoords( m_texcoords );
     499        loader->load_indicies( m_indices );
     500
     501        std::vector< std::string > names;
     502        loader->load_tag_names( names );
     503        for ( auto& name : names )
     504        {
     505                loader->load_tags( m_tags[ name ], name );
     506        }
     507
     508        m_frames = loader->get_max_frames();
     509}
     510
Note: See TracChangeset for help on using the changeset viewer.