Changeset 539 for trunk/src/engine
- Timestamp:
- 01/24/17 17:55:00 (8 years ago)
- Location:
- trunk/src/engine
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/engine/animation.cc
r509 r539 34 34 35 35 nv::animator_data* animator = new nv::animator_data; 36 animator->id = table .get_string64( "id");36 animator->id = table["id"].get_string64(); 37 37 animator->poses = poses; 38 38 if ( poses == nullptr ) 39 39 { 40 string128 poses_path = table .get_string128( "poses");40 string128 poses_path = table["poses"].get_string128(); 41 41 if ( !poses_path.empty() ) 42 42 { … … 59 59 nv::lua::table_guard layer_table( table, layer_idx ); 60 60 nv::animator_layer_data& layer = animator->layers[layer_idx - 1]; 61 layer.name = layer_table .get_string( "name", m_strings, 0);62 layer.mask = layer_table .get_integer( "mask",-1 );61 layer.name = layer_table["name"].get_string( m_strings ); 62 layer.mask = layer_table["mask"].get_sint32( -1 ); 63 63 layer.def_state = -1; 64 64 … … 70 70 } 71 71 72 if ( layer_table .is_table( "states") )72 if ( layer_table["states"].is_table() ) 73 73 { 74 74 nv::lua::table_guard states_table( layer_table, "states" ); … … 84 84 nv::animator_state_data& state = layer.states[state_idx - 1]; 85 85 86 state.name = state_table .get_string( "name", m_strings, 0);86 state.name = state_table["name"].get_string( m_strings ); 87 87 NV_ASSERT( state.name, "Animation state without name is invalid!" ); 88 88 state_names[state.name] = state_idx - 1; 89 state.loop = state_table .get_boolean( "loop",true );90 state.duration = state_table .get_float( "duration", 0.0f);91 state.interp = nv::interpolation( state_table.get_unsigned( "interpolation", uint32( nv::interpolation::SPHERICAL ) ));89 state.loop = state_table["loop"].get_bool( true ); 90 state.duration = state_table["duration"].get_f32(); 91 state.interp = state_table["interpolation"].get_enum( nv::interpolation::SPHERICAL ); 92 92 93 shash64 pose_set = state_table .get_string_hash_64( "pose_set");93 shash64 pose_set = state_table["pose_set"].get_shash64(); 94 94 if ( pose_set ) 95 95 { … … 98 98 uint32 pid = it->second.start; 99 99 uint32 pose_count = it->second.count; 100 uint32 start = state_table .get_unsigned( "start", 0);101 uint32 stop = state_table .get_unsigned( "stop",pose_count - 1 );100 uint32 start = state_table["start"].get_uint32(); 101 uint32 stop = state_table["stop"].get_uint32( pose_count - 1 ); 102 102 for ( nv::uint32 i = pid + start; i < pid + stop + 1; ++i ) 103 103 { … … 116 116 nv::lua::table_guard state_table( states_table, state_idx ); 117 117 118 if ( state_table .is_table( "transitions") )118 if ( state_table["transitions"].is_table() ) 119 119 { 120 120 nv::lua::table_guard transitions_table( state_table, "transitions" ); … … 125 125 { 126 126 nv::lua::table_guard transition_table( transitions_table, transition_idx ); 127 shash64 name = transition_table .get_string( "name", m_strings, 0);128 shash64 target_name = transition_table .get_string_hash_64( "target", 0);127 shash64 name = transition_table["name"].get_string( m_strings ); 128 shash64 target_name = transition_table["target"].get_shash64(); 129 129 NV_ASSERT( name, "Transition state without name is invalid!" ); 130 130 NV_ASSERT( target_name, "Transition state without name is invalid!" ); … … 134 134 nv::animator_transition_data tr_data; 135 135 tr_data.target = it->second; 136 tr_data.duration = transition_table .get_float( "duration", 0.0f);137 tr_data.interp = nv::interpolation( transition_table.get_unsigned( "interpolation", uint32( nv::interpolation::SPHERICAL ) ));136 tr_data.duration = transition_table["duration"].get_f32(); 137 tr_data.interp = transition_table["interpolation"].get_enum( nv::interpolation::SPHERICAL ); 138 138 tr_data.easing = read_easing( transition_table ); 139 139 … … 149 149 150 150 151 shash64 def_state_name = layer_table .get_string_hash_64( "default", 0);151 shash64 def_state_name = layer_table["default"].get_shash64(); 152 152 if ( def_state_name ) 153 153 { … … 164 164 { 165 165 nv::easing result; 166 result.in = nv::easing_type( table.get_integer( "easing", int( nv::easing_type::NONE ) ));167 result.in = nv::easing_type( table.get_integer( "ease_in", int( result.in ) ));168 result.out = nv::easing_type( table.get_integer( "ease_out", int( nv::easing_type::NONE ) ));166 result.in = table["easing"].get_enum( nv::easing_type::NONE ); 167 result.in = table["ease_in"].get_enum( result.in ); 168 result.out = table["ease_out"].get_enum( nv::easing_type::NONE ); 169 169 if ( table.has_field( "ease_in_out" ) ) 170 170 { 171 result.in = result.out = nv::easing_type( table.get_integer( "ease_in_out", int( nv::easing_type::NONE ) ));171 result.in = result.out = table["ease_in_out"].get_enum( nv::easing_type::NONE ); 172 172 } 173 173 if ( result.in == nv::easing_type::NONE && result.out == nv::easing_type::NONE ) -
trunk/src/engine/material_manager.cc
r535 r539 61 61 material* m = new material; 62 62 63 if ( table .is_string( "path") )63 if ( table["path"].is_string() ) 64 64 { 65 m->id = table .get_string128( "id");66 string128 path = table .get_string128( "path");65 m->id = table["id"].get_string128(); 66 string128 path = table["path"].get_string128(); 67 67 for ( uint32 i = 0; i < 5; ++i ) 68 68 m->paths[i] = path; … … 85 85 else 86 86 { 87 m->paths[ TEX_DIFFUSE ] = table.get_string128( "diffuse");88 m->paths[ TEX_NORMAL ] = table.get_string128( "normal");89 m->paths[ TEX_METALLIC ] = table.get_string128( "metallic");90 m->paths[ TEX_ROUGHNESS] = table .get_string128( "roughness");91 m->paths[ TEX_EMISSIVE ] = table .get_string128( "emissive");87 m->paths[ TEX_DIFFUSE ] = table[ "diffuse" ].get_string128(); 88 m->paths[ TEX_NORMAL ] = table[ "normal" ].get_string128(); 89 m->paths[ TEX_METALLIC ] = table[ "metallic" ].get_string128(); 90 m->paths[ TEX_ROUGHNESS] = table[ "roughness" ].get_string128(); 91 m->paths[ TEX_EMISSIVE ] = table[ "emissive" ].get_string128(); 92 92 } 93 93 add( id, m ); -
trunk/src/engine/model_manager.cc
r529 r539 18 18 19 19 model* gm = new model; 20 gm->flags = table .get< flags<32> >( "flags");21 gm->attach = table .get_string_hash_64( "attach");22 gm->root.set_position( table .get<vec3>( "root_position", vec3()) );23 gm->root.set_orientation( vec4_to_quat( table .get<vec4>( "root_orientation",vec4(0.0f,0.0f,0.0f,1.0f) ) ) );20 gm->flags = table["flags"].as< flags<32> >(); 21 gm->attach = table["attach"].get_shash64(); 22 gm->root.set_position( table["root_position"].as<vec3>() ); 23 gm->root.set_orientation( vec4_to_quat( table["root_orientation"].as<vec4>( vec4(0.0f,0.0f,0.0f,1.0f) ) ) ); 24 24 25 25 resource< mesh_data > def_data; 26 if ( table .is_string( "path") )27 def_data = m_rm->get< mesh_data >( table .get_string128( "path") );26 if ( table["path"].is_string() ) 27 def_data = m_rm->get< mesh_data >( table["path"].get_string128() ); 28 28 29 if ( table .is_string( "ragdoll") )30 gm->ragdoll_id = table .get_string32( "ragdoll");29 if ( table["ragdoll"].is_string() ) 30 gm->ragdoll_id = table["ragdoll"].get_string32(); 31 31 32 32 if ( table.has_field( "animator" ) ) 33 33 { 34 gm->animator = m_rm->get< animator_data >( table .get_string( "animator") );34 gm->animator = m_rm->get< animator_data >( table["animator"].get_string() ); 35 35 pose_data_set* poses = gm->animator.lock()->poses; 36 36 if ( !def_data || !def_data.lock()->node_data ) … … 42 42 if ( table.has_field( "phx_mesh" ) ) 43 43 { 44 nv::string128 cpath( table .get_string128( "phx_mesh") );44 nv::string128 cpath( table["phx_mesh"].get_string128() ); 45 45 gm->phx_mesh = m_mesh_datas->get_path( cpath, def_data ); 46 46 } 47 47 48 if ( table .is_table( "model") )48 if ( table["model"].is_table() ) 49 49 { 50 50 lua::table_guard model_table( table, "model" ); … … 66 66 sint16 attach_id = -1; 67 67 68 if ( table .is_string( "material") )68 if ( table["material"].is_string() ) 69 69 { 70 nv::string128 mat_id( table .get_string128( "material") );70 nv::string128 mat_id( table["material"].get_string128() ); 71 71 cmaterial = m_rm->get< material >( mat_id ); 72 72 if ( !cmaterial ) … … 74 74 } 75 75 76 if ( table .is_string( "tag") )77 node->tag = table .get_string32( "tag");76 if ( table["tag"].is_string() ) 77 node->tag = table["tag"].get_string32(); 78 78 79 79 if ( table.has_field( "path" ) ) 80 80 { 81 nv::string128 cpath( table .get_string128( "path") );81 nv::string128 cpath( table["path"].get_string128() ); 82 82 nv::data_node_info info; 83 83 cmesh = m_mesh_datas->get_path( cpath, def_data, &info ); … … 86 86 87 87 if ( table.has_field( "phx_hextents" ) ) 88 node->phx_hextents = table .get<vec3>( "phx_hextents", vec3());88 node->phx_hextents = table["phx_hextents"].as<vec3>(); 89 89 if ( table.has_field( "phx_offset" ) ) 90 node->phx_offset = table .get<vec3>( "phx_offset", vec3());90 node->phx_offset = table["phx_offset"].as<vec3>(); 91 91 if ( table.has_field( "phx_mass" ) ) 92 node->phx_mass = table .get<float>( "phx_mass", 0.0f);92 node->phx_mass = table["phx_mass"].as<float>( 0.0f ); 93 93 if ( table.has_field( "phx_mass" ) ) 94 node->phx_shape = nv::phx_shape( table .get<int>( "phx_shape",0 ) );94 node->phx_shape = nv::phx_shape( table["phx_shape"].as<int>( 0 ) ); 95 95 96 96 if ( table.has_field( "local_position" ) ) 97 node->local.set_position( table .get<vec3>( "local_position", vec3()) );97 node->local.set_position( table["local_position"].as<vec3>() ); 98 98 if ( table.has_field( "local_orientation" ) ) 99 node->local.set_orientation( vec4_to_quat( table .get<vec4>( "local_orientation",vec4( 0.0f, 0.0f, 0.0f, 1.0f ) ) ) );99 node->local.set_orientation( vec4_to_quat( table["local_orientation"].as<vec4>( vec4( 0.0f, 0.0f, 0.0f, 1.0f ) ) ) ); 100 100 101 101 if ( table.has_field( "position" ) ) 102 102 { 103 node->position.min = table .get<vec3>( "position", vec3());103 node->position.min = table["position"].as<vec3>(); 104 104 node->position.max = node->position.min; 105 105 } 106 106 if ( table.has_field( "rotation" ) ) 107 107 { 108 node->rotation.min = table .get<vec3>( "rotation", vec3());108 node->rotation.min = table["rotation"].as<vec3>(); 109 109 node->rotation.max = node->rotation.min; 110 110 } 111 if ( table.has_field( "position_min" ) ) node->position.min = table .get<vec3>( "position_min", vec3());112 if ( table.has_field( "position_max" ) ) node->position.max = table .get<vec3>( "position_max", vec3());113 if ( table.has_field( "position_dist" ) ) node->position.dist = random_dist( table .get_unsigned( "position_dist", 0) );114 if ( table.has_field( "rotation_min" ) ) node->rotation.min = table .get<vec3>( "rotation_min", vec3());115 if ( table.has_field( "rotation_max" ) ) node->rotation.max = table .get<vec3>( "rotation_max", vec3());116 if ( table.has_field( "rotation_dist" ) ) node->rotation.dist = random_dist( table .get_unsigned( "rotation_dist", 0) );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() ); 117 117 118 118 if ( table.has_field( "attach" ) ) 119 119 { 120 if ( table .is_number( "attach") )120 if ( table["attach"].is_number() ) 121 121 { 122 attach_id = sint16( table .get_integer( "attach",-1 ) );122 attach_id = sint16( table["attach"].get_sint32( -1 ) ); 123 123 // parent_id = 0; 124 124 } 125 125 else if ( auto m = def_data.lock() ) 126 126 { 127 auto it = m->node_names.find( table .get_string_hash_64( "attach") );127 auto it = m->node_names.find( table["attach"].get_shash64() ); 128 128 if ( it != m->node_names.end() ) 129 129 attach_id = sint16( it->second + 1 ); … … 132 132 } 133 133 134 node->nflags = table .get< flags<16,uint16> >( "flags");135 node->choice = model_node_choice( table .get_unsigned( "choice", false) );136 node->chance = table .get_float( "chance",1.0f );137 node->weight = static_cast< uint16 >( table .get_unsigned( "weight",1 ) );134 node->nflags = table["flags"].as< flags<16,uint16> >(); 135 node->choice = model_node_choice( table["choice"].get_uint32( 0 ) ); 136 node->chance = table["chance"].get_f32( 1.0f ); 137 node->weight = static_cast< uint16 >( table["weight"].get_uint32( 1 ) ); 138 138 node->mesh = cmesh; 139 139 node->attach_id = attach_id; -
trunk/src/engine/particle_manager.cc
r520 r539 61 61 data->emitter_count = 0; 62 62 data->affector_count = 0; 63 data->orientation = particle_orientation( table .get_unsigned("orientation", 0) );64 data->origin = particle_origin( table .get_unsigned( "origin",0) );63 data->orientation = particle_orientation( table["orientation"].get_uint32() ); 64 data->origin = particle_origin( table["origin"].get_uint32() ); 65 65 66 data->common_up = math::normalize( table .get<vec3>("common_up",vec3(1,0,0) ) );67 data->common_dir = math::normalize( table .get<vec3>("common_dir",vec3(0,1,0) ) );66 data->common_up = math::normalize( table["common_up"].as( vec3(1,0,0) ) ); 67 data->common_dir = math::normalize( table["common_dir"].as( vec3(0,1,0) ) ); 68 68 69 69 vec2 def_size = table.get<vec2>("size", vec2(0.1,0.1) ); … … 72 72 { 73 73 lua::table_guard element( table, i+1 ); 74 const_string type = element .get_string( "type");75 const_string sub_type = element .get_string( "sub_type");74 const_string type = element["type"].get_string(); 75 const_string sub_type = element["sub_type"].get_string(); 76 76 if ( type == "emitter" ) 77 77 { … … 86 86 } 87 87 88 edata.position = element .get<vec3>("position",vec3() );89 edata.extents = element .get<vec3>("extents",vec3(1,1,1) );90 edata.extents[0] = element .get<float>("width",edata.extents[0] );91 edata.extents[1] = element .get<float>("depth",edata.extents[1] );92 edata.extents[2] = element .get<float>("height",edata.extents[2] );93 edata.extents[0] = element .get<float>("radius",edata.extents[0] );94 edata.iextents = element .get<vec3>("inner_extents",vec3() );95 edata.iextents[0] = element .get<float>("inner_width",edata.iextents[0] );96 edata.iextents[1] = element .get<float>("inner_depth",edata.iextents[1] );97 edata.iextents[2] = element .get<float>("inner_height",edata.iextents[2] );98 edata.iextents[0] = element .get<float>("inner_radius",edata.iextents[0] );88 edata.position = element["position"].as( vec3() ); 89 edata.extents = element["extents"].as( vec3(1,1,1) ); 90 edata.extents[0] = element["width"].as( edata.extents[0] ); 91 edata.extents[1] = element["depth"].as( edata.extents[1] ); 92 edata.extents[2] = element["height"].as( edata.extents[2] ); 93 edata.extents[0] = element["radius"].as( edata.extents[0] ); 94 edata.iextents = element["inner_extents"].as( vec3() ); 95 edata.iextents[0] = element["inner_width"].as( edata.iextents[0] ); 96 edata.iextents[1] = element["inner_depth"].as( edata.iextents[1] ); 97 edata.iextents[2] = element["inner_height"].as( edata.iextents[2] ); 98 edata.iextents[0] = element["inner_radius"].as( edata.iextents[0] ); 99 99 edata.hextents = 0.5f * edata.extents; 100 100 edata.ihextents = 0.5f * edata.iextents; 101 edata.precise = element .get<bool>("precise",false );102 edata.square = element .get<bool>("square",true );103 vec4 color = element .get<vec4>("color",vec4(1,1,1,1) );104 edata.color_min = element .get<vec4>("color_min",color );105 edata.color_max = element .get<vec4>("color_max",color );106 vec2 size = element .get<vec2>("size",def_size );107 edata.size_min = element .get<vec2>("size_min",size );108 edata.size_max = element .get<vec2>("size_max",size );109 edata.angle = element .get<float>("angle",0.0f );110 float velocity = element .get<float>("velocity",0.0f );111 edata.velocity_min = element .get<float>("velocity_min",velocity );112 edata.velocity_max = element .get<float>("velocity_max",velocity );113 float lifetime = element .get<float>("lifetime",1.0f );114 edata.lifetime_min = element .get<float>("lifetime_min",lifetime );115 edata.lifetime_max = element .get<float>("lifetime_max",lifetime );116 float duration = element .get<float>("duration",0.0f );117 edata.duration_min = element .get<float>("duration_min",duration );118 edata.duration_max = element .get<float>("duration_max",duration );119 float repeat = element .get<float>("repeat_delay",0.0f );120 edata.repeat_min = element .get<float>("repeat_delay_min",repeat );121 edata.repeat_max = element .get<float>("repeat_delay_max",repeat );101 edata.precise = element["precise"].as( false ); 102 edata.square = element["square"].as( true ); 103 vec4 color = element["color"].as( vec4(1,1,1,1) ); 104 edata.color_min = element["color_min"].as( color ); 105 edata.color_max = element["color_max"].as( color ); 106 vec2 size = element["size"].as( def_size ); 107 edata.size_min = element["size_min"].as( size ); 108 edata.size_max = element["size_max"].as( size ); 109 edata.angle = element["angle"].as( 0.0f ); 110 float velocity = element["velocity"].as( 0.0f ); 111 edata.velocity_min = element["velocity_min"].as( velocity ); 112 edata.velocity_max = element["velocity_max"].as( velocity ); 113 float lifetime = element["lifetime"].as( 1.0f ); 114 edata.lifetime_min = element["lifetime_min"].as( lifetime ); 115 edata.lifetime_max = element["lifetime_max"].as( lifetime ); 116 float duration = element["duration"].as( 0.0f ); 117 edata.duration_min = element["duration_min"].as( duration ); 118 edata.duration_max = element["duration_max"].as( duration ); 119 float repeat = element["repeat_delay"].as( 0.0f ); 120 edata.repeat_min = element["repeat_delay_min"].as( repeat ); 121 edata.repeat_max = element["repeat_delay_max"].as( repeat ); 122 122 123 edata.rate = element .get<float>("rate",1.0f );124 edata.dir = math::normalize( element .get<vec3>("direction",vec3(0,1,0) ) );123 edata.rate = element["rate"].as( 1.0f ); 124 edata.dir = math::normalize( element["direction"].as( vec3(0,1,0) ) ); 125 125 126 126 edata.odir = vec3( 0, 0, 1 ); -
trunk/src/engine/program_manager.cc
r534 r539 18 18 bool nv::program_manager::load_resource( lua::table_guard& table, shash64 id ) 19 19 { 20 NV_LOG_DEBUG( table .get_string("id") );20 NV_LOG_DEBUG( table["id"].get_string() ); 21 21 string_buffer vsource; 22 22 string_buffer fsource; 23 23 string_buffer header( m_shader_head ); 24 if ( table .is_table("common") )24 if ( table["common"].is_table() ) 25 25 { 26 26 lua::table_guard common( table, "common" ); … … 61 61 c_file_system fs; 62 62 string_buffer out( append ); 63 if ( table .is_string( "files") )63 if ( table["files"].is_string() ) 64 64 { 65 out.append( file_to_string( table .get_string( "files") ) );65 out.append( file_to_string( table["files"].get_string() ) ); 66 66 } 67 else if ( table .is_table( "files") )67 else if ( table["files"].is_table() ) 68 68 { 69 69 lua::table_guard inctable( table, "files" ); … … 77 77 } 78 78 79 if ( table .is_string( "file") )79 if ( table["file"].is_string() ) 80 80 { 81 const_string data = file_to_string( table .get_string( "file") );81 const_string data = file_to_string( table["file"].get_string() ); 82 82 out.append( "#line 1\n" + data ); 83 83 } 84 84 85 if ( table .is_string( "source") )85 if ( table["source"].is_string() ) 86 86 { 87 out.append( table .get_string( "source") );87 out.append( table["source"].get_string() ); 88 88 } 89 89 return out; -
trunk/src/engine/ragdoll_manager.cc
r524 r539 26 26 NV_ASSERT_ALWAYS( m_world, "Physics world not setup in ragdoll_manager!" ); 27 27 bool result = false; 28 nv::string64 model_id = table .get_string64( "model");28 nv::string64 model_id = table["model"].get_string64(); 29 29 nv::resource< model > mr = m_model->get( model_id ); 30 30 if ( !mr ) return false; … … 66 66 if ( auto bind_data = rbind.lock() ) 67 67 { 68 data->id = table .get_string32( "id");68 data->id = table["id"].get_string32(); 69 69 int index = data->parts.size(); 70 70 data->parts.emplace_back(); 71 71 auto& part = data->parts.back(); 72 part.name = table .get_string_hash_64( "name");73 part.bone_id = nv::uint32( bind_data->get_bone_list().resolve( table .get_string_hash_64( "bone") ) );72 part.name = table["name"].get_shash64(); 73 part.bone_id = nv::uint32( bind_data->get_bone_list().resolve( table["bone"].get_shash64() ) ); 74 74 NV_ASSERT( part.bone_id < 256, "Bone ID not found!" ); 75 float radius = table .get_float( "radius");75 float radius = table["radius"].get_f32(); 76 76 float length = 0.0f; 77 77 if ( table.has_field( "target" ) ) 78 78 { 79 79 const auto& of = bind_data->get_bone_transforms().m_offsets; 80 int target = bind_data->get_bone_list().resolve( table .get_string_hash_64( "target") );80 int target = bind_data->get_bone_list().resolve( table["target"].get_shash64() ); 81 81 if ( target < 0 ) return false; 82 82 length = math::distance( of[part.bone_id].get_position(), of[target].get_position() ); … … 84 84 else 85 85 { 86 length = table .get_float( "length");86 length = table["length"].get_f32(); 87 87 } 88 88 NV_ASSERT( radius > 0.0f && length > 0.0f, "Bad parameters!" ); 89 89 part.shape = m_world->create_capsule( radius, length ); 90 90 part.parent_idx = pindex; 91 part.mass = table .get_float( "mass",1.0f );91 part.mass = table["mass"].get_f32( 1.0f ); 92 92 part.cone_twist = false; 93 93 // Joints 94 94 if ( pindex != -1 ) 95 95 { 96 part.cone_twist = table .get_string_hash_64("joint") == shash64( "cone_twist"_ls );97 part.limits = table .get< vec3 >( "limits");96 part.cone_twist = table["joint"].get_shash64() == shash64( "cone_twist"_ls ); 97 part.limits = table["limits"].as< vec3 >(); 98 98 } 99 99 uint32 child_count = table.get_size(); -
trunk/src/engine/resource_system.cc
r529 r539 27 27 if ( do_clear ) clear(); 28 28 lua::table_guard table( m_lua, get_storage_name() ); 29 uint32 count = table .get_unsigned( "__counter");29 uint32 count = table["__counter"].get_uint32(); 30 30 for ( auto i : range( count ) ) 31 31 { 32 32 lua::table_guard sub_table( table, i + 1 ); 33 load_resource( sub_table, sub_table.get_string_hash_64( "id" ) ); 33 shash64 id = sub_table["id"].get_shash64(); 34 load_resource( sub_table, id ); 34 35 } 35 36 } … … 39 40 m_id_hash.clear(); 40 41 lua::table_guard table( m_lua, get_storage_name() ); 41 uint32 count = table .get_unsigned( "__counter");42 uint32 count = table["__counter"].get_uint32(); 42 43 for ( auto i : range( count ) ) 43 44 { 44 45 lua::table_guard sub_table( table, i + 1 ); 45 string64 id = sub_table .get_string64( "id");46 string64 id = sub_table["id"].get_string64(); 46 47 NV_ASSERT( m_id_hash.find( id ) == m_id_hash.end(), "HASH COLLISION" ); 47 48 m_id_hash[id] = id;
Note: See TracChangeset
for help on using the changeset viewer.