Moved setting of isftream locale to Model::readOBJ(..) and Model::readMTL(..).

This commit is contained in:
Robert Osfield
2020-01-17 09:07:58 +00:00
parent 396cfca1ae
commit b063f510c1
2 changed files with 4 additions and 5 deletions

View File

@@ -948,12 +948,9 @@ osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& fil
std::string fileName = osgDB::findDataFile( file, options );
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
osgDB::ifstream fin(fileName.c_str());
if (fin)
{
fin.imbue(std::locale::classic());
// code for setting up the database path so that internally referenced file are searched for on relative paths.
osg::ref_ptr<Options> local_opt = options ? static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options;
local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName));
@@ -975,8 +972,6 @@ osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(std::istream& fin, con
{
if (fin)
{
fin.imbue(std::locale::classic());
obj::Model model;
model.readOBJ(fin, options);