From: ehofman Date: Sun, 23 Oct 2005 13:47:46 +0000 (+0000) Subject: Slightly update the seasonal texture support code. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=21c64dd60fbecf31eb2ccbf99b8fcbfde8892d14;p=simgear.git Slightly update the seasonal texture support code. --- diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index 0c493ce8..a886f33e 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -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"; diff --git a/simgear/scene/material/mat.hxx b/simgear/scene/material/mat.hxx index 9c2284ef..b980a006 100644 --- a/simgear/scene/material/mat.hxx +++ b/simgear/scene/material/mat.hxx @@ -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 ); /** diff --git a/simgear/scene/material/matlib.cxx b/simgear/scene/material/matlib.cxx index 3347aa85..5ce238b5 100644 --- a/simgear/scene/material/matlib.cxx +++ b/simgear/scene/material/matlib.cxx @@ -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 ); vectornames = node->getChildren("name"); for ( unsigned int j = 0; j < names.size(); j++ ) { diff --git a/simgear/scene/material/matlib.hxx b/simgear/scene/material/matlib.hxx index 460a723c..f457d276 100644 --- a/simgear/scene/material/matlib.hxx +++ b/simgear/scene/material/matlib.hxx @@ -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 );