fgelev: short circuit reading image files.
This commit is contained in:
parent
7a0db802d2
commit
05af83a03e
1 changed files with 13 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
#include <osg/ArgumentParser>
|
#include <osg/ArgumentParser>
|
||||||
|
#include <osg/Image>
|
||||||
|
|
||||||
#include <simgear/props/props.hxx>
|
#include <simgear/props/props.hxx>
|
||||||
#include <simgear/props/props_io.hxx>
|
#include <simgear/props/props_io.hxx>
|
||||||
|
@ -38,6 +39,7 @@
|
||||||
#include <simgear/scene/model/BVHPageNodeOSG.hxx>
|
#include <simgear/scene/model/BVHPageNodeOSG.hxx>
|
||||||
#include <simgear/scene/model/ModelRegistry.hxx>
|
#include <simgear/scene/model/ModelRegistry.hxx>
|
||||||
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
|
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
|
||||||
|
#include <simgear/scene/util/OptionsReadFileCallback.hxx>
|
||||||
#include <simgear/scene/tgdb/userdata.hxx>
|
#include <simgear/scene/tgdb/userdata.hxx>
|
||||||
|
|
||||||
namespace sg = simgear;
|
namespace sg = simgear;
|
||||||
|
@ -60,6 +62,16 @@ private:
|
||||||
sg::BVHPager& _pager;
|
sg::BVHPager& _pager;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Short circuit reading image files.
|
||||||
|
class ReadFileCallback : public sg::OptionsReadFileCallback {
|
||||||
|
public:
|
||||||
|
virtual ~ReadFileCallback()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
virtual osgDB::ReaderWriter::ReadResult readImage(const std::string& name, const osgDB::Options*)
|
||||||
|
{ return new osg::Image; }
|
||||||
|
};
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
intersect(sg::BVHNode& node, sg::BVHPager& pager,
|
intersect(sg::BVHNode& node, sg::BVHPager& pager,
|
||||||
const SGVec3d& start, SGVec3d& end, double offset)
|
const SGVec3d& start, SGVec3d& end, double offset)
|
||||||
|
@ -141,6 +153,7 @@ main(int argc, char** argv)
|
||||||
options->getDatabasePathList());
|
options->getDatabasePathList());
|
||||||
options->setMaterialLib(ml);
|
options->setMaterialLib(ml);
|
||||||
options->setPropertyNode(props);
|
options->setPropertyNode(props);
|
||||||
|
options->setReadFileCallback(new ReadFileCallback);
|
||||||
options->setPluginStringData("SimGear::FG_ROOT", fg_root);
|
options->setPluginStringData("SimGear::FG_ROOT", fg_root);
|
||||||
// we do not need the builtin boundingvolumes
|
// we do not need the builtin boundingvolumes
|
||||||
options->setPluginStringData("SimGear::BOUNDINGVOLUMES", "OFF");
|
options->setPluginStringData("SimGear::BOUNDINGVOLUMES", "OFF");
|
||||||
|
|
Loading…
Add table
Reference in a new issue