From 83f6f1391401b043817696abbb7fa1fd8c26ead0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 13 May 2008 14:08:32 +0000 Subject: [PATCH] Added --file-cache directoryname command line option support to readNodeFiles(ArgumentParser&) to make it easier to specify a local file cache, in place of the default OSG_FILE_CACHE env var. --- src/osgDB/ReadFile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osgDB/ReadFile.cpp b/src/osgDB/ReadFile.cpp index 8f9eeb0e1..4391fda8d 100644 --- a/src/osgDB/ReadFile.cpp +++ b/src/osgDB/ReadFile.cpp @@ -129,6 +129,14 @@ Node* osgDB::readNodeFiles(osg::ArgumentParser& arguments,const ReaderWriter::Op std::string filename; + while (arguments.read("--file-cache",filename)) + { + std::string str("OSG_FILE_CACHE="); + str += filename; + + putenv(strdup((char*)str.c_str())); + } + while (arguments.read("--image",filename)) { osg::ref_ptr image = readImageFile(filename.c_str(), options);