]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/SGPagedLOD.cxx
Merge branch 'next' of git.gitorious.org:fg/simgear into next
[simgear.git] / simgear / scene / model / SGPagedLOD.cxx
index f503544ac6226308e520e0d915e25ac2d51f3b3f..b44019b7ec5ada7b3168f8cee6b6af4ce48d3508 100644 (file)
@@ -35,6 +35,8 @@
 using namespace osg;
 using namespace simgear;
 
+bool SGPagedLOD::_cache = true;
+
 SGPagedLOD::SGPagedLOD()
         : PagedLOD()
 {
@@ -53,6 +55,20 @@ SGPagedLOD::SGPagedLOD(const SGPagedLOD& plod,const CopyOp& copyop)
 {
 }
 
+void
+SGPagedLOD::setReaderWriterOptions(osgDB::ReaderWriter::Options *options)
+{
+    if (_cache)
+        options->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
+    else
+        options->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE);
+#if SG_PAGEDLOD_HAS_OPTIONS
+    setDatabaseOptions(options);
+#else
+    _readerWriterOptions = options;
+#endif
+}
+
 bool SGPagedLOD::addChild(osg::Node *child)
 {
     if (!PagedLOD::addChild(child))