Moved the getting of the ReaderWriter to do the actual model loading to later so that it only gets invoked when required.

This commit is contained in:
Robert Osfield
2009-07-14 11:19:22 +00:00
parent 424e892f99
commit cc37d7f439

View File

@@ -369,18 +369,6 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
}
// Try to find a reader by file extension. If this fails, we will fetch the file
// anyway and try to get a reader via mime-type.
osgDB::ReaderWriter *reader =
osgDB::Registry::instance()->getReaderWriterForExtension( ext );
//if (!reader)
//{
// osg::notify(osg::NOTICE)<<"Error: No ReaderWriter for file "<<fileName<<std::endl;
// return ReadResult::FILE_NOT_HANDLED;
//}
osg::notify(osg::INFO)<<"CURL: Have readerwriter="<<reader<<" "<<reader->className()<<std::endl;
const char* proxyEnvAddress = getenv("OSG_CURL_PROXY");
if (proxyEnvAddress) //Env Proxy Settings
@@ -407,6 +395,11 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
{
osg::notify(osg::INFO)<<"CURL: ReadResult::FILE_LOADED "<<std::endl;
// Try to find a reader by file extension. If this fails, we will fetch the file
// anyway and try to get a reader via mime-type.
osgDB::ReaderWriter *reader =
osgDB::Registry::instance()->getReaderWriterForExtension( ext );
// If we do not already have a ReaderWriter, try to find one based on the
// mime-type:
if ( !reader )