Added support for ReadResult and WriteResult to the osgDB::ReaderWriter
to allo plugins to pass back more information about the success or failure of a file load. All plugins have been updated to the new convention.
This commit is contained in:
@@ -43,7 +43,7 @@ public:
|
||||
return (extension == "lwo" || extension == "lw" || extension == "geo");
|
||||
}
|
||||
|
||||
virtual osg::Node* readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*);
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*);
|
||||
|
||||
protected:
|
||||
};
|
||||
@@ -54,11 +54,11 @@ osgDB::RegisterReaderWriterProxy<ReaderWriterLWO> g_lwoReaderWriterProxy;
|
||||
|
||||
|
||||
// read file and convert to OSG.
|
||||
osg::Node* ReaderWriterLWO::readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterLWO::readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
lwObject* lw = lw_object_read(fileName.c_str());
|
||||
if (!lw)
|
||||
return NULL;
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
osg::notify(osg::INFO) << "faces " << lw->face_cnt << endl;
|
||||
osg::notify(osg::INFO) << "materials " << lw->material_cnt << endl;
|
||||
|
||||
Reference in New Issue
Block a user