Show
Ignore:
Timestamp:
11/23/09 12:00:07 (5 years ago)
Author:
robert
Message:

From Chris Hanson, " Add support for "OutputTextureFiles?" option to IVE plugin to permit creation of external
.dds texture files from internally-embedded textures during IVE writes."

From Robert Osfield, fixed a bug in the above submission, and changed the way that the filename of the file is passed into DataOutputStream? to avoid issues with the .ive's plugins ability to read from istreams.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/ive/ReaderWriterIVE.cpp

    r10762 r10819  
    2929            supportsOption("TerrainMaximumErrorToSizeRatio=value","Export option that controls error matric used to determine terrain HieghtField storage precision."); 
    3030            supportsOption("noLoadExternalReferenceFiles","Import option"); 
     31            supportsOption("OutputTextureFiles","Write out the texture images to file"); 
    3132        } 
    3233     
     
    6970            osg::ref_ptr<Options> local_opt = options ? static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; 
    7071            local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName)); 
    71              
     72 
    7273            osgDB::ifstream istream(fileName.c_str(), std::ios::in | std::ios::binary); 
    7374            return readNode(istream,local_opt.get()); 
     
    119120            if(local_opt->getDatabasePathList().empty()) 
    120121                local_opt->setDatabasePath(osgDB::getFilePath(fileName)); 
     122 
     123            local_opt->setPluginStringData("filename",fileName); 
     124 
    121125            osgDB::ofstream fout(fileName.c_str(), std::ios::out | std::ios::binary); 
    122126            if (!fout) return WriteResult::ERROR_IN_WRITING_FILE; 
     
    135139            if(local_opt->getDatabasePathList().empty()) 
    136140                local_opt->setDatabasePath(osgDB::getFilePath(fileName)); 
     141 
     142            local_opt->setPluginStringData("filename",fileName); 
    137143 
    138144            osgDB::ofstream fout(fileName.c_str(), std::ios::out | std::ios::binary);