From 6c419af79c5c2e8332e83f12799ca6c09e7a0542 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 5 Aug 2006 20:36:49 +0000 Subject: [PATCH] From Jeremy Moles, refactored by Robert Osfield. Fixed bug osgDB::Registry::Registry::read(const ReadFunctor& readFunctor) relating to the handling of failed loads with the ReadResult::_message value being lost, this changes ensure that the original ReadResult from the plugin, with message intact, is returned correctly. --- src/osgDB/Registry.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index e6a80c6b9..4106cc432 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -1357,7 +1357,8 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor) unsigned int num_FILE_NOT_FOUND = 0; unsigned int num_ERROR_IN_READING_FILE = 0; - for(Results::iterator ritr=results.begin(); + Results::iterator ritr; + for(ritr=results.begin(); ritr!=results.end(); ++ritr) { @@ -1368,16 +1369,22 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor) if (num_FILE_NOT_HANDLED!=results.size()) { - // we've come across a file not found or error in reading file. - if (num_ERROR_IN_READING_FILE) + for(ritr=results.begin(); ritr!=results.end(); ++ritr) { - osg::notify(osg::NOTICE)<<"Warning: error reading file \""<status()==ReaderWriter::ReadResult::ERROR_IN_READING_FILE) + { + osg::notify(osg::NOTICE)<<"Warning: error reading file \""<status()==ReaderWriter::ReadResult::FILE_NOT_FOUND) + { + osg::notify(osg::NOTICE)<<"Warning: could not find file \""<