From 192daa0408d83376165599a2b7d0568ec74d9a46 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 11 Feb 2005 10:00:50 +0000 Subject: [PATCH] Added support into passing the ReaderWriter::Options structure onto readImageFile --- src/osgPlugins/ive/DataInputStream.cpp | 2 +- src/osgPlugins/ive/ReaderWriterIVE.cpp | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/osgPlugins/ive/DataInputStream.cpp b/src/osgPlugins/ive/DataInputStream.cpp index becc89e49..fa24f383a 100644 --- a/src/osgPlugins/ive/DataInputStream.cpp +++ b/src/osgPlugins/ive/DataInputStream.cpp @@ -617,7 +617,7 @@ osg::Image* DataInputStream::readImage(std::string filename) // Image is not in list. // Read it from disk, - osg::Image* image = osgDB::readImageFile(filename.c_str()); + osg::Image* image = osgDB::readImageFile(filename.c_str(),_options.get()); // add it to the imageList, _imageMap[filename] = image; diff --git a/src/osgPlugins/ive/ReaderWriterIVE.cpp b/src/osgPlugins/ive/ReaderWriterIVE.cpp index 5cdaae3db..eb5168c28 100644 --- a/src/osgPlugins/ive/ReaderWriterIVE.cpp +++ b/src/osgPlugins/ive/ReaderWriterIVE.cpp @@ -36,7 +36,7 @@ class IVEReaderWriter : public ReaderWriter // code for setting up the database path so that internally referenced file are searched for on relative paths. osg::ref_ptr local_opt = options ? static_cast(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; local_opt->setDatabasePath(osgDB::getFilePath(fileName)); - + std::ifstream istream(fileName.c_str(), std::ios::in | std::ios::binary); return readNode(istream,local_opt.get()); } @@ -48,24 +48,18 @@ class IVEReaderWriter : public ReaderWriter virtual ReadResult readNode(std::istream& fin, const Options* options) const { - #define IVE_CATCH_EXCEPTIONS - #ifdef IVE_CATCH_EXCEPTIONS - try{ - #endif + try{ // Create datainputstream. ive::DataInputStream in(&fin); in.setOptions(options); return in.readNode(); - #ifdef IVE_CATCH_EXCEPTIONS - } - catch(ive::Exception e) + } + catch(ive::Exception e) { - std::cout<<"Error reading file: "<< e.getError()<