Changeset 439 for trunk/src/engine


Ignore:
Timestamp:
07/23/15 18:14:48 (10 years ago)
Author:
epyon
Message:
  • more std::string removal
File:
1 edited

Legend:

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

    r433 r439  
    302302void nv::particle_engine::load( lua::table_guard& table )
    303303{
    304         std::string id = table.get_std_string( "id" );
    305         if ( id == "" )
     304        shash64 id = table.get_string_hash_64( "id" );
     305        if ( !id.valid() )
    306306        {
    307307                NV_LOG_ERROR( "Bad table passed to particle_engine!" )
     
    355355        {
    356356                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" );
    359359                if ( type == "emmiter" )
    360360                {
     
    370370                                {
    371371                                        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, ")" );
    373373                                }
    374374
     
    435435                                        {
    436436                                                data.affector_count--;
    437                                                 NV_LOG_WARNING( "Bad data passed to ", string_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!" );
    438438                                        }
    439439                                }
     
    441441                                {
    442442                                        data.affector_count--;
    443                                         NV_LOG_WARNING( "Unknown affector type in particle system! (", string_view( sub_type.c_str(), sub_type.size() ), ")" );
     443                                        NV_LOG_WARNING( "Unknown affector type in particle system! (", sub_type, ")" );
    444444                                }
    445445                        }
     
    469469}
    470470
    471 nv::particle_system nv::particle_engine::create_system( const std::string& id )
     471nv::particle_system nv::particle_engine::create_system( const string_view& id )
    472472{
    473473        auto it = m_names.find( id );
     
    823823}
    824824
    825 void nv::particle_engine::register_emmiter_type( const std::string& name, particle_emmiter_func func )
     825void nv::particle_engine::register_emmiter_type( const string_view& name, particle_emmiter_func func )
    826826{
    827827        m_emmiters[ name ] = func;
     
    842842}
    843843
    844 void nv::particle_engine::register_affector_type( const std::string& name, particle_affector_init_func init, particle_affector_func process )
     844void nv::particle_engine::register_affector_type( const string_view& name, particle_affector_init_func init, particle_affector_func process )
    845845{
    846846        m_affectors[ name ].init    = init;
Note: See TracChangeset for help on using the changeset viewer.