Changeset 480 for trunk/legacy


Ignore:
Timestamp:
11/03/15 19:06:23 (10 years ago)
Author:
epyon
Message:
  • cleanup of legacy code
  • resource updates
Location:
trunk/legacy
Files:
9 moved

Legend:

Unmodified
Added
Removed
  • trunk/legacy/keyframed_mesh.cc

    r470 r480  
    1212
    1313using namespace nv;
     14
     15#if 0
    1416
    1517nv::keyframed_mesh::keyframed_mesh( context* a_context, const data_channel_set* a_data, const mesh_nodes_data* a_tag_map )
     
    247249        delete[] m_data;
    248250}
     251
     252#endif
  • trunk/legacy/keyframed_mesh.hh

    r470 r480  
    1111#include <nv/interface/context.hh>
    1212#include <nv/interface/animated_mesh.hh>
    13 #include <nv/formats/md3_loader.hh>
    1413
    1514namespace nv
    1615{
     16
     17#if 0
    1718
    1819        class keyframed_mesh : public animated_mesh
     
    9596        };
    9697
     98#endif
     99
    97100} // namespace nv
    98101
  • trunk/legacy/md2_loader.cc

    r453 r480  
    368368}
    369369
    370 mesh_data_pack* nv::md2_loader::release_mesh_data_pack()
    371 {
    372         data_channel_set* data = data_channel_set_creator::create_set_array( 1, 3 );
    373         release_mesh_frame( &data[0], -1 );
    374         return new mesh_data_pack( 1, data );
    375 }
  • trunk/legacy/md2_loader.hh

    r453 r480  
    2828                virtual bool load( stream& source );
    2929                virtual data_channel_set* release_mesh_data( size_t index = 0 );
    30                 virtual mesh_data_pack* release_mesh_data_pack();
    3130                virtual size_t get_mesh_count() const { return 1; }
    3231        private:
  • trunk/legacy/md3_loader.cc

    r475 r480  
    435435}
    436436
    437 mesh_data_pack* nv::md3_loader::release_mesh_data_pack()
    438 {
    439         md3_t* md3 = reinterpret_cast<md3_t*>( m_md3 );
    440         int count = 1;
    441         data_channel_set* data = nullptr;
    442         if ( m_merge_all )
    443         {
    444                 data = data_channel_set_creator::create_set_array(1,3);
    445                 release_mesh_frame( &data[0], -1, -1 );
    446         }
    447         else
    448         {
    449                 count = md3->header.num_surfaces;
    450                 data = data_channel_set_creator::create_set_array( count, 3 );
    451                 for ( int i = 0; i < count; ++i )
    452                 {
    453                         release_mesh_frame( &data[i], -1, i );
    454                         data_channel_set_creator( &data[i] ).set_name( make_name( reinterpret_cast< char* >( md3->surfaces[i].header.name ) ) );
    455                 }
    456         }
    457         return new mesh_data_pack( uint32( count ), data, release_mesh_nodes_data() );
    458 }
    459 
    460437nv::size_t md3_loader::get_max_frames() const
    461438{
  • trunk/legacy/md3_loader.hh

    r453 r480  
    3434                virtual bool load( stream& source );
    3535                virtual data_channel_set* release_mesh_data( size_t index = 0 );
    36                 virtual mesh_data_pack* release_mesh_data_pack();
    3736                virtual size_t get_mesh_count() const { return 1; }
    3837                size_t get_max_frames() const;
  • trunk/legacy/skeletal_mesh.cc

    r479 r480  
    1212
    1313#include "nv/core/logging.hh"
    14 
     14#if 0
    1515void nv::skeletal_animation_entry::update_skeleton( skeleton_instance& data, uint32 a_ms_time ) const
    1616{
     
    3939        m_data.prepare( m_temp_anim, bones ? bones : m_temp_anim );
    4040}
    41 
    42 nv::skeletal_mesh::skeletal_mesh( context* a_context, const data_channel_set* a_mesh, const mesh_nodes_data* a_bone_data )
    43         : m_skeleton( a_bone_data ? a_bone_data->size() : 0 ), m_context( a_context ), m_bone_data( a_bone_data ), m_index_count( 0 ), m_parent_id(-1)
    44 {
    45         if ( a_mesh )
    46         {
    47                 m_va = a_context->create_vertex_array( a_mesh, nv::STATIC_DRAW );
    48                 m_index_count = a_mesh->get_channel_size( slot::INDEX );
    49                 m_parent_id = a_mesh->get_parent_id();
    50         }
    51 }
    52 
    53 void nv::skeletal_mesh::update_animation( animation_entry& a_anim, uint32 a_anim_time )
    54 {
    55         skeletal_animation_entry& anim = static_cast<skeletal_animation_entry&>( a_anim );
    56         anim.prepare( m_bone_data );
    57         anim.update_skeleton( m_skeleton, a_anim_time );
    58 }
    59 
    60 void nv::skeletal_mesh::update_program( program a_program )
    61 {
    62         m_context->get_device()->set_opt_uniform_array( a_program, "nv_m_bones", m_skeleton.transforms(), m_skeleton.size() );
    63 }
    64 
    65 nv::transform nv::skeletal_mesh::get_node_transform( uint32 node_id ) const
    66 {
    67         return transform( get_node_matrix( node_id ) );
    68 }
    69 
    70 nv::mat4 nv::skeletal_mesh::get_node_matrix( uint32 node_id ) const
    71 {
    72         return m_skeleton.transforms()[ node_id ];
    73 }
     41#endif
  • trunk/legacy/skeletal_mesh.hh

    r477 r480  
    1616namespace nv
    1717{
    18        
     18#if 0   
    1919        class skeletal_animation_entry : public animation_entry
    2020        {
     
    3333                skeleton_binding m_data;
    3434        };
    35 
    36         class skeletal_mesh : public animated_mesh
    37         {
    38         public:
    39                 skeletal_mesh( context* a_context, const data_channel_set* a_mesh, const mesh_nodes_data* a_bone_data );
    40                 virtual vertex_array get_vertex_array() const { return m_va; }
    41                 virtual size_t get_index_count() const { return m_index_count; }
    42                 virtual void run_animation( animation_entry& a_anim )
    43                 {
    44                         update_animation( a_anim, 0 );
    45                 }
    46                 virtual void update_program( program a_program );
    47                 virtual void update_animation( animation_entry& a_anim, uint32 a_anim_time );
    48                 virtual transform get_node_transform( uint32 node_id ) const;
    49                 virtual mat4 get_node_matrix( uint32 node_id ) const;
    50                 virtual sint16 get_parent_id() const { return m_parent_id; }
    51                 virtual uint32 get_node_count() const { return m_skeleton.size(); }
    52                 skeleton_instance& get_skeleton() { return m_skeleton; }
    53                 const mesh_nodes_data* get_bone_data() { return m_bone_data; }
    54                 context* get_context() { return m_context;  }
    55                 ~skeletal_mesh()
    56                 {
    57                         m_context->release( m_va );
    58                 }
    59         protected:
    60                 skeleton_instance m_skeleton;
    61                 vertex_array m_va;
    62                 uint32       m_index_count;
    63                 context*     m_context;
    64                 const mesh_nodes_data* m_bone_data;
    65                 sint16 m_parent_id;
    66         };
     35#endif
    6736
    6837} // namespace nv
Note: See TracChangeset for help on using the changeset viewer.