Changeset 524 for trunk/src


Ignore:
Timestamp:
10/26/16 18:41:20 (9 years ago)
Author:
epyon
Message:
  • god I really suck with proper commits -_-
Location:
trunk/src/engine
Files:
3 edited

Legend:

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

    r523 r524  
    77#include "nv/engine/model_manager.hh"
    88
     9#include "nv/engine/ragdoll_manager.hh"
    910#include "nv/lua/lua_math.hh"
    1011#include "nv/lua/lua_flags.hh"
     
    2627                def_data = m_rm->get< mesh_data >( table.get_string128( "path" ) );
    2728
     29        if ( table.is_string( "ragdoll" ) )
     30                gm->ragdoll_id = table.get_string32( "ragdoll" );
     31       
    2832        if ( table.has_field( "animator" ) )
    2933        {
  • trunk/src/engine/ragdoll_manager.cc

    r520 r524  
    6666        if ( auto bind_data = rbind.lock() )
    6767        {
     68                data->id = table.get_string32( "id" );
    6869                int index = data->parts.size();
    6970                data->parts.emplace_back();
  • trunk/src/engine/resource_system.cc

    r486 r524  
    3434        }
    3535}
     36
     37void nv::lua_resource_manager_base::preload_ids()
     38{
     39        m_id_hash.clear();
     40        lua::table_guard table( m_lua, get_storage_name() );
     41        uint32 count = table.get_unsigned( "__counter" );
     42        for ( auto i : range( count ) )
     43        {
     44                lua::table_guard sub_table( table, i + 1 );
     45                string64 id = sub_table.get_string64( "id" );
     46                NV_ASSERT( m_id_hash.find( id ) == m_id_hash.end(), "HASH COLLISION - ", id, " - ", m_id_hash[id] );
     47                m_id_hash[id] = id;
     48        }
     49}
Note: See TracChangeset for help on using the changeset viewer.