]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/matlib.hxx
Random buildings - initial commit.
[simgear.git] / simgear / scene / material / matlib.hxx
index f1970985bcfba7a9899022da5c61ffc8107cca2f..7d52e5c133539857f4fa491c0ec4130b49c9d69a 100644 (file)
@@ -37,8 +37,7 @@
 #include <map>                 // STL associative "array"
 #include <vector>              // STL "array"
 
-#include <osg/Node>
-#include <osg/StateSet>
+#include <osg/Geode>
 
 class SGMaterial;
 class SGPropertyNode;
@@ -48,13 +47,20 @@ using std::map;
 using std::vector;
 using std::less;
 
+namespace simgear
+{
+class Effect;
+}
+
 // Material management class
 class SGMaterialLib {
 
 private:
 
     // associative array of materials
-    typedef map < string, SGSharedPtr<SGMaterial> > material_map;
+    typedef std::vector< SGSharedPtr<SGMaterial> > material_list;    
+    typedef material_list::iterator material_list_iterator;
+    typedef map < string,  material_list> material_map;
     typedef material_map::iterator material_map_iterator;
     typedef material_map::const_iterator const_material_map_iterator;
 
@@ -66,14 +72,8 @@ public:
     SGMaterialLib ( void );
 
     // Load a library of material properties
-    bool load( const string &fg_root, const string& mpath, const char *season,
+    bool load( const string &fg_root, const string& mpath,
             SGPropertyNode *prop_root );
-
-    // Add the named texture with default properties
-    bool add_item( const string &tex_path );
-    bool add_item( const string &mat_name, const string &tex_path );
-    bool add_item( const string &mat_name, osg::StateSet *state );
-
     // find a material record by material name
     SGMaterial *find( const string& material );
 
@@ -83,7 +83,7 @@ public:
     material_map_iterator end() { return matlib.end(); }
     const_material_map_iterator end() const { return matlib.end(); }
 
-    static const SGMaterial* findMaterial(const osg::StateSet* stateSet);
+    static const SGMaterial *findMaterial(const osg::Geode* geode);
 
     // Destructor
     ~SGMaterialLib ( void );