Replace osgDB::ReaderWriter::Options to osgDB::Options.

This has changed in osg, so reflect that here.
This commit is contained in:
Mathias Froehlich 2012-03-04 07:07:42 +01:00
parent 8c78588ee1
commit 11fd888ed8
33 changed files with 71 additions and 71 deletions

View File

@ -96,7 +96,7 @@ SGMaterial::SGMaterial( const SGReaderWriterOptions* options,
buildEffectProperties(options); buildEffectProperties(options);
} }
SGMaterial::SGMaterial( const osgDB::ReaderWriter::Options* options, SGMaterial::SGMaterial( const osgDB::Options* options,
const SGPropertyNode *props, const SGPropertyNode *props,
SGPropertyNode *prop_root) SGPropertyNode *prop_root)
{ {

View File

@ -89,7 +89,7 @@ public:
* state information for the material. This node is usually * state information for the material. This node is usually
* loaded from the $FG_ROOT/materials.xml file. * loaded from the $FG_ROOT/materials.xml file.
*/ */
SGMaterial( const osgDB::ReaderWriter::Options*, SGMaterial( const osgDB::Options*,
const SGPropertyNode *props, const SGPropertyNode *props,
SGPropertyNode *prop_root); SGPropertyNode *prop_root);

View File

@ -67,9 +67,9 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath,
<< ex.getMessage() ); << ex.getMessage() );
throw; throw;
} }
osg::ref_ptr<osgDB::ReaderWriter::Options> options osg::ref_ptr<osgDB::Options> options
= new osgDB::ReaderWriter::Options; = new osgDB::Options;
options->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL); options->setObjectCacheHint(osgDB::Options::CACHE_ALL);
options->setDatabasePath(fg_root); options->setDatabasePath(fg_root);
int nMaterials = materials.nChildren(); int nMaterials = materials.nChildren();
for (int i = 0; i < nMaterials; i++) { for (int i = 0; i < nMaterials; i++) {

View File

@ -193,7 +193,7 @@ public:
} // namespace } // namespace
Node* DefaultProcessPolicy::process(Node* node, const string& filename, Node* DefaultProcessPolicy::process(Node* node, const string& filename,
const ReaderWriter::Options* opt) const Options* opt)
{ {
TextureNameVisitor nameVisitor; TextureNameVisitor nameVisitor;
node->accept(nameVisitor); node->accept(nameVisitor);
@ -202,7 +202,7 @@ Node* DefaultProcessPolicy::process(Node* node, const string& filename,
ReaderWriter::ReadResult ReaderWriter::ReadResult
ModelRegistry::readImage(const string& fileName, ModelRegistry::readImage(const string& fileName,
const ReaderWriter::Options* opt) const Options* opt)
{ {
CallbackMap::iterator iter CallbackMap::iterator iter
= imageCallbackMap.find(getFileExtension(fileName)); = imageCallbackMap.find(getFileExtension(fileName));
@ -300,7 +300,7 @@ ModelRegistry::readImage(const string& fileName,
osg::Node* DefaultCachePolicy::find(const string& fileName, osg::Node* DefaultCachePolicy::find(const string& fileName,
const ReaderWriter::Options* opt) const Options* opt)
{ {
Registry* registry = Registry::instance(); Registry* registry = Registry::instance();
osg::Node* cached osg::Node* cached
@ -342,7 +342,7 @@ OptimizeModelPolicy::OptimizeModelPolicy(const string& extension) :
osg::Node* OptimizeModelPolicy::optimize(osg::Node* node, osg::Node* OptimizeModelPolicy::optimize(osg::Node* node,
const string& fileName, const string& fileName,
const osgDB::ReaderWriter::Options* opt) const osgDB::Options* opt)
{ {
osgUtil::Optimizer optimizer; osgUtil::Optimizer optimizer;
optimizer.optimize(node, _osgOptions); optimizer.optimize(node, _osgOptions);
@ -358,7 +358,7 @@ osg::Node* OptimizeModelPolicy::optimize(osg::Node* node,
} }
string OSGSubstitutePolicy::substitute(const string& name, string OSGSubstitutePolicy::substitute(const string& name,
const ReaderWriter::Options* opt) const Options* opt)
{ {
string fileSansExtension = getNameLessExtension(name); string fileSansExtension = getNameLessExtension(name);
string osgFileName = fileSansExtension + ".osg"; string osgFileName = fileSansExtension + ".osg";
@ -413,7 +413,7 @@ ModelRegistry::addNodeCallbackForExtension(const string& extension,
ReaderWriter::ReadResult ReaderWriter::ReadResult
ModelRegistry::readNode(const string& fileName, ModelRegistry::readNode(const string& fileName,
const ReaderWriter::Options* opt) const Options* opt)
{ {
ReaderWriter::ReadResult res; ReaderWriter::ReadResult res;
CallbackMap::iterator iter CallbackMap::iterator iter
@ -436,10 +436,10 @@ public:
Referenced::setThreadSafeReferenceCounting(true); Referenced::setThreadSafeReferenceCounting(true);
Registry* registry = Registry::instance(); Registry* registry = Registry::instance();
ReaderWriter::Options* options = new ReaderWriter::Options; Options* options = new Options;
int cacheOptions = ReaderWriter::Options::CACHE_ALL; int cacheOptions = Options::CACHE_ALL;
options-> options->
setObjectCacheHint((ReaderWriter::Options::CacheHintOptions)cacheOptions); setObjectCacheHint((Options::CacheHintOptions)cacheOptions);
registry->setOptions(options); registry->setOptions(options);
registry->getOrCreateSharedStateManager()-> registry->getOrCreateSharedStateManager()->
setShareMode(SharedStateManager::SHARE_STATESETS); setShareMode(SharedStateManager::SHARE_STATESETS);
@ -457,7 +457,7 @@ struct ACOptimizePolicy : public OptimizeModelPolicy {
_osgOptions &= ~Optimizer::TRISTRIP_GEOMETRY; _osgOptions &= ~Optimizer::TRISTRIP_GEOMETRY;
} }
Node* optimize(Node* node, const string& fileName, Node* optimize(Node* node, const string& fileName,
const ReaderWriter::Options* opt) const Options* opt)
{ {
ref_ptr<Node> optimized ref_ptr<Node> optimized
= OptimizeModelPolicy::optimize(node, fileName, opt); = OptimizeModelPolicy::optimize(node, fileName, opt);
@ -484,7 +484,7 @@ struct ACOptimizePolicy : public OptimizeModelPolicy {
struct ACProcessPolicy { struct ACProcessPolicy {
ACProcessPolicy(const string& extension) {} ACProcessPolicy(const string& extension) {}
Node* process(Node* node, const string& filename, Node* process(Node* node, const string& filename,
const ReaderWriter::Options* opt) const Options* opt)
{ {
Matrix m(1, 0, 0, 0, Matrix m(1, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0,

View File

@ -70,7 +70,7 @@ public:
} }
virtual osgDB::ReaderWriter::ReadResult virtual osgDB::ReaderWriter::ReadResult
readNode(const std::string& fileName, readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* opt) const osgDB::Options* opt)
{ {
using namespace osg; using namespace osg;
using namespace osgDB; using namespace osgDB;
@ -103,7 +103,7 @@ public:
protected: protected:
static osgDB::ReaderWriter::ReadResult static osgDB::ReaderWriter::ReadResult
loadUsingReaderWriter(const std::string& fileName, loadUsingReaderWriter(const std::string& fileName,
const osgDB::ReaderWriter::Options* opt) const osgDB::Options* opt)
{ {
using namespace osgDB; using namespace osgDB;
ReaderWriter* rw = Registry::instance() ReaderWriter* rw = Registry::instance()
@ -126,20 +126,20 @@ protected:
struct DefaultProcessPolicy { struct DefaultProcessPolicy {
DefaultProcessPolicy(const std::string& extension) {} DefaultProcessPolicy(const std::string& extension) {}
osg::Node* process(osg::Node* node, const std::string& filename, osg::Node* process(osg::Node* node, const std::string& filename,
const osgDB::ReaderWriter::Options* opt); const osgDB::Options* opt);
}; };
struct DefaultCachePolicy { struct DefaultCachePolicy {
DefaultCachePolicy(const std::string& extension) {} DefaultCachePolicy(const std::string& extension) {}
osg::Node* find(const std::string& fileName, osg::Node* find(const std::string& fileName,
const osgDB::ReaderWriter::Options* opt); const osgDB::Options* opt);
void addToCache(const std::string& filename, osg::Node* node); void addToCache(const std::string& filename, osg::Node* node);
}; };
struct NoCachePolicy { struct NoCachePolicy {
NoCachePolicy(const std::string& extension) {} NoCachePolicy(const std::string& extension) {}
osg::Node* find(const std::string& fileName, osg::Node* find(const std::string& fileName,
const osgDB::ReaderWriter::Options* opt) const osgDB::Options* opt)
{ {
return 0; return 0;
} }
@ -150,7 +150,7 @@ class OptimizeModelPolicy {
public: public:
OptimizeModelPolicy(const std::string& extension); OptimizeModelPolicy(const std::string& extension);
osg::Node* optimize(osg::Node* node, const std::string& fileName, osg::Node* optimize(osg::Node* node, const std::string& fileName,
const osgDB::ReaderWriter::Options* opt); const osgDB::Options* opt);
protected: protected:
unsigned _osgOptions; unsigned _osgOptions;
}; };
@ -158,7 +158,7 @@ protected:
struct NoOptimizePolicy { struct NoOptimizePolicy {
NoOptimizePolicy(const std::string& extension) {} NoOptimizePolicy(const std::string& extension) {}
osg::Node* optimize(osg::Node* node, const std::string& fileName, osg::Node* optimize(osg::Node* node, const std::string& fileName,
const osgDB::ReaderWriter::Options* opt) const osgDB::Options* opt)
{ {
return node; return node;
} }
@ -167,13 +167,13 @@ struct NoOptimizePolicy {
struct OSGSubstitutePolicy { struct OSGSubstitutePolicy {
OSGSubstitutePolicy(const std::string& extension) {} OSGSubstitutePolicy(const std::string& extension) {}
std::string substitute(const std::string& name, std::string substitute(const std::string& name,
const osgDB::ReaderWriter::Options* opt); const osgDB::Options* opt);
}; };
struct NoSubstitutePolicy { struct NoSubstitutePolicy {
NoSubstitutePolicy(const std::string& extension) {} NoSubstitutePolicy(const std::string& extension) {}
std::string substitute(const std::string& name, std::string substitute(const std::string& name,
const osgDB::ReaderWriter::Options* opt) const osgDB::Options* opt)
{ {
return std::string(); return std::string();
} }
@ -206,10 +206,10 @@ public:
ModelRegistry(); ModelRegistry();
virtual osgDB::ReaderWriter::ReadResult virtual osgDB::ReaderWriter::ReadResult
readImage(const std::string& fileName, readImage(const std::string& fileName,
const osgDB::ReaderWriter::Options* opt); const osgDB::Options* opt);
virtual osgDB::ReaderWriter::ReadResult virtual osgDB::ReaderWriter::ReadResult
readNode(const std::string& fileName, readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* opt); const osgDB::Options* opt);
void addImageCallbackForExtension(const std::string& extension, void addImageCallbackForExtension(const std::string& extension,
osgDB::Registry::ReadFileCallback* osgDB::Registry::ReadFileCallback*
callback); callback);

View File

@ -412,7 +412,7 @@ private:
SGMaterialAnimation::SGMaterialAnimation(const SGPropertyNode* configNode, SGMaterialAnimation::SGMaterialAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::ReaderWriter::Options* const osgDB::Options*
options) : options) :
SGAnimation(configNode, modelRoot), SGAnimation(configNode, modelRoot),
texturePathList(options->getDatabasePathList()) texturePathList(options->getDatabasePathList())

View File

@ -23,7 +23,7 @@ class SGMaterialAnimation : public SGAnimation {
public: public:
SGMaterialAnimation(const SGPropertyNode* configNode, SGMaterialAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::ReaderWriter::Options* options); const osgDB::Options* options);
virtual osg::Group* createAnimationGroup(osg::Group& parent); virtual osg::Group* createAnimationGroup(osg::Group& parent);
virtual void install(osg::Node& node); virtual void install(osg::Node& node);
static SGPropertyNode_ptr makeEffectProperties(const SGPropertyNode* animProp); static SGPropertyNode_ptr makeEffectProperties(const SGPropertyNode* animProp);

View File

@ -58,7 +58,7 @@ using namespace osg;
static osg::Node * static osg::Node *
sgLoad3DModel_internal(const SGPath& path, sgLoad3DModel_internal(const SGPath& path,
const osgDB::ReaderWriter::Options* options, const osgDB::Options* options,
SGPropertyNode *overlay = 0); SGPropertyNode *overlay = 0);
@ -78,7 +78,7 @@ const char* SGReaderWriterXML::className() const
osgDB::ReaderWriter::ReadResult osgDB::ReaderWriter::ReadResult
SGReaderWriterXML::readNode(const std::string& fileName, SGReaderWriterXML::readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* options) const const osgDB::Options* options) const
{ {
osg::Node *result=0; osg::Node *result=0;
try { try {
@ -200,7 +200,7 @@ void makeEffectAnimations(PropertyList& animation_nodes,
static osg::Node * static osg::Node *
sgLoad3DModel_internal(const SGPath& path, sgLoad3DModel_internal(const SGPath& path,
const osgDB::ReaderWriter::Options* options_, const osgDB::Options* options_,
SGPropertyNode *overlay) SGPropertyNode *overlay)
{ {
if (!path.exists()) { if (!path.exists()) {

View File

@ -33,7 +33,7 @@ public:
virtual const char* className() const; virtual const char* className() const;
virtual ReadResult readNode(const std::string& fileName, virtual ReadResult readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* options) const osgDB::Options* options)
const; const;
}; };

View File

@ -84,7 +84,7 @@ void SGText::UpdateCallback::operator()(osg::Node * node, osg::NodeVisitor *nv )
} }
osg::Node * SGText::appendText(const SGPropertyNode* configNode, osg::Node * SGText::appendText(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, const osgDB::ReaderWriter::Options* options) SGPropertyNode* modelRoot, const osgDB::Options* options)
{ {
SGConstPropertyNode_ptr p; SGConstPropertyNode_ptr p;

View File

@ -27,7 +27,7 @@
class SGText : public osg::NodeCallback class SGText : public osg::NodeCallback
{ {
public: public:
static osg::Node * appendText(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const osgDB::ReaderWriter::Options* options); static osg::Node * appendText(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const osgDB::Options* options);
private: private:
class UpdateCallback; class UpdateCallback;
}; };

View File

@ -410,7 +410,7 @@ SGAnimation::~SGAnimation()
bool bool
SGAnimation::animate(osg::Node* node, const SGPropertyNode* configNode, SGAnimation::animate(osg::Node* node, const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::ReaderWriter::Options* options) const osgDB::Options* options)
{ {
std::string type = configNode->getStringValue("type", "none"); std::string type = configNode->getStringValue("type", "none");
if (type == "alpha-test") { if (type == "alpha-test") {

View File

@ -46,7 +46,7 @@ public:
static bool animate(osg::Node* node, const SGPropertyNode* configNode, static bool animate(osg::Node* node, const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::ReaderWriter::Options* options); const osgDB::Options* options);
protected: protected:
void apply(osg::Node* node); void apply(osg::Node* node);
@ -321,7 +321,7 @@ class SGShaderAnimation : public SGAnimation {
public: public:
SGShaderAnimation(const SGPropertyNode* configNode, SGShaderAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::ReaderWriter::Options* options); const osgDB::Options* options);
virtual osg::Group* createAnimationGroup(osg::Group& parent); virtual osg::Group* createAnimationGroup(osg::Group& parent);
private: private:
class UpdateCallback; class UpdateCallback;

View File

@ -39,7 +39,7 @@ using std::vector;
osg::Texture2D* osg::Texture2D*
SGLoadTexture2D(bool staticTexture, const std::string& path, SGLoadTexture2D(bool staticTexture, const std::string& path,
const osgDB::ReaderWriter::Options* options, const osgDB::Options* options,
bool wrapu, bool wrapv, int) bool wrapu, bool wrapv, int)
{ {
osg::Image* image; osg::Image* image;

View File

@ -30,12 +30,12 @@ class SGReaderWriterOptions;
osg::Texture2D* osg::Texture2D*
SGLoadTexture2D(bool staticTexture, const std::string& path, SGLoadTexture2D(bool staticTexture, const std::string& path,
const osgDB::ReaderWriter::Options* options = 0, const osgDB::Options* options = 0,
bool wrapu = true, bool wrapv = true, int mipmaplevels = -1); bool wrapu = true, bool wrapv = true, int mipmaplevels = -1);
inline osg::Texture2D* inline osg::Texture2D*
SGLoadTexture2D(const std::string& path, SGLoadTexture2D(const std::string& path,
const osgDB::ReaderWriter::Options* options = 0, const osgDB::Options* options = 0,
bool wrapu = true, bool wrapv = true, int mipmaplevels = -1) bool wrapu = true, bool wrapv = true, int mipmaplevels = -1)
{ {
return SGLoadTexture2D(true, path, options, wrapu, wrapv, mipmaplevels); return SGLoadTexture2D(true, path, options, wrapu, wrapv, mipmaplevels);
@ -43,7 +43,7 @@ SGLoadTexture2D(const std::string& path,
inline osg::Texture2D* inline osg::Texture2D*
SGLoadTexture2D(const SGPath& path, SGLoadTexture2D(const SGPath& path,
const osgDB::ReaderWriter::Options* options = 0, const osgDB::Options* options = 0,
bool wrapu = true, bool wrapv = true, bool wrapu = true, bool wrapv = true,
int mipmaplevels = -1) int mipmaplevels = -1)
{ {
@ -53,7 +53,7 @@ SGLoadTexture2D(const SGPath& path,
inline osg::Texture2D* inline osg::Texture2D*
SGLoadTexture2D(bool staticTexture, const SGPath& path, SGLoadTexture2D(bool staticTexture, const SGPath& path,
const osgDB::ReaderWriter::Options* options = 0, const osgDB::Options* options = 0,
bool wrapu = true, bool wrapv = true, bool wrapu = true, bool wrapv = true,
int mipmaplevels = -1) int mipmaplevels = -1)
{ {

View File

@ -65,7 +65,7 @@ void SGModelLib::setPanelFunc(panel_func pf)
} }
std::string SGModelLib::findDataFile(const std::string& file, std::string SGModelLib::findDataFile(const std::string& file,
const osgDB::ReaderWriter::Options* opts, const osgDB::Options* opts,
SGPath currentPath) SGPath currentPath)
{ {
if (file.empty()) if (file.empty())
@ -141,9 +141,9 @@ SGModelLib::loadDeferredModel(const string &path, SGPropertyNode *prop_root,
if (SGPath(path).lower_extension() == "ac") if (SGPath(path).lower_extension() == "ac")
opt->setInstantiateEffects(true); opt->setInstantiateEffects(true);
if (!prop_root || prop_root->getBoolValue("/sim/rendering/cache", true)) if (!prop_root || prop_root->getBoolValue("/sim/rendering/cache", true))
opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL); opt->setObjectCacheHint(osgDB::Options::CACHE_ALL);
else else
opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE); opt->setObjectCacheHint(osgDB::Options::CACHE_NONE);
proxyNode->setDatabaseOptions(opt.get()); proxyNode->setDatabaseOptions(opt.get());
return proxyNode; return proxyNode;
@ -167,9 +167,9 @@ SGModelLib::loadPagedModel(const string &path, SGPropertyNode *prop_root,
if (SGPath(path).lower_extension() == "ac") if (SGPath(path).lower_extension() == "ac")
opt->setInstantiateEffects(true); opt->setInstantiateEffects(true);
if (!prop_root || prop_root->getBoolValue("/sim/rendering/cache", true)) if (!prop_root || prop_root->getBoolValue("/sim/rendering/cache", true))
opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL); opt->setObjectCacheHint(osgDB::Options::CACHE_ALL);
else else
opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE); opt->setObjectCacheHint(osgDB::Options::CACHE_NONE);
plod->setDatabaseOptions(opt.get()); plod->setDatabaseOptions(opt.get());
return plod; return plod;
} }

View File

@ -71,7 +71,7 @@ public:
SGModelData *data=0); SGModelData *data=0);
static std::string findDataFile(const std::string& file, static std::string findDataFile(const std::string& file,
const osgDB::ReaderWriter::Options* opts = NULL, const osgDB::Options* opts = NULL,
SGPath currentDir = SGPath()); SGPath currentDir = SGPath());
protected: protected:
SGModelLib(); SGModelLib();

View File

@ -135,7 +135,7 @@ void transformParticles(osgParticle::ParticleSystem* particleSys,
osg::Group * Particles::appendParticles(const SGPropertyNode* configNode, osg::Group * Particles::appendParticles(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::ReaderWriter::Options* const osgDB::Options*
options) options)
{ {
SG_LOG(SG_GENERAL, SG_DEBUG, "Setting up a particle system!\n"); SG_LOG(SG_GENERAL, SG_DEBUG, "Setting up a particle system!\n");

View File

@ -111,7 +111,7 @@ class Particles : public osg::NodeCallback
public: public:
Particles(); Particles();
static osg::Group * appendParticles(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const osgDB::ReaderWriter::Options* options); static osg::Group * appendParticles(const SGPropertyNode* configNode, SGPropertyNode* modelRoot, const osgDB::Options* options);
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);

View File

@ -187,7 +187,7 @@ static void create_specular_highlights(osg::Node *node)
SGShaderAnimation::SGShaderAnimation(const SGPropertyNode* configNode, SGShaderAnimation::SGShaderAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::ReaderWriter::Options* const osgDB::Options*
options) : options) :
SGAnimation(configNode, modelRoot) SGAnimation(configNode, modelRoot)
{ {

View File

@ -94,7 +94,7 @@ SGMakeState(const SGPath &path, const char* colorTexture,
{ {
osg::StateSet *stateSet = new osg::StateSet; osg::StateSet *stateSet = new osg::StateSet;
osg::ref_ptr<osgDB::ReaderWriter::Options> options osg::ref_ptr<osgDB::Options> options
= makeOptionsFromPath(path); = makeOptionsFromPath(path);
stateSet->setTextureAttribute(0, SGLoadTexture2D(colorTexture, stateSet->setTextureAttribute(0, SGLoadTexture2D(colorTexture,
options.get())); options.get()));

View File

@ -78,7 +78,7 @@ SGMoon::build( SGPath path, double moon_size ) {
stateSet->setRenderBinDetails(-5, "RenderBin"); stateSet->setRenderBinDetails(-5, "RenderBin");
// set up the orb state // set up the orb state
osg::ref_ptr<osgDB::ReaderWriter::Options> options osg::ref_ptr<osgDB::Options> options
= makeOptionsFromPath(path); = makeOptionsFromPath(path);
osg::Texture2D* texture = SGLoadTexture2D("moon.png", options.get()); osg::Texture2D* texture = SGLoadTexture2D("moon.png", options.get());

View File

@ -110,7 +110,7 @@ SGNewCloud::SGNewCloud(const SGPath &texture_root, const SGPropertyNode *cld_def
"texture"), "texture"),
"image"), "image"),
texture); texture);
ref_ptr<osgDB::ReaderWriter::Options> options ref_ptr<osgDB::Options> options
= makeOptionsFromPath(texture_root); = makeOptionsFromPath(texture_root);
ref_ptr<SGReaderWriterOptions> sgOptions ref_ptr<SGReaderWriterOptions> sgOptions
= new SGReaderWriterOptions(*options.get()); = new SGReaderWriterOptions(*options.get());

View File

@ -69,7 +69,7 @@ SGSun::build( SGPath path, double sun_size, SGPropertyNode *property_tree_Node )
env_node = property_tree_Node; env_node = property_tree_Node;
osg::ref_ptr<osgDB::ReaderWriter::Options> options osg::ref_ptr<osgDB::Options> options
= makeOptionsFromPath(path); = makeOptionsFromPath(path);
// build the ssg scene graph sub tree for the sky and connected // build the ssg scene graph sub tree for the sky and connected
// into the provide scene graph branch // into the provide scene graph branch

View File

@ -54,7 +54,7 @@ const char* ReaderWriterSTG::className() const
osgDB::ReaderWriter::ReadResult osgDB::ReaderWriter::ReadResult
ReaderWriterSTG::readNode(const std::string& fileName, ReaderWriterSTG::readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* options) const const osgDB::Options* options) const
{ {
osg::Node* result = TileEntry::loadTileByFileName(fileName, options); osg::Node* result = TileEntry::loadTileByFileName(fileName, options);
// For debugging race conditions // For debugging race conditions

View File

@ -34,7 +34,7 @@ public:
virtual const char* className() const; virtual const char* className() const;
virtual ReadResult readNode(const std::string& fileName, virtual ReadResult readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* options) const osgDB::Options* options)
const; const;
}; };

View File

@ -57,7 +57,7 @@ SGReaderWriterBTG::acceptsExtension(const std::string& extension) const
osgDB::ReaderWriter::ReadResult osgDB::ReaderWriter::ReadResult
SGReaderWriterBTG::readNode(const std::string& fileName, SGReaderWriterBTG::readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* options) const const osgDB::Options* options) const
{ {
const SGReaderWriterOptions* sgOptions; const SGReaderWriterOptions* sgOptions;
sgOptions = dynamic_cast<const SGReaderWriterOptions*>(options); sgOptions = dynamic_cast<const SGReaderWriterOptions*>(options);

View File

@ -30,7 +30,7 @@ public:
virtual bool acceptsExtension(const std::string& /*extension*/) const; virtual bool acceptsExtension(const std::string& /*extension*/) const;
virtual ReadResult readNode(const std::string& fileName, virtual ReadResult readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* options) const osgDB::Options* options)
const; const;
}; };

View File

@ -131,7 +131,7 @@ void TileEntry::prep_ssg_node(float vis) {
} }
bool TileEntry::obj_load(const string& path, osg::Group *geometry, bool is_base, bool TileEntry::obj_load(const string& path, osg::Group *geometry, bool is_base,
const osgDB::ReaderWriter::Options* options) const osgDB::Options* options)
{ {
osg::Node* node = osgDB::readNodeFile(path, options); osg::Node* node = osgDB::readNodeFile(path, options);
if (node) if (node)
@ -178,7 +178,7 @@ struct Object {
osg::Node* osg::Node*
TileEntry::loadTileByFileName(const string& fileName, TileEntry::loadTileByFileName(const string& fileName,
const osgDB::ReaderWriter::Options* options) const osgDB::Options* options)
{ {
std::string index_str = osgDB::getNameLessExtension(fileName); std::string index_str = osgDB::getNameLessExtension(fileName);
index_str = osgDB::getSimpleFileName(index_str); index_str = osgDB::getSimpleFileName(index_str);

View File

@ -71,7 +71,7 @@ private:
static bool obj_load( const std::string& path, static bool obj_load( const std::string& path,
osg::Group* geometry, osg::Group* geometry,
bool is_base, bool is_base,
const osgDB::ReaderWriter::Options* options); const osgDB::Options* options);
/** /**
* This value is used by the tile scheduler/loader to load tiles * This value is used by the tile scheduler/loader to load tiles
@ -106,7 +106,7 @@ public:
* Transition to OSG database pager * Transition to OSG database pager
*/ */
static osg::Node* loadTileByFileName(const std::string& index_str, static osg::Node* loadTileByFileName(const std::string& index_str,
const osgDB::ReaderWriter::Options*); const osgDB::Options*);
/** /**
* Return true if the tile entry is loaded, otherwise return false * Return true if the tile entry is loaded, otherwise return false
* indicating that the loading thread is still working on this. * indicating that the loading thread is still working on this.

View File

@ -27,11 +27,11 @@
using namespace simgear; using namespace simgear;
osgDB::ReaderWriter::Options* simgear::makeOptionsFromPath(const SGPath& path) osgDB::Options* simgear::makeOptionsFromPath(const SGPath& path)
{ {
using namespace osgDB; using namespace osgDB;
ReaderWriter::Options *options Options *options
= new ReaderWriter::Options(*(Registry::instance()->getOptions())); = new Options(*(Registry::instance()->getOptions()));
options->setDatabasePath(path.str()); options->setDatabasePath(path.str());
return options; return options;
} }

View File

@ -25,7 +25,7 @@
namespace simgear namespace simgear
{ {
osgDB::ReaderWriter::Options* makeOptionsFromPath(const SGPath&); osgDB::Options* makeOptionsFromPath(const SGPath&);
} }
#endif #endif

View File

@ -39,7 +39,7 @@ public:
_instantiateEffects(false) _instantiateEffects(false)
{ } { }
SGReaderWriterOptions(const std::string& str) : SGReaderWriterOptions(const std::string& str) :
osgDB::ReaderWriter::Options(str), osgDB::Options(str),
_materialLib(0), _materialLib(0),
_load_panel(0), _load_panel(0),
_model_data(0), _model_data(0),
@ -47,7 +47,7 @@ public:
{ } { }
SGReaderWriterOptions(const osgDB::Options& options, SGReaderWriterOptions(const osgDB::Options& options,
const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) : const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) :
osgDB::ReaderWriter::Options(options, copyop), osgDB::Options(options, copyop),
_materialLib(0), _materialLib(0),
_load_panel(0), _load_panel(0),
_model_data(0), _model_data(0),
@ -55,7 +55,7 @@ public:
{ } { }
SGReaderWriterOptions(const SGReaderWriterOptions& options, SGReaderWriterOptions(const SGReaderWriterOptions& options,
const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) : const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) :
osgDB::ReaderWriter::Options(options, copyop), osgDB::Options(options, copyop),
_propertyNode(options._propertyNode), _propertyNode(options._propertyNode),
_materialLib(options._materialLib), _materialLib(options._materialLib),
_load_panel(options._load_panel), _load_panel(options._load_panel),