Changeset 317


Ignore:
Timestamp:
08/21/14 01:38:59 (11 years ago)
Author:
epyon
Message:
  • cleaned and extended the shader lua resource interface
File:
1 edited

Legend:

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

    r316 r317  
    4747{
    4848        out = append;
    49         std::string include;
    50         if ( table.is_string( "include" ) )
     49        if ( table.is_string( "files" ) )
    5150        {
    52                 out += nv::slurp( table.get_string( "include" ) );
     51                out += nv::slurp( table.get_string( "files" ) );
     52        }
     53        else if ( table.is_table( "files" ) )
     54        {
     55                lua::table_guard inctable( table, "files" );
     56                uint32 count = inctable.get_size();
     57                for ( uint32 i = 1; i <= count; ++i )
     58                {
     59                        std::string include( inctable.get<std::string,int>(i) );
     60                        if ( i == count ) out += "#line 1\n";
     61                        out += nv::slurp( include );
     62                }
    5363        }
    5464
     
    5767                out += "#line 1\n"+nv::slurp( table.get_string( "file" ) );
    5868        }
    59         else if ( table.is_string( "source" ) )
     69
     70        if ( table.is_string( "source" ) )
    6071        {
    6172                out += table.get_string( "source" );
Note: See TracChangeset for help on using the changeset viewer.