Changeset 540 for trunk/src/engine


Ignore:
Timestamp:
01/25/17 20:20:45 (8 years ago)
Author:
epyon
Message:
  • lua::stack_proxy RTTI read support
  • missing RTTI declarations
  • new lua::table_guard syntax
Location:
trunk/src/engine
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/engine/animation.cc

    r539 r540  
    2727nv::resource< animator_data > nv::animator_manager::load_animator( nv::lua::table_guard& table, nv::shash64 id, nv::pose_data_set* poses /*= nullptr */ )
    2828{
    29         uint32 count = table.get_size();
     29        uint32 count = table.size();
    3030        if ( count == 0 )
    3131        {
     
    7373                {
    7474                        nv::lua::table_guard states_table( layer_table, "states" );
    75                         uint32 state_count = states_table.get_size();
     75                        uint32 state_count = states_table.size();
    7676                        if ( state_count > 0 )
    7777                        {
     
    119119                                        {
    120120                                                nv::lua::table_guard transitions_table( state_table, "transitions" );
    121                                                 uint32 transition_count = transitions_table.get_size();
     121                                                uint32 transition_count = transitions_table.size();
    122122                                                if ( transition_count > 0 )
    123123                                                {
     
    167167        result.in = table["ease_in"].get_enum( result.in );
    168168        result.out = table["ease_out"].get_enum( nv::easing_type::NONE );
    169         if ( table.has_field( "ease_in_out" ) )
     169        if ( table[ "ease_in_out" ] )
    170170        {
    171171                result.in = result.out = table["ease_in_out"].get_enum( nv::easing_type::NONE );
  • trunk/src/engine/model_manager.cc

    r539 r540  
    3030                gm->ragdoll_id = table["ragdoll"].get_string32();
    3131       
    32         if ( table.has_field( "animator" ) )
     32        if ( table["animator"] )
    3333        {
    3434                gm->animator = m_rm->get< animator_data >( table["animator"].get_string() );
     
    4040        }
    4141
    42         if ( table.has_field( "phx_mesh" ) )
     42        if ( table[ "phx_mesh" ] )
    4343        {
    4444                nv::string128 cpath( table["phx_mesh"].get_string128() );
     
    7777                node->tag = table["tag"].get_string32();
    7878
    79         if ( table.has_field( "path" ) )
     79        if ( table[ "path" ] )
    8080        {
    8181                nv::string128 cpath( table["path"].get_string128() );
     
    8585        }
    8686
    87         if ( table.has_field( "phx_hextents" ) )
     87        if ( table[ "phx_hextents"] )
    8888                node->phx_hextents = table["phx_hextents"].as<vec3>();
    89         if ( table.has_field( "phx_offset" ) )
     89        if ( table[ "phx_offset"] )
    9090                node->phx_offset = table["phx_offset"].as<vec3>();
    91         if ( table.has_field( "phx_mass" ) )
     91        if ( table[ "phx_mass"] )
    9292                node->phx_mass = table["phx_mass"].as<float>( 0.0f );
    93         if ( table.has_field( "phx_mass" ) )
     93        if ( table["phx_mass"] )
    9494                node->phx_shape = nv::phx_shape( table["phx_shape"].as<int>( 0 ) );
    9595
    96         if ( table.has_field( "local_position" ) )
     96        if ( table["local_position"] )
    9797                node->local.set_position( table["local_position"].as<vec3>() );
    98         if ( table.has_field( "local_orientation" ) )
     98        if ( table["local_orientation"] )
    9999                node->local.set_orientation( vec4_to_quat( table["local_orientation"].as<vec4>( vec4( 0.0f, 0.0f, 0.0f, 1.0f ) ) ) );
    100100
    101         if ( table.has_field( "position" ) )
     101        if ( table["position"] )
    102102        {
    103103                node->position.min = table["position"].as<vec3>();
    104104                node->position.max = node->position.min;
    105105        }
    106         if ( table.has_field( "rotation" ) )
     106        if ( table["rotation"] )
    107107        {
    108108                node->rotation.min = table["rotation"].as<vec3>();
    109109                node->rotation.max = node->rotation.min;
    110110        }
    111         if ( table.has_field( "position_min" ) )  node->position.min  = table["position_min"].as<vec3>();
    112         if ( table.has_field( "position_max" ) )  node->position.max  = table["position_max"].as<vec3>();
    113         if ( table.has_field( "position_dist" ) ) node->position.dist = random_dist( table["position_dist"].get_uint32() );
    114         if ( table.has_field( "rotation_min" ) )  node->rotation.min  = table["rotation_min"].as<vec3>();
    115         if ( table.has_field( "rotation_max" ) )  node->rotation.max  = table["rotation_max"].as<vec3>();
    116         if ( table.has_field( "rotation_dist" ) ) node->rotation.dist = random_dist( table["rotation_dist"].get_uint32() );
     111        if ( table["position_min"] )  node->position.min  = table["position_min"].as<vec3>();
     112        if ( table["position_max"] )  node->position.max  = table["position_max"].as<vec3>();
     113        if ( table["position_dist"] ) node->position.dist = random_dist( table["position_dist"].get_uint32() );
     114        if ( table["rotation_min"] )  node->rotation.min  = table["rotation_min"].as<vec3>();
     115        if ( table["rotation_max"] )  node->rotation.max  = table["rotation_max"].as<vec3>();
     116        if ( table["rotation_dist"] ) node->rotation.dist = random_dist( table["rotation_dist"].get_uint32() );
    117117
    118         if ( table.has_field( "attach" ) )
     118        if ( table["attach"] )
    119119        {
    120120                if ( table["attach"].is_number() )
     
    140140        node->material  = cmaterial;
    141141
    142         for ( uint32 i = 1; i <= table.get_size(); ++i )
     142        for ( uint32 i = 1; i <= table.size(); ++i )
    143143        {
    144144                lua::table_guard child_table( table, i );
  • trunk/src/engine/particle_manager.cc

    r539 r540  
    6868
    6969        vec2 def_size        = table.get<vec2>("size", vec2(0.1,0.1) );
    70         uint32 elements = table.get_size();
     70        uint32 elements = table.size();
    7171        for ( uint32 i = 0; i < elements; ++i )
    7272        {
  • trunk/src/engine/program_manager.cc

    r539 r540  
    6868        {
    6969                lua::table_guard inctable( table, "files" );
    70                 uint32 count = inctable.get_size();
     70                uint32 count = inctable.size();
    7171                for ( uint32 i = 1; i <= count; ++i )
    7272                {
  • trunk/src/engine/ragdoll_manager.cc

    r539 r540  
    7575                float radius = table["radius"].get_f32();
    7676                float length = 0.0f;
    77                 if ( table.has_field( "target" ) )
     77                if ( table[ "target" ] )
    7878                {
    7979                        const auto& of = bind_data->get_bone_transforms().m_offsets;
     
    9797                        part.limits     = table["limits"].as< vec3 >();
    9898                }
    99                 uint32 child_count = table.get_size();
     99                uint32 child_count = table.size();
    100100                bool   result = true;
    101101                if ( child_count > 0 )
Note: See TracChangeset for help on using the changeset viewer.