#include <simgear/compiler.h>
+#include <simgear/structure/SGReferenced.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
#include <memory>
namespace osg { class Geode; }
// Material management class
-class SGMaterialLib {
+class SGMaterialLib : public SGReferenced
+{
private:
class MatLibPrivate;
~SGMaterialLib ( void );
};
+typedef SGSharedPtr<SGMaterialLib> SGMaterialLibPtr;
#endif // _MATLIB_HXX
// Generate all the lighting objects for the tile.
osg::LOD* generateLightingTileObjects()
{
- SGMaterialLib* matlib = NULL;
+ SGMaterialLibPtr matlib;
if (_options)
matlib = _options->getMaterialLib();
// 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;
if (!tile.read_bin(path))
return NULL;
- SGMaterialLib* matlib = 0;
+ SGMaterialLibPtr matlib;
if (options) {
matlib = options->getMaterialLib();
#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
{
void setPropertyNode(const SGSharedPtr<SGPropertyNode>& propertyNode)
{ _propertyNode = propertyNode; }
- SGMaterialLib* getMaterialLib() const
+ SGMaterialLibPtr getMaterialLib() const
{ return _materialLib; }
void setMaterialLib(SGMaterialLib* materialLib)
{ _materialLib = materialLib; }
private:
SGSharedPtr<SGPropertyNode> _propertyNode;
- SGMaterialLib* _materialLib;
+ SGSharedPtr<SGMaterialLib> _materialLib;
osg::Node *(*_load_panel)(SGPropertyNode *);
osg::ref_ptr<SGModelData> _model_data;
bool _instantiateEffects;