From 05af83a03e43eab563acd021b6d3a0aaad0fa60b Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Sat, 25 Aug 2012 12:04:50 +0200 Subject: [PATCH] fgelev: short circuit reading image files. --- utils/fgelev/fgelev.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/fgelev/fgelev.cxx b/utils/fgelev/fgelev.cxx index c5468912b..90d7eb4f5 100644 --- a/utils/fgelev/fgelev.cxx +++ b/utils/fgelev/fgelev.cxx @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -38,6 +39,7 @@ #include #include #include +#include #include namespace sg = simgear; @@ -60,6 +62,16 @@ private: 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 intersect(sg::BVHNode& node, sg::BVHPager& pager, const SGVec3d& start, SGVec3d& end, double offset) @@ -141,6 +153,7 @@ main(int argc, char** argv) options->getDatabasePathList()); options->setMaterialLib(ml); options->setPropertyNode(props); + options->setReadFileCallback(new ReadFileCallback); options->setPluginStringData("SimGear::FG_ROOT", fg_root); // we do not need the builtin boundingvolumes options->setPluginStringData("SimGear::BOUNDINGVOLUMES", "OFF");