Slightly update the seasonal texture support code.
This commit is contained in:
@@ -94,8 +94,12 @@ SGMaterial::read_properties( const string &fg_root, const SGPropertyNode * props
|
||||
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";
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
* 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 );
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -192,7 +192,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath, const char
|
||||
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++ ) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
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 );
|
||||
|
||||
Reference in New Issue
Block a user