Slight cleanup.
Remive last reference to plibs file utility library. Modified Files: simgear/scene/model/SGReaderWriterXML.cxx
This commit is contained in:
@@ -78,11 +78,9 @@ SGReaderWriterXML::readNode(const std::string& fileName,
|
|||||||
const SGReaderWriterXMLOptions* xmlOptions
|
const SGReaderWriterXMLOptions* xmlOptions
|
||||||
= dynamic_cast<const SGReaderWriterXMLOptions*>(options);
|
= dynamic_cast<const SGReaderWriterXMLOptions*>(options);
|
||||||
|
|
||||||
string fg_root;
|
|
||||||
SGSharedPtr<SGPropertyNode> prop_root;
|
SGSharedPtr<SGPropertyNode> prop_root;
|
||||||
osg::Node *(*load_panel)(SGPropertyNode *)=0;
|
osg::Node *(*load_panel)(SGPropertyNode *)=0;
|
||||||
SGModelData *model_data=0;
|
SGModelData *model_data=0;
|
||||||
SGPath externalTexturePath;
|
|
||||||
|
|
||||||
if (xmlOptions) {
|
if (xmlOptions) {
|
||||||
prop_root = xmlOptions->getPropRoot();
|
prop_root = xmlOptions->getPropRoot();
|
||||||
@@ -93,8 +91,6 @@ SGReaderWriterXML::readNode(const std::string& fileName,
|
|||||||
prop_root = new SGPropertyNode;
|
prop_root = new SGPropertyNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
fg_root=osgDB::Registry::instance()->getDataFilePathList().front();
|
|
||||||
|
|
||||||
osg::Node *result=0;
|
osg::Node *result=0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -143,25 +139,28 @@ sgLoad3DModel_internal(const string &path,
|
|||||||
SG_LOG(SG_GENERAL, SG_ALERT, "prop_root NULL: " << path);
|
SG_LOG(SG_GENERAL, SG_ALERT, "prop_root NULL: " << path);
|
||||||
}
|
}
|
||||||
|
|
||||||
string fg_root=osgDB::Registry::instance()->getDataFilePathList().front();
|
osgDB::FilePathList filePathList;
|
||||||
|
filePathList = osgDB::Registry::instance()->getDataFilePathList();
|
||||||
|
filePathList.push_front(osgDB::convertFileNameToNativeStyle("/"));
|
||||||
|
|
||||||
|
SGPath modelpath = osgDB::findFileInPath(path, filePathList);
|
||||||
|
if (modelpath.str().empty()) {
|
||||||
|
SG_LOG(SG_INPUT, SG_ALERT, "Failed to load file: \"" << path << "\"");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
SGPath texturepath = modelpath;
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> model;
|
osg::ref_ptr<osg::Node> model;
|
||||||
osg::ref_ptr<osg::Group> group;
|
osg::ref_ptr<osg::Group> group;
|
||||||
SGPropertyNode_ptr props = new SGPropertyNode;
|
SGPropertyNode_ptr props = new SGPropertyNode;
|
||||||
|
|
||||||
// Load the 3D object itself
|
|
||||||
SGPath modelpath = path, texturepath = path;
|
|
||||||
if ( !ulIsAbsolutePathName( path.c_str() ) ) {
|
|
||||||
SGPath tmp = fg_root;
|
|
||||||
tmp.append(modelpath.str());
|
|
||||||
modelpath = texturepath = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for an XML wrapper
|
// Check for an XML wrapper
|
||||||
if (modelpath.str().substr(modelpath.str().size() - 4, 4) == ".xml") {
|
if (modelpath.extension() == "xml") {
|
||||||
try {
|
try {
|
||||||
readProperties(modelpath.str(), props);
|
readProperties(modelpath.str(), props);
|
||||||
} catch (const sg_throwable &t) {
|
} catch (const sg_throwable &t) {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Failed to load xml: " << t.getFormattedMessage());
|
SG_LOG(SG_INPUT, SG_ALERT, "Failed to load xml: "
|
||||||
|
<< t.getFormattedMessage());
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
if (overlay)
|
if (overlay)
|
||||||
|
|||||||
Reference in New Issue
Block a user