1
0
Fork 0

Added an --materials-file option to select the materials file to use at startup.

The property /sim/rendering/materials-file can also be used for this purpose.
This commit is contained in:
Anders Gidenstam 2011-09-02 20:26:55 +02:00
parent 77e844a78d
commit a2972051a9
3 changed files with 8 additions and 4 deletions

View file

@ -1362,10 +1362,11 @@ bool fgInitSubsystems() {
////////////////////////////////////////////////////////////////////
SGPath mpath( globals->get_fg_root() );
mpath.append( "materials.xml" );
mpath.append( fgGetString("/sim/rendering/materials-file") );
if ( ! globals->get_matlib()->load(globals->get_fg_root(), mpath.str(),
globals->get_props()) ) {
SG_LOG( SG_GENERAL, SG_ALERT, "Error loading material lib!" );
SG_LOG( SG_GENERAL, SG_ALERT,
"Error loading materials file " << mpath.str() );
exit(-1);
}

View file

@ -209,10 +209,11 @@ fgviewerMain(int argc, char** argv)
// Initialize the material property subsystem.
SGPath mpath( globals->get_fg_root() );
mpath.append( "materials.xml" );
mpath.append( fgGetString("/sim/rendering/materials-file") );
if ( ! globals->get_matlib()->load(globals->get_fg_root(), mpath.str(),
globals->get_props()) ) {
SG_LOG( SG_GENERAL, SG_ALERT, "Error loading material lib!" );
SG_LOG( SG_GENERAL, SG_ALERT,
"Error loading materials file " << mpath.str() );
exit(-1);
}

View file

@ -215,6 +215,7 @@ fgSetDefaults ()
fgSetBool("/sim/rendering/enhanced-lighting", false);
fgSetBool("/sim/rendering/distance-attenuation", false);
fgSetBool("/sim/rendering/specular-highlight", true);
fgSetString("/sim/rendering/materials-file", "materials.xml");
fgSetInt("/sim/startup/xsize", 800);
fgSetInt("/sim/startup/ysize", 600);
fgSetInt("/sim/rendering/bits-per-pixel", 16);
@ -1407,6 +1408,7 @@ struct OptionDesc {
{"texture-filtering", false, OPTION_INT, "/sim/rendering/filtering", 1, "", 0 },
{"disable-wireframe", false, OPTION_BOOL, "/sim/rendering/wireframe", false, "", 0 },
{"enable-wireframe", false, OPTION_BOOL, "/sim/rendering/wireframe", true, "", 0 },
{"materials-file", true, OPTION_STRING, "/sim/rendering/materials-file", false, "", 0 },
{"disable-terrasync", false, OPTION_BOOL, "/sim/terrasync/enabled", false, "", 0 },
{"enable-terrasync", false, OPTION_BOOL, "/sim/terrasync/enabled", true, "", 0 },
{"terrasync-dir", true, OPTION_STRING, "/sim/terrasync/scenery-dir", false, "", 0 },