[pkg-fgfs-crew] [simgear] 02/04: Import an intermediate revision before 3.0.0 - as of Jan 23. fgmeta git commit f16c99683eafad4bf45d39406774ebff0c51f8f4

Markus Wanner markus_wanner-guest at moszumanska.debian.org
Thu Jan 23 18:45:48 UTC 2014


This is an automated email from the git hooks/post-receive script.

markus_wanner-guest pushed a commit to branch master
in repository simgear.

commit 383c2b1714a1d2f9b57020e716e143203877abd4
Author: Markus Wanner <markus at bluegap.ch>
Date:   Thu Jan 23 19:36:20 2014 +0100

    Import an intermediate revision before 3.0.0 - as of Jan 23.
    fgmeta git commit f16c99683eafad4bf45d39406774ebff0c51f8f4
---
 simgear/scene/material/matlib.hxx            | 5 ++++-
 simgear/scene/tgdb/obj.cxx                   | 6 +++---
 simgear/scene/util/SGReaderWriterOptions.hxx | 8 +++++---
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/simgear/scene/material/matlib.hxx b/simgear/scene/material/matlib.hxx
index 45db773..8a298b5 100644
--- a/simgear/scene/material/matlib.hxx
+++ b/simgear/scene/material/matlib.hxx
@@ -27,6 +27,7 @@
 
 #include <simgear/compiler.h>
 
+#include <simgear/structure/SGReferenced.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
 
 #include <memory>
@@ -41,7 +42,8 @@ namespace simgear { class Effect; }
 namespace osg { class Geode; }
 
 // Material management class
-class SGMaterialLib {
+class SGMaterialLib : public SGReferenced
+{
 
 private:
     class MatLibPrivate;
@@ -99,5 +101,6 @@ public:
     ~SGMaterialLib ( void );
 };
 
+typedef SGSharedPtr<SGMaterialLib> SGMaterialLibPtr;
 
 #endif // _MATLIB_HXX 
diff --git a/simgear/scene/tgdb/obj.cxx b/simgear/scene/tgdb/obj.cxx
index b5d6dd7..edb35f2 100644
--- a/simgear/scene/tgdb/obj.cxx
+++ b/simgear/scene/tgdb/obj.cxx
@@ -905,7 +905,7 @@ public:
     // Generate all the lighting objects for the tile.
     osg::LOD* generateLightingTileObjects()
     {
-      SGMaterialLib* matlib = NULL;
+      SGMaterialLibPtr matlib;
 
       if (_options)
         matlib = _options->getMaterialLib();
@@ -1046,7 +1046,7 @@ public:
     // Generate all the random forest, objects and buildings for the tile
     osg::LOD* generateRandomTileObjects()
     {
-      SGMaterialLib* matlib = NULL;
+      SGMaterialLibPtr matlib;
       bool use_random_objects = false;
       bool use_random_vegetation = false;
       bool use_random_buildings = false;
@@ -1181,7 +1181,7 @@ SGLoadBTG(const std::string& path, const simgear::SGReaderWriterOptions* options
     if (!tile.read_bin(path))
       return NULL;
 
-    SGMaterialLib* matlib = 0;
+    SGMaterialLibPtr matlib;
 
     if (options) {
       matlib = options->getMaterialLib();
diff --git a/simgear/scene/util/SGReaderWriterOptions.hxx b/simgear/scene/util/SGReaderWriterOptions.hxx
index 2a4b983..6426213 100644
--- a/simgear/scene/util/SGReaderWriterOptions.hxx
+++ b/simgear/scene/util/SGReaderWriterOptions.hxx
@@ -22,10 +22,12 @@
 
 #include <osgDB/Options>
 #include <simgear/scene/model/modellib.hxx>
+#include <simgear/scene/material/matlib.hxx>
+
 #include <simgear/props/props.hxx>
 
 class SGPropertyNode;
-class SGMaterialLib;
+
 
 namespace simgear
 {
@@ -70,7 +72,7 @@ public:
     void setPropertyNode(const SGSharedPtr<SGPropertyNode>& propertyNode)
     { _propertyNode = propertyNode; }
 
-    SGMaterialLib* getMaterialLib() const
+    SGMaterialLibPtr getMaterialLib() const
     { return _materialLib; }
     void setMaterialLib(SGMaterialLib* materialLib)
     { _materialLib = materialLib; }
@@ -100,7 +102,7 @@ protected:
 
 private:
     SGSharedPtr<SGPropertyNode> _propertyNode;
-    SGMaterialLib* _materialLib;
+    SGSharedPtr<SGMaterialLib> _materialLib;
     osg::Node *(*_load_panel)(SGPropertyNode *);
     osg::ref_ptr<SGModelData> _model_data;
     bool _instantiateEffects;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/simgear.git



More information about the pkg-fgfs-crew mailing list