Ignore:
Timestamp:
06/02/15 20:56:15 (10 years ago)
Author:
epyon
Message:
  • more work on stl
  • fully working vectors!
  • copy & copy_n
  • removal of a lot of std code!
File:
1 edited

Legend:

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

    r376 r383  
    198198        md3->tags     = new md3_tag_t    [ md3->header.num_tags * md3->header.num_frames ];
    199199        md3->surfaces = new md3_surface_t[ md3->header.num_surfaces ];
    200         std::memset( md3->surfaces, 0, static_cast< nv::size_t >( md3->header.num_surfaces ) * sizeof( md3_surface_t ) );
     200        nv::raw_zero_n( md3->surfaces, static_cast< nv::size_t >( md3->header.num_surfaces ) );
    201201
    202202        source.seek( md3->header.ofs_frames, origin::SET );
     
    285285}
    286286
    287 nv::key_raw_channel* nv::md3_loader::load_tags( const std::string& tag )
     287nv::key_raw_channel* nv::md3_loader::load_tags( const string_ref& tag )
    288288{
    289289        md3_t* md3 = (md3_t*)m_md3;
     
    295295                {
    296296                        const md3_tag_t& rtag = md3->tags[i + md3->header.num_tags * f];
    297                         std::string rname((char*)(rtag.name));
     297                        string_ref rname((char*)(rtag.name));
    298298                        if (rname == tag)
    299299                        {
     
    421421        md3_t* md3 = (md3_t*)m_md3;
    422422        uint32 node_count = (uint32)md3->header.num_tags;
    423         if ( node_count == 0 ) return nullptr;;
     423        if ( node_count == 0 ) return nullptr;
    424424        mesh_node_data* nodes = new mesh_node_data[ node_count ];
    425425        for ( uint32 i = 0; i < node_count; ++i )
    426426        {
    427427                const md3_tag_t& rtag = md3->tags[i];
    428                 std::string name( (char*)(rtag.name) );
     428                string_ref name( (char*)(rtag.name) );
    429429
    430430                nodes[i].transform = mat4();
    431                 nodes[i].name      = name;
     431                nodes[i].name      = name.to_string();
    432432                nodes[i].parent_id = -1;
    433433                nodes[i].target_id = -1;
Note: See TracChangeset for help on using the changeset viewer.