- in >> material_name >> token;
-
- if ( token == '{' ) {
- FGNewMat m;
- in >> m;
-
- // build the ssgSimpleState
- FGPath tex_path( globals->get_options()->get_fg_root() );
- tex_path.append( "Textures.high" );
-
- FGPath tmp_path = tex_path;
- tmp_path.append( m.get_texture_name() );
- if ( ! local_file_exists(tmp_path.str())
- || general.get_glMaxTexSize() < 512 ) {
- tex_path = FGPath( globals->get_options()->get_fg_root() );
- tex_path.append( "Textures" );
- }
+ in >> material_name;
+
+ if ( material_name == "alias" ) {
+ string src_mat, dst_mat;
+ in >> dst_mat >> src_mat;
+ FG_LOG( FG_GENERAL, FG_INFO, " Material alias: " << dst_mat <<
+ " mapped to " << src_mat );
+ FGNewMat m = matlib[src_mat];
+ matlib[dst_mat] = m;
+ } else {
+ in >> token;
+
+ if ( token == '{' ) {
+ FGNewMat m;
+ in >> m;
+
+ // build the ssgSimpleState
+ FGPath tex_path( globals->get_fg_root() );
+ tex_path.append( "Textures.high" );
+
+ FGPath tmp_path = tex_path;
+ tmp_path.append( m.get_texture_name() );
+ if ( ! local_file_exists(tmp_path.str())
+ || general.get_glMaxTexSize() < 512 ) {
+ tex_path = FGPath( globals->get_fg_root() );
+ tex_path.append( "Textures" );
+ }