From Wang Rui, "I also did a small fix to the ObjectWrapper header, to add a
OSGDB_EXPORT macro to RegisterCompressorProxy, and modified the findCompressor() method to look for custom compressors in libraries such like osgdb_compressor_name.so, which was described in the wiki page chapter 2.4."
This commit is contained in:
parent
bdcddc10f8
commit
7103707815
@ -139,7 +139,7 @@ protected:
|
||||
typedef CLASS MyClass; \
|
||||
void wrapper_propfunc_##NAME(osgDB::ObjectWrapper* wrapper)
|
||||
|
||||
class RegisterCompressorProxy
|
||||
class OSGDB_EXPORT RegisterCompressorProxy
|
||||
{
|
||||
public:
|
||||
RegisterCompressorProxy( const std::string& name, BaseCompressor* compressor );
|
||||
|
@ -490,23 +490,17 @@ BaseCompressor* ObjectWrapperManager::findCompressor( const std::string& name )
|
||||
if ( itr!=_compressors.end() ) return itr->second.get();
|
||||
|
||||
// Load external libraries
|
||||
std::string::size_type posDoubleColon = name.rfind("::");
|
||||
if ( posDoubleColon!=std::string::npos )
|
||||
{
|
||||
std::string libName = std::string( name, 0, posDoubleColon );
|
||||
std::string nodeKitLib = osgDB::Registry::instance()->createLibraryNameForNodeKit(name);
|
||||
if ( osgDB::Registry::instance()->loadLibrary(nodeKitLib)==osgDB::Registry::LOADED )
|
||||
return findCompressor(name);
|
||||
|
||||
std::string nodeKitLib = osgDB::Registry::instance()->createLibraryNameForNodeKit(libName);
|
||||
if ( osgDB::Registry::instance()->loadLibrary(nodeKitLib)==osgDB::Registry::LOADED )
|
||||
return findCompressor(name);
|
||||
std::string pluginLib = osgDB::Registry::instance()->createLibraryNameForExtension(std::string("compressor_")+name);
|
||||
if ( osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED )
|
||||
return findCompressor(name);
|
||||
|
||||
std::string pluginLib = osgDB::Registry::instance()->createLibraryNameForExtension(std::string("compressor_")+libName);
|
||||
if ( osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED )
|
||||
return findCompressor(name);
|
||||
|
||||
pluginLib = osgDB::Registry::instance()->createLibraryNameForExtension(libName);
|
||||
if ( osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED )
|
||||
return findCompressor(name);
|
||||
}
|
||||
pluginLib = osgDB::Registry::instance()->createLibraryNameForExtension(name);
|
||||
if ( osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED )
|
||||
return findCompressor(name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user