]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/mat.cxx
Use bool instead of int to represent boolean values
[simgear.git] / simgear / scene / material / mat.cxx
index 4257ae2a6a470afb7cd8c88f72653d293698b3f8..2d488f345eb7db8da34c8bbebbba5b3a9fcdd932 100644 (file)
@@ -100,11 +100,6 @@ SGMaterial::read_properties( const string &fg_root, const SGPropertyNode * props
   {
     string tname = textures[i]->getStringValue();
     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";
@@ -145,6 +140,11 @@ SGMaterial::read_properties( const string &fg_root, const SGPropertyNode * props
   tree_height = props->getDoubleValue("tree-height-m", 0.0);
   tree_width = props->getDoubleValue("tree-width-m", 0.0);
   tree_range = props->getDoubleValue("tree-range-m", 0.0);
+  tree_varieties = props->getIntValue("tree-varieties", 1);
+
+  SGPath tpath( fg_root );
+  tpath.append(props->getStringValue("tree-texture"));
+  tree_texture = tpath.str();
 
   // surface values for use with ground reactions
   solid = props->getBoolValue("solid", true);
@@ -181,14 +181,6 @@ SGMaterial::read_properties( const string &fg_root, const SGPropertyNode * props
   for (unsigned int i = 0; i < object_group_nodes.size(); i++)
     object_groups.push_back(new SGMatModelGroup(object_group_nodes[i]));
 
-  vector<SGPropertyNode_ptr> tree_texture_nodes =
-    ((SGPropertyNode *)props)->getChildren("tree-texture");
-  for (unsigned int i = 0; i < tree_texture_nodes.size(); i++) {
-    SGPath tpath( fg_root );
-    tpath.append(tree_texture_nodes[i]->getStringValue());
-    tree_textures.push_back(tpath.str());
-  }
-
   // read glyph table for taxi-/runway-signs
   vector<SGPropertyNode_ptr> glyph_nodes = props->getChildren("glyph");
   for (unsigned int i = 0; i < glyph_nodes.size(); i++) {
@@ -311,7 +303,7 @@ void SGMaterial::set_state( osg::StateSet *s )
 }
 
 void SGMaterial::assignTexture( osg::StateSet *state, const std::string &fname,
-                 int _wrapu, int _wrapv, int _mipmap )
+                 bool _wrapu, bool _wrapv, bool _mipmap )
 {
    osg::Texture2D* texture = SGLoadTexture2D(fname, 0, _wrapu, _wrapv,
                                              mipmap ? -1 : 0);