RelativePath="..\..\simgear\scene\util\NodeAndDrawableVisitor.hxx"\r
>\r
</File>\r
- <File\r
- RelativePath="..\..\simgear\scene\util\PathOptions.cxx"\r
- >\r
- </File>\r
- <File\r
- RelativePath="..\..\simgear\scene\util\PathOptions.hxx"\r
- >\r
- </File>\r
<File\r
RelativePath="..\..\simgear\scene\util\PrimitiveUtils.cxx"\r
>\r
#include <osg/TextureCubeMap>
#include <osg/TexMat>
#include <osg/Fog>
-#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
-#include <osgDB/Options>
-#endif
#include <simgear/math/sg_random.h>
-#include <simgear/scene/util/PathOptions.hxx>
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/debug/logstream.hxx>
#include <simgear/scene/model/model.hxx>
#include <simgear/scene/util/RenderConstants.hxx>
{
osg::StateSet *stateSet = new osg::StateSet;
- osg::ref_ptr<osgDB::Options> options
- = makeOptionsFromPath(path);
+ osg::ref_ptr<SGReaderWriterOptions> options;
+ options = SGReaderWriterOptions::fromPath(path.str());
stateSet->setTextureAttribute(0, SGLoadTexture2D(colorTexture,
options.get()));
stateSet->setTextureMode(0, GL_TEXTURE_2D, osg::StateAttribute::ON);
#include <osg/ShadeModel>
#include <osg/TexEnv>
#include <osg/Texture2D>
-#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
-#include <osgDB/Options>
-#endif
#include <simgear/constants.h>
#include <simgear/screen/colors.hxx>
#include <simgear/scene/model/model.hxx>
-#include <simgear/scene/util/PathOptions.hxx>
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include "sphere.hxx"
#include "moon.hxx"
stateSet->setRenderBinDetails(-5, "RenderBin");
// set up the orb state
- osg::ref_ptr<osgDB::Options> options
- = makeOptionsFromPath(path);
+ osg::ref_ptr<SGReaderWriterOptions> options;
+ options = SGReaderWriterOptions::fromPath(path.str());
osg::Texture2D* texture = SGLoadTexture2D("moon.png", options.get());
stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
#include <simgear/math/sg_random.h>
#include <simgear/misc/sg_path.hxx>
-#include <simgear/scene/util/PathOptions.hxx>
#include <simgear/props/props.hxx>
#include <simgear/scene/model/model.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
"texture"),
"image"),
texture);
- ref_ptr<osgDB::Options> options
- = makeOptionsFromPath(texture_root);
- ref_ptr<SGReaderWriterOptions> sgOptions
- = new SGReaderWriterOptions(*options.get());
- if ((effect = makeEffect(pcloudEffect, true, sgOptions.get())))
+ ref_ptr<SGReaderWriterOptions> options;
+ options = SGReaderWriterOptions::fromPath(texture_root.str());
+ if ((effect = makeEffect(pcloudEffect, true, options.get())))
effectMap.insert(EffectMap::value_type(texture, effect));
} else {
effect = iter->second.get();
#include <osgDB/ReadFile>
#include <simgear/math/SGMath.hxx>
-#include <simgear/scene/util/PathOptions.hxx>
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/screen/colors.hxx>
#include <simgear/scene/model/model.hxx>
#include "oursun.hxx"
env_node = property_tree_Node;
- osg::ref_ptr<osgDB::Options> options
- = makeOptionsFromPath(path);
+ osg::ref_ptr<SGReaderWriterOptions> options;
+ options = SGReaderWriterOptions::fromPath(path.str());
// build the ssg scene graph sub tree for the sky and connected
// into the provide scene graph branch
sun_transform = new osg::MatrixTransform;
StateAttributeFactory.hxx
UpdateOnceCallback.hxx
VectorArrayAdapter.hxx
- PathOptions.hxx
project.hxx
)
SplicingVisitor.cxx
StateAttributeFactory.cxx
UpdateOnceCallback.cxx
- PathOptions.cxx
project.cxx
)
+++ /dev/null
-// PathOptions.cxx -- make an osgDB Options object from a path
-// Copyright (C) 2007 Tim Moore timoore@redhat.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// $Id$
-
-#ifdef HAVE_CONFIG_H
-# include <simgear_config.h>
-#endif
-
-#include <osgDB/Registry>
-
-#include "PathOptions.hxx"
-
-using namespace simgear;
-
-osgDB::Options* simgear::makeOptionsFromPath(const SGPath& path)
-{
- using namespace osgDB;
- Options *options
- = new Options(*(Registry::instance()->getOptions()));
- options->setDatabasePath(path.str());
- return options;
-}
+++ /dev/null
-// PathOptions.hxx -- make an osgDB Options object from a path
-// Copyright (C) 2007 Tim Moore timoore@redhat.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// $Id$
-
-#ifndef PATHOPTIONSHXX
-#define PATHOPTIONSHXX 1
-
-#include <osgDB/ReaderWriter>
-#include <simgear/misc/sg_path.hxx>
-
-namespace simgear
-{
-osgDB::Options* makeOptionsFromPath(const SGPath&);
-}
-
-#endif
return new SGReaderWriterOptions(*static_cast<const SGReaderWriterOptions*>(options));
}
+ static SGReaderWriterOptions* fromPath(const std::string& path)
+ {
+ SGReaderWriterOptions* options = copyOrCreate(0);
+ options->setDatabasePath(path);
+ return options;
+ }
+
protected:
virtual ~SGReaderWriterOptions() {}