for (unsigned int i = 0; i < textures.size(); i++)
{
string tname = textures[i]->getStringValue();
- if (strncmp(season, "summer", 6) && tname.substr(0,7) == "Terrain")
- tname.insert(7,"."+string(season));
+ string otname = tname;
+ if (season && strncmp(season, "summer", 6))
+ {
+ if (tname.substr(0,7) == "Terrain")
+ tname.insert(7,"."+string(season));
+ }
if (tname == "") {
tname = "unknown.rgb";
* state information for the material. This node is usually
* loaded from the $FG_ROOT/materials.xml file.
*/
- SGMaterial( const string &fg_root, const SGPropertyNode *props, const char *season = "summer" );
+ SGMaterial( const string &fg_root, const SGPropertyNode *props, const char *season );
/**
for (int i = 0; i < nMaterials; i++) {
const SGPropertyNode * node = materials.getChild(i);
if (!strcmp(node->getName(), "material")) {
- SGMaterial *m = new SGMaterial( fg_root, node );
+ SGMaterial *m = new SGMaterial( fg_root, node, season );
vector<SGPropertyNode_ptr>names = node->getChildren("name");
for ( unsigned int j = 0; j < names.size(); j++ ) {
SGMaterialLib ( void );
// Load a library of material properties
- bool load( const string &fg_root, const string& mpath, const char *season = "summer" );
+ bool load( const string &fg_root, const string& mpath, const char *season );
// Add the named texture with default properties
bool add_item( const string &tex_path );