Changeset 477 for trunk/src/engine/resource_system.cc
- Timestamp:
- 10/23/15 19:35:39 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/engine/resource_system.cc
r474 r477 9 9 #include "nv/lua/lua_nova.hh" 10 10 11 void nv:: resource_manager_base::initialize( lua::state* a_lua_state )11 void nv::lua_resource_manager_base::initialize( lua::state* a_lua_state ) 12 12 { 13 13 m_lua = a_lua_state; … … 16 16 } 17 17 18 nv::res_id nv::resource_manager_base::load_resource( const string_view& id )18 bool nv::lua_resource_manager_base::load_resource( const string_view& id ) 19 19 { 20 20 lua::table_guard table( m_lua, lua::path( get_storage_name(), id ) ); 21 res_id rid = load_resource( table ); 22 if ( rid != 0 ) m_names[ id ] = rid; 23 return rid; 21 load_resource( table, id ); 22 return true; 24 23 } 25 24 26 void nv:: resource_manager_base::load_all()25 void nv::lua_resource_manager_base::load_all() 27 26 { 28 27 clear(); … … 31 30 for ( auto i : range( count ) ) 32 31 { 33 lua::table_guard sub_table( table, i+1 ); 34 res_id rid = load_resource( sub_table ); 35 if ( rid != 0 ) m_names[ sub_table.get_string_hash_64("id") ] = rid; 32 lua::table_guard sub_table( table, i + 1 ); 33 load_resource( sub_table, sub_table.get_string_hash_64( "id" ) ); 36 34 } 37 35 } 36
Note: See TracChangeset
for help on using the changeset viewer.