Changeset 11040

Show
Ignore:
Timestamp:
02/04/10 11:20:17 (2 years ago)
Author:
robert
Message:

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."

Location:
OpenSceneGraph/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgDB/ObjectWrapper

    r10986 r11040  
    140140    void wrapper_propfunc_##NAME(osgDB::ObjectWrapper* wrapper) 
    141141 
    142 class RegisterCompressorProxy 
     142class OSGDB_EXPORT RegisterCompressorProxy 
    143143{ 
    144144public: 
  • OpenSceneGraph/trunk/src/osgDB/ObjectWrapper.cpp

    r11039 r11040  
    491491 
    492492    // Load external libraries 
    493     std::string::size_type posDoubleColon = name.rfind("::"); 
    494     if ( posDoubleColon!=std::string::npos ) 
    495     { 
    496         std::string libName = std::string( name, 0, posDoubleColon ); 
    497  
    498         std::string nodeKitLib = osgDB::Registry::instance()->createLibraryNameForNodeKit(libName); 
    499         if ( osgDB::Registry::instance()->loadLibrary(nodeKitLib)==osgDB::Registry::LOADED ) 
    500             return findCompressor(name); 
    501  
    502         std::string pluginLib = osgDB::Registry::instance()->createLibraryNameForExtension(std::string("compressor_")+libName); 
    503         if ( osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED ) 
    504             return findCompressor(name); 
    505  
    506         pluginLib = osgDB::Registry::instance()->createLibraryNameForExtension(libName); 
    507         if ( osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED ) 
    508             return findCompressor(name); 
    509     } 
     493    std::string nodeKitLib = osgDB::Registry::instance()->createLibraryNameForNodeKit(name); 
     494    if ( osgDB::Registry::instance()->loadLibrary(nodeKitLib)==osgDB::Registry::LOADED ) 
     495        return findCompressor(name); 
     496 
     497    std::string pluginLib = osgDB::Registry::instance()->createLibraryNameForExtension(std::string("compressor_")+name); 
     498    if ( osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED ) 
     499        return findCompressor(name); 
     500 
     501    pluginLib = osgDB::Registry::instance()->createLibraryNameForExtension(name); 
     502    if ( osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED ) 
     503        return findCompressor(name); 
    510504    return NULL; 
    511505}