Ignore:
Timestamp:
07/09/15 14:40:36 (10 years ago)
Author:
epyon
Message:
  • refactoring of raw_data_channel and data_descriptor access
File:
1 edited

Legend:

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

    r411 r412  
    324324                }
    325325       
    326                 raw_data_channel* channel = new raw_data_channel();
    327                 nv::uint8* data = nullptr;
    328 
    329                 if ( reader->raw_size() > 0 )
    330                 {
    331                         data = new uint8[ reader->raw_size() ];
    332                         raw_copy_n( reader->raw_pointer(), reader->raw_size(), data );
    333                 }
    334                 channel->data  = data;
    335                 channel->desc  = m_descriptor;
    336                 channel->count = reader->size * 3;
     326                raw_data_channel* channel = raw_data_channel::create( m_descriptor, reader->size * 3 );
     327                if ( reader->raw_size() > 0 )
     328                {
     329                        raw_copy_n( reader->raw_pointer(), reader->raw_size(), channel->data );
     330                }
    337331
    338332                mesh_data* mesh = new mesh_data(reader->name);
Note: See TracChangeset for help on using the changeset viewer.