From Marco Jez, Fix for the class name lookup in osgDB::Registry::writeObject(), which can silently fail when a NodeKit's class (for example osgNVCg::Program) has the same name as that of an OSG's class (for example osg::Program).

This commit is contained in:
Robert Osfield
2005-10-28 18:39:14 +00:00
parent 578530d0b4
commit 0956f3cdb4

View File

@@ -1050,11 +1050,6 @@ bool Registry::writeObject(const osg::Object& obj,Output& fw)
// try composite name first
DotOsgWrapperMap::iterator itr = _classNameWrapperMap.find(compositeName);
// composite name not found, try simple class name
if (itr == _classNameWrapperMap.end()) {
itr = _classNameWrapperMap.find(classname);
}
if (itr==_classNameWrapperMap.end())
{
// first try the standard nodekit library.
@@ -1064,11 +1059,14 @@ bool Registry::writeObject(const osg::Object& obj,Output& fw)
// otherwise try the osgdb_ plugin library.
std::string pluginLibraryName = createLibraryNameForExtension(obj.libraryName());
if (loadLibrary(pluginLibraryName)) return writeObject(obj,fw);
// otherwise try simple class name
if (itr == _classNameWrapperMap.end())
itr = _classNameWrapperMap.find(classname);
}
else
{
if (itr!=_classNameWrapperMap.end())
{
DotOsgWrapper* wrapper = itr->second.get();
const DotOsgWrapper::Associates& assoc = wrapper->getAssociates();