- Timestamp:
- 07/23/15 18:14:48 (10 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/engine/particle_engine.cc
r433 r439 302 302 void nv::particle_engine::load( lua::table_guard& table ) 303 303 { 304 s td::string id = table.get_std_string( "id" );305 if ( id == "")304 shash64 id = table.get_string_hash_64( "id" ); 305 if ( !id.valid() ) 306 306 { 307 307 NV_LOG_ERROR( "Bad table passed to particle_engine!" ) … … 355 355 { 356 356 lua::table_guard element( table, i+1 ); 357 const_string type = element.get_string( "type");358 std::string sub_type = element.get_std_string("sub_type");357 const_string type = element.get_string( "type" ); 358 const_string sub_type = element.get_string( "sub_type" ); 359 359 if ( type == "emmiter" ) 360 360 { … … 370 370 { 371 371 edata.emmiter_func = nv_particle_emmiter_point; 372 NV_LOG_WARNING( "Unknown emmiter type in particle system! (", sub_type .c_str(), ")" );372 NV_LOG_WARNING( "Unknown emmiter type in particle system! (", sub_type, ")" ); 373 373 } 374 374 … … 435 435 { 436 436 data.affector_count--; 437 NV_LOG_WARNING( "Bad data passed to ", s tring_view( sub_type.c_str(), sub_type.size() ), " affector in particle system!" );437 NV_LOG_WARNING( "Bad data passed to ", sub_type, " affector in particle system!" ); 438 438 } 439 439 } … … 441 441 { 442 442 data.affector_count--; 443 NV_LOG_WARNING( "Unknown affector type in particle system! (", s tring_view( sub_type.c_str(), sub_type.size() ), ")" );443 NV_LOG_WARNING( "Unknown affector type in particle system! (", sub_type, ")" ); 444 444 } 445 445 } … … 469 469 } 470 470 471 nv::particle_system nv::particle_engine::create_system( const st d::string& id )471 nv::particle_system nv::particle_engine::create_system( const string_view& id ) 472 472 { 473 473 auto it = m_names.find( id ); … … 823 823 } 824 824 825 void nv::particle_engine::register_emmiter_type( const st d::string& name, particle_emmiter_func func )825 void nv::particle_engine::register_emmiter_type( const string_view& name, particle_emmiter_func func ) 826 826 { 827 827 m_emmiters[ name ] = func; … … 842 842 } 843 843 844 void nv::particle_engine::register_affector_type( const st d::string& name, particle_affector_init_func init, particle_affector_func process )844 void nv::particle_engine::register_affector_type( const string_view& name, particle_affector_init_func init, particle_affector_func process ) 845 845 { 846 846 m_affectors[ name ].init = init; -
trunk/src/gl/gl_device.cc
r438 r439 212 212 for ( auto& i : *info->m_uniform_map ) 213 213 { 214 auto j = lmap.find( i.first .c_str());214 auto j = lmap.find( i.first ); 215 215 if ( j != lmap.end() ) 216 216 { … … 218 218 } 219 219 220 auto k = map.find( i.first .c_str());220 auto k = map.find( i.first ); 221 221 if ( k != map.end() ) 222 222 { … … 227 227 } 228 228 229 uniform_base* nv::gl_device::get_uniform( program p, const st d::string& name, bool fatal /*= true */ ) const229 uniform_base* nv::gl_device::get_uniform( program p, const string_view& name, bool fatal /*= true */ ) const 230 230 { 231 231 const gl_program_info* info = m_programs.get( p ); … … 238 238 if ( fatal ) 239 239 { 240 NV_LOG_CRITICAL( "gl_device : uniform '", string_view( name.c_str(), name.size() ), "' not found in program!" );240 NV_LOG_CRITICAL( "gl_device : uniform '", name, "' not found in program!" ); 241 241 NV_ABORT( "gl_device : uniform not found!" ); 242 242 } … … 245 245 } 246 246 247 int nv::gl_device::get_attribute_location( program p, const st d::string& name, bool fatal /*= true */ ) const247 int nv::gl_device::get_attribute_location( program p, const string_view& name, bool fatal /*= true */ ) const 248 248 { 249 249 const gl_program_info* info = m_programs.get( p ); … … 257 257 if ( fatal ) 258 258 { 259 NV_LOG_CRITICAL( "gl_device : attribute '", string_view( name.c_str(), name.size() ), "' not found in program!" );259 NV_LOG_CRITICAL( "gl_device : attribute '", name, "' not found in program!" ); 260 260 NV_ABORT( "gl_device : attribute not found!" ); 261 261 } … … 357 357 glGetActiveAttrib( p->glid, i, 128, &attr_nlen, &attr_len, &attr_type, name_buffer ); 358 358 359 st d::stringname( name_buffer, size_t( attr_nlen ) );359 string_view name( name_buffer, size_t( attr_nlen ) ); 360 360 361 361 // skip built-ins 362 362 if ( name.substr(0,3) == "gl_" ) continue; 363 363 364 int attr_loc = glGetAttribLocation( p->glid, name. c_str() );364 int attr_loc = glGetAttribLocation( p->glid, name.data() ); 365 365 366 366 attribute& attr = (*p->m_attribute_map)[ name ]; 367 attr.name = name;368 367 attr.location = attr_loc; 369 368 attr.type = gl_enum_to_datatype( attr_type ); … … 386 385 glGetActiveUniform( p->glid, i, 128, &uni_nlen, &uni_len, &uni_type, name_buffer ); 387 386 388 st d::stringname( name_buffer, size_t( uni_nlen ) );387 string_view name( name_buffer, size_t( uni_nlen ) ); 389 388 390 389 // skip built-ins 391 390 if ( name.substr(0,3) == "gl_" ) continue; 392 391 393 int uni_loc = glGetUniformLocation( p->glid, name. c_str() );392 int uni_loc = glGetUniformLocation( p->glid, name.data() ); 394 393 datatype utype = gl_enum_to_datatype( uni_type ); 395 394 396 395 // check for array 397 s td::string::size_typearrchar = name.find( '[' );398 if ( arrchar != st d::string::npos )396 size_t arrchar = name.find( '[' ); 397 if ( arrchar != string_view::npos ) 399 398 { 400 399 name = name.substr( 0, arrchar ); 401 400 } 402 401 403 uniform_base* u = uniform_base::create( utype, name,uni_loc, uni_len );402 uniform_base* u = uniform_base::create( utype, uni_loc, uni_len ); 404 403 NV_ASSERT( u, "Unknown uniform type!" ); 405 404 (*p->m_uniform_map)[ name ] = u;
Note: See TracChangeset
for help on using the changeset viewer.