if (sitr != shaderMap.end()) {
program->addShader(sitr->second.get());
} else {
- string fileName = osgDB::Registry::instance()
- ->findDataFile(shaderName, options,
- osgDB::CASE_SENSITIVE);
+ string fileName = osgDB::findDataFile(shaderName, options);
if (!fileName.empty()) {
ref_ptr<Shader> shader = new Shader(stype);
if (shader->loadShaderSourceFromFile(fileName)) {
string effectFileName(name);
effectFileName += ".eff";
string absFileName
- = osgDB::Registry::instance()->findDataFile(effectFileName, options,
- osgDB::CASE_SENSITIVE);
+ = osgDB::findDataFile(effectFileName, options);
if (absFileName.empty())
return 0;
SGPropertyNode_ptr effectProps = new SGPropertyNode();
#include <osg/StateSet>
#include <osg/TexEnv>
#include <osg/Texture2D>
-#include <osgDB/Options>
+#include <osgDB/ReaderWriter>
#include <osgDB/ReadFile>
#include <osgDB/Registry>
#include <osgDB/FileUtils>
////////////////////////////////////////////////////////////////////////
SGMaterial::_internal_state::_internal_state(Effect *e, const string &t, bool l,
- const osgDB::Options* o ) :
+ const osgDB::ReaderWriter::Options* o ) :
effect(e), texture_path(t), effect_realized(l), options(o)
{
}
-SGMaterial::SGMaterial( const osgDB::Options* options,
+SGMaterial::SGMaterial( const osgDB::ReaderWriter::Options* options,
const SGPropertyNode *props )
{
init();
////////////////////////////////////////////////////////////////////////
void
-SGMaterial::read_properties(const osgDB::Options* options,
+SGMaterial::read_properties(const osgDB::ReaderWriter::Options* options,
const SGPropertyNode *props)
{
// Gather the path(s) to the texture(s)
}
SGPath tpath("Textures.high");
tpath.append(tname);
- osgDB::Registry* reg = osgDB::Registry::instance();
- string fullTexPath = reg->findDataFile(tpath.str(), options,
- osgDB::CASE_SENSITIVE);
+ string fullTexPath = osgDB::findDataFile(tpath.str(), options);
if (fullTexPath.empty()) {
tpath = SGPath("Textures");
tpath.append(tname);
- fullTexPath = reg->findDataFile(tpath.str(), options,
- osgDB::CASE_SENSITIVE);
+ fullTexPath = osgDB::findDataFile(tpath.str(), options);
}
if (!fullTexPath.empty() ) {
const SGPropertyNode* treeTexNode = props->getChild("tree-texture");
if (treeTexNode) {
string treeTexPath = props->getStringValue("tree-texture");
- tree_texture = osgDB::Registry::instance()
- ->findDataFile(treeTexPath, options, osgDB::CASE_SENSITIVE);
+ tree_texture = osgDB::findDataFile(treeTexPath, options);
}
// surface values for use with ground reactions
return _status[i].effect.get();
}
-void SGMaterial::buildEffectProperties(const osgDB::Options* options)
+void SGMaterial::buildEffectProperties(const osgDB::ReaderWriter::Options*
+ options)
{
using namespace osg;
SGPropertyNode_ptr propRoot = new SGPropertyNode();
#include <simgear/math/SGMath.hxx>
#include <osg/ref_ptr>
+#include <osgDB/ReaderWriter>
namespace osg
{
class StateSet;
}
-namespace osgDB
-{
-class Options;
-}
-
#include <simgear/props/props.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
#include <simgear/scene/util/SGSceneFeatures.hxx>
* state information for the material. This node is usually
* loaded from the $FG_ROOT/materials.xml file.
*/
- SGMaterial( const osgDB::Options*, const SGPropertyNode *props);
+ SGMaterial( const osgDB::ReaderWriter::Options*, const SGPropertyNode *props);
/**
* Destructor.
struct _internal_state {
_internal_state(simgear::Effect *e, const std::string &t, bool l,
- const osgDB::Options *o);
+ const osgDB::ReaderWriter::Options *o);
osg::ref_ptr<simgear::Effect> effect;
std::string texture_path;
bool effect_realized;
- osg::ref_ptr<const osgDB::Options> options;
+ osg::ref_ptr<const osgDB::ReaderWriter::Options> options;
};
private:
// Internal constructors and methods.
////////////////////////////////////////////////////////////////////
- void read_properties(const osgDB::Options* options,
+ void read_properties(const osgDB::ReaderWriter::Options* options,
const SGPropertyNode *props);
- void buildEffectProperties(const osgDB::Options* options);
+ void buildEffectProperties(const osgDB::ReaderWriter::Options* options);
};
#include <string.h>
#include <string>
-#include <osgDB/Options>
+#include <osgDB/ReaderWriter>
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/sg_path.hxx>
<< ex.getMessage() );
throw;
}
- osg::ref_ptr<osgDB::Options> options = new osgDB::Options;
- options->setObjectCacheHint(osgDB::Options::CACHE_ALL);
+ osg::ref_ptr<osgDB::ReaderWriter::Options> options
+ = new osgDB::ReaderWriter::Options;
+ options->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
options->setDatabasePath(fg_root);
int nMaterials = materials.nChildren();
for (int i = 0; i < nMaterials; i++) {