Added in guard to png loader so that it only accepts png files. This has been
added since the png loader itself doesn't not seem robust enough at detecting non png files. Added a tab in to the flt code to make it more obvious what is happening in the flow of the code.
This commit is contained in:
@@ -23,7 +23,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterFLT::readObject(const std::string& f
|
||||
osgDB::ReaderWriter::ReadResult ReaderWriterFLT::readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
if( !acceptsExtension(osgDB::getFileExtension(fileName) ))
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
osg::ref_ptr<FltFile> read = new FltFile;
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include <osg/Image>
|
||||
#include "osg/Notify"
|
||||
#include <osg/Geode>
|
||||
#include "osg/GL"
|
||||
#include <osg/GL>
|
||||
|
||||
#include "osgDB/Registry"
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
|
||||
using namespace osg;
|
||||
|
||||
@@ -35,6 +36,9 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
|
||||
if( !acceptsExtension(osgDB::getFileExtension(fileName) ))
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
int trans = PNG_ALPHA;
|
||||
FILE *fp = NULL;
|
||||
pngInfo pInfo;
|
||||
|
||||
Reference in New Issue
Block a user