Changeset 411 for trunk/src/formats


Ignore:
Timestamp:
07/09/15 12:19:30 (10 years ago)
Author:
epyon
Message:
  • mesh_raw_channel and key_raw_channel merged into raw_data_channel
Location:
trunk/src/formats
Files:
6 edited

Legend:

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

    r410 r411  
    118118
    119119        bool skinned = mesh->mNumBones > 0;
    120         mesh_raw_channel* channel = nullptr;
     120        raw_data_channel* channel = nullptr;
    121121        if ( skinned )
    122                 channel = mesh_raw_channel::create< assimp_skinned_vtx >( mesh->mNumVertices );
     122                channel = raw_data_channel::create< assimp_skinned_vtx >( mesh->mNumVertices );
    123123        else
    124                 channel = mesh_raw_channel::create< assimp_plain_vtx >( mesh->mNumVertices );
     124                channel = raw_data_channel::create< assimp_plain_vtx >( mesh->mNumVertices );
    125125
    126126        data->add_channel( channel );
     
    169169        }
    170170
    171         mesh_raw_channel* ichannel = mesh_raw_channel::create_index( USHORT, mesh->mNumFaces * 3 );
     171        raw_data_channel* ichannel = raw_data_channel::create_index( USHORT, mesh->mNumFaces * 3 );
    172172        data->add_channel( ichannel );
    173173        uint16* indices = reinterpret_cast<uint16*>( ichannel->data );
     
    315315                        if ( m > 0 && bones.size() > 0 )
    316316                        {
    317                                 mesh_raw_channel* channel = meshes[m].get_raw_channels()[0];
     317                                raw_data_channel* channel = meshes[m].get_raw_channels()[0];
    318318                                assimp_skinned_vtx* va = reinterpret_cast< assimp_skinned_vtx* >( channel->data );
    319319                                for ( unsigned v = 0; v < channel->count; ++v )
     
    418418
    419419        data->data = new key_data;
    420         key_raw_channel* raw_pchannel = key_raw_channel::create<assimp_key_p>( node->mNumPositionKeys );
    421         key_raw_channel* raw_rchannel = key_raw_channel::create<assimp_key_r>( node->mNumRotationKeys );
    422         //key_raw_channel* raw_schannel = key_raw_channel::create<assimp_key_s>( node->mNumScalingKeys );
     420        raw_data_channel* raw_pchannel = raw_data_channel::create<assimp_key_p>( node->mNumPositionKeys );
     421        raw_data_channel* raw_rchannel = raw_data_channel::create<assimp_key_r>( node->mNumRotationKeys );
     422        //raw_data_channel* raw_schannel = raw_data_channel::create<assimp_key_s>( node->mNumScalingKeys );
    423423        data->data->add_channel( raw_pchannel );
    424424        data->data->add_channel( raw_rchannel );
  • trunk/src/formats/md2_loader.cc

    r406 r411  
    324324        size_t frame_count   = ( frame == -1 ? num_frames : 1 );
    325325
    326         mesh_raw_channel* mc_pn = mesh_raw_channel::create< vtx_md2_pn >( num_verts * frame_count );
     326        raw_data_channel* mc_pn = raw_data_channel::create< vtx_md2_pn >( num_verts * frame_count );
    327327        vtx_md2_pn* vtx_pn = reinterpret_cast< vtx_md2_pn* >( mc_pn->data );
    328328
     
    347347        }
    348348
    349         mesh_raw_channel* mc_t = mesh_raw_channel::create< vtx_md2_t >( num_verts );
     349        raw_data_channel* mc_t = raw_data_channel::create< vtx_md2_t >( num_verts );
    350350        vtx_md2_t* vtx_t = reinterpret_cast< vtx_md2_t* >( mc_t->data );
    351351
     
    357357        }
    358358
    359         mesh_raw_channel* ic = mesh_raw_channel::create_index< uint16 >( m_new_indexes.size() );
     359        raw_data_channel* ic = raw_data_channel::create_index< uint16 >( m_new_indexes.size() );
    360360        if ( m_new_indexes.size() > 0 )
    361361        {
  • trunk/src/formats/md3_loader.cc

    r406 r411  
    286286}
    287287
    288 nv::key_raw_channel* nv::md3_loader::load_tags( const string_view& tag )
     288nv::raw_data_channel* nv::md3_loader::load_tags( const string_view& tag )
    289289{
    290290        md3_t* md3 = reinterpret_cast< md3_t* >( m_md3 );
    291         key_raw_channel* result = key_raw_channel::create<md3_key>( uint32( md3->header.num_frames ) );
     291        raw_data_channel* result = raw_data_channel::create<md3_key>( uint32( md3->header.num_frames ) );
    292292        // TODO: is this brain damaged in efficiency (loop nest order) or what?
    293293        for ( sint32 f = 0; f < md3->header.num_frames; ++f )
     
    352352                }
    353353
    354         mesh_raw_channel* mc_pn = mesh_raw_channel::create< vtx_md3_pn >( uint32( num_verts * frame_count ) );
    355         mesh_raw_channel* mc_t  = mesh_raw_channel::create< vtx_md3_t >( uint32( num_verts ) );
    356         mesh_raw_channel* ic = mesh_raw_channel::create_index< uint16 >( uint32( index_count ) );
     354        raw_data_channel* mc_pn = raw_data_channel::create< vtx_md3_pn >( uint32( num_verts * frame_count ) );
     355        raw_data_channel* mc_t  = raw_data_channel::create< vtx_md3_t >( uint32( num_verts ) );
     356        raw_data_channel* ic = raw_data_channel::create_index< uint16 >( uint32( index_count ) );
    357357        vtx_md3_pn* vtx_pn = reinterpret_cast< vtx_md3_pn* >( mc_pn->data );
    358358        vtx_md3_t*  vtx_t  = reinterpret_cast< vtx_md3_t* >( mc_t->data );
     
    435435                nodes[i].data      = new key_data;
    436436       
    437                 key_raw_channel* keys = load_tags( name );
     437                raw_data_channel* keys = load_tags( name );
    438438                nodes[i].data->add_channel( keys );
    439439        }
  • trunk/src/formats/md5_loader.cc

    r406 r411  
    159159                                        md5_vtx_t* tdata = nullptr;
    160160                                        {
    161                                                 mesh_raw_channel* ch_pnt = mesh_raw_channel::create<md5_vtx_pnt>( num_verts );
    162                                                 mesh_raw_channel* ch_t   = mesh_raw_channel::create<md5_vtx_t>( num_verts );
    163                                                 mesh_raw_channel* ch_pntiw = mesh_raw_channel::create<md5_vtx_pntiw>( num_verts );
     161                                                raw_data_channel* ch_pnt = raw_data_channel::create<md5_vtx_pnt>( num_verts );
     162                                                raw_data_channel* ch_t   = raw_data_channel::create<md5_vtx_t>( num_verts );
     163                                                raw_data_channel* ch_pntiw = raw_data_channel::create<md5_vtx_pntiw>( num_verts );
    164164                                                tdata = reinterpret_cast< md5_vtx_t* >( ch_t->data );
    165165                                                mesh->add_channel( ch_pnt );
     
    190190                                        sstream >> num_tris;
    191191
    192                                         mesh_raw_channel* ch_i = mesh_raw_channel::create_index<uint32>( num_tris * 3 );
     192                                        raw_data_channel* ch_i = raw_data_channel::create_index<uint32>( num_tris * 3 );
    193193                                        uint32* vtx_i                = reinterpret_cast< uint32* >( ch_i->data );
    194194                                        uint32 idx = 0;
     
    256256                                nodes[i].target_id = -1;
    257257                                nodes[i].data      = new key_data;
    258                                 nodes[i].data->add_channel( key_raw_channel::create< md5_key_t >( num_frames ) );
     258                                nodes[i].data->add_channel( raw_data_channel::create< md5_key_t >( num_frames ) );
    259259                                next_line( sstream );
    260260                        }
  • trunk/src/formats/nmd_loader.cc

    r410 r411  
    4343                nmd_stream_header stream_header;
    4444                source.read( &stream_header, sizeof( stream_header ), 1 );
    45                 mesh_raw_channel* channel = mesh_raw_channel::create( stream_header.format, stream_header.count );
     45                raw_data_channel* channel = raw_data_channel::create( stream_header.format, stream_header.count );
    4646                source.read( channel->data, stream_header.format.element_size(), stream_header.count );
    4747                mesh->add_channel( channel );
     
    128128                                nv::nmd_stream_header cheader;
    129129                                source.read( &cheader, sizeof( cheader ), 1 );
    130                                 key_raw_channel* channel = key_raw_channel::create( cheader.format, cheader.count );
     130                                raw_data_channel* channel = raw_data_channel::create( cheader.format, cheader.count );
    131131                                source.read( channel->data, channel->desc.element_size(), channel->count );
    132132                                kdata->add_channel( channel );
     
    162162static void nmd_dump_mesh( const mesh_data* mesh, stream& stream_out )
    163163{
    164         array_view< mesh_raw_channel* > data  = mesh->get_raw_channels();
     164        array_view< raw_data_channel* > data  = mesh->get_raw_channels();
    165165
    166166        uint32 size = sizeof( nmd_element_header );
     
    248248                for ( uint32 c = 0; c < chan_count; ++c )
    249249                {
    250                         const key_raw_channel* channel = node->data->get_channel(c);
     250                        const raw_data_channel* channel = node->data->get_channel(c);
    251251
    252252                        eheader.type     = nmd_type::KEY_CHANNEL;
  • trunk/src/formats/obj_loader.cc

    r406 r411  
    324324                }
    325325       
    326                 mesh_raw_channel* channel = new mesh_raw_channel();
     326                raw_data_channel* channel = new raw_data_channel();
    327327                nv::uint8* data = nullptr;
    328328
Note: See TracChangeset for help on using the changeset viewer.