Improved the handling of writing out of proxy node files.

This commit is contained in:
Robert Osfield
2005-05-17 13:47:13 +00:00
parent 9c27121f77
commit f9bc0454f8

View File

@@ -175,7 +175,9 @@ bool ProxyNode_writeLocalData(const Object& obj, Output& fw)
}
else
{
std::string osgname = osgDB::getFilePath(proxyNode.getFileName(i)) +"/"+ osgDB::getStrippedName(proxyNode.getFileName(i)) +".osg";
std::string path = osgDB::getFilePath(fw.getFileName());
std::string new_filename = osgDB::getStrippedName(proxyNode.getFileName(i)) +".osg";
std::string osgname = path.empty() ? new_filename : (path +"/"+ new_filename) ;
fw.indent() << osgname << std::endl;
}
}
@@ -209,7 +211,9 @@ bool ProxyNode_writeLocalData(const Object& obj, Output& fw)
}
else
{
std::string osgname = osgDB::getFilePath(proxyNode.getFileName(i)) +"/"+ osgDB::getStrippedName(proxyNode.getFileName(i)) +".osg";
std::string path = osgDB::getFilePath(fw.getFileName());
std::string new_filename = osgDB::getStrippedName(proxyNode.getFileName(i)) +".osg";
std::string osgname = path.empty() ? new_filename : (path +"/"+ new_filename) ;
osgDB::writeNodeFile(*proxyNode.getChild(i), osgname);
}
}