replaced reading and writing of std::container.size() using InputStream::readSize() and OutputStream::writeSize() to make
the type writing more explictly tied to the size type, with use of unsigned int as the default size. This approach ensures that we get the same results under 32 and 64bit builds.
This commit is contained in:
@@ -13,7 +13,7 @@ static bool checkTimeControlPointMap( const osg::AnimationPath& path )
|
||||
|
||||
static bool readTimeControlPointMap( osgDB::InputStream& is, osg::AnimationPath& path )
|
||||
{
|
||||
unsigned int size = 0; is >> size;
|
||||
unsigned int size = is.readSize();
|
||||
if ( size>0 )
|
||||
{
|
||||
is >> osgDB::BEGIN_BRACKET;
|
||||
@@ -37,7 +37,7 @@ static bool readTimeControlPointMap( osgDB::InputStream& is, osg::AnimationPath&
|
||||
static bool writeTimeControlPointMap( osgDB::OutputStream& os, const osg::AnimationPath& path )
|
||||
{
|
||||
const osg::AnimationPath::TimeControlPointMap& map = path.getTimeControlPointMap();
|
||||
os << map.size();
|
||||
os.writeSize(map.size());
|
||||
if ( map.size()>0 )
|
||||
{
|
||||
os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
|
||||
@@ -10,7 +10,8 @@ static bool checkPositionList( const osg::Billboard& node )
|
||||
|
||||
static bool readPositionList( osgDB::InputStream& is, osg::Billboard& node )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize();
|
||||
is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
osg::Vec3d pos; is >> pos;
|
||||
@@ -23,7 +24,8 @@ static bool readPositionList( osgDB::InputStream& is, osg::Billboard& node )
|
||||
static bool writePositionList( osgDB::OutputStream& os, const osg::Billboard& node )
|
||||
{
|
||||
const osg::Billboard::PositionList& posList = node.getPositionList();
|
||||
os << posList.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(posList.size());
|
||||
os<< osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::Billboard::PositionList::const_iterator itr=posList.begin();
|
||||
itr!=posList.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -182,7 +182,7 @@ static bool checkBufferAttachmentMap( const osg::Camera& node )
|
||||
|
||||
static bool readBufferAttachmentMap( osgDB::InputStream& is, osg::Camera& node )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
is >> osgDB::PROPERTY("Attachment");
|
||||
@@ -215,7 +215,7 @@ static bool readBufferAttachmentMap( osgDB::InputStream& is, osg::Camera& node )
|
||||
static bool writeBufferAttachmentMap( osgDB::OutputStream& os, const osg::Camera& node )
|
||||
{
|
||||
const osg::Camera::BufferAttachmentMap& map = node.getBufferAttachmentMap();
|
||||
os << map.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(map.size()); os<< osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::Camera::BufferAttachmentMap::const_iterator itr=map.begin();
|
||||
itr!=map.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
static void readConvexPlanarPolygon( osgDB::InputStream& is, osg::ConvexPlanarPolygon& polygon )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
osg::Vec3d vertex; is >> vertex;
|
||||
@@ -17,7 +17,7 @@ static void readConvexPlanarPolygon( osgDB::InputStream& is, osg::ConvexPlanarPo
|
||||
static void writeConvexPlanarPolygon( osgDB::OutputStream& os, const osg::ConvexPlanarPolygon& polygon )
|
||||
{
|
||||
const osg::ConvexPlanarPolygon::VertexList& vertices = polygon.getVertexList();
|
||||
os << vertices.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(vertices.size()); os<< osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::ConvexPlanarPolygon::VertexList::const_iterator itr=vertices.begin();
|
||||
itr!=vertices.end(); ++itr )
|
||||
{
|
||||
@@ -54,7 +54,7 @@ static bool checkHoles( const osg::ConvexPlanarOccluder& obj )
|
||||
|
||||
static bool readHoles( osgDB::InputStream& is, osg::ConvexPlanarOccluder& obj )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
osg::ConvexPlanarPolygon polygon;
|
||||
@@ -69,7 +69,7 @@ static bool readHoles( osgDB::InputStream& is, osg::ConvexPlanarOccluder& obj )
|
||||
static bool writeHoles( osgDB::OutputStream& os, const osg::ConvexPlanarOccluder& obj )
|
||||
{
|
||||
const osg::ConvexPlanarOccluder::HoleList& holes = obj.getHoleList();
|
||||
os << holes.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(holes.size()); os<< osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::ConvexPlanarOccluder::HoleList::const_iterator itr=holes.begin();
|
||||
itr!=holes.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ static bool checkLocalParameters( const osg::FragmentProgram& fp )
|
||||
|
||||
static bool readLocalParameters( osgDB::InputStream& is, osg::FragmentProgram& fp )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
GLuint key; osg::Vec4d value;
|
||||
@@ -25,7 +25,7 @@ static bool readLocalParameters( osgDB::InputStream& is, osg::FragmentProgram& f
|
||||
static bool writeLocalParameters( osgDB::OutputStream& os, const osg::FragmentProgram& fp )
|
||||
{
|
||||
const osg::FragmentProgram::LocalParamList& params = fp.getLocalParameters();
|
||||
os << params.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(params.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::FragmentProgram::LocalParamList::const_iterator itr=params.begin();
|
||||
itr!=params.end(); ++itr )
|
||||
{
|
||||
@@ -43,7 +43,7 @@ static bool checkMatrices( const osg::FragmentProgram& fp )
|
||||
|
||||
static bool readMatrices( osgDB::InputStream& is, osg::FragmentProgram& fp )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
unsigned int key; osg::Matrixd value;
|
||||
@@ -57,7 +57,7 @@ static bool readMatrices( osgDB::InputStream& is, osg::FragmentProgram& fp )
|
||||
static bool writeMatrices( osgDB::OutputStream& os, const osg::FragmentProgram& fp )
|
||||
{
|
||||
const osg::FragmentProgram::MatrixList& matrices = fp.getMatrices();
|
||||
os << matrices.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(matrices.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::FragmentProgram::MatrixList::const_iterator itr=matrices.begin();
|
||||
itr!=matrices.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -73,7 +73,7 @@ ADD_ARRAYDATA_FUNCTIONS( FogCoordData )
|
||||
static bool check##PROP( const osg::Geometry& geom ) \
|
||||
{ return geom.get##LISTNAME().size()>0; } \
|
||||
static bool read##PROP( osgDB::InputStream& is, osg::Geometry& geom ) { \
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET; \
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET; \
|
||||
for ( unsigned int i=0; i<size; ++i ) { \
|
||||
osg::Geometry::ArrayData data; \
|
||||
is >> osgDB::PROPERTY("Data") >> osgDB::BEGIN_BRACKET; \
|
||||
@@ -84,7 +84,7 @@ ADD_ARRAYDATA_FUNCTIONS( FogCoordData )
|
||||
} \
|
||||
static bool write##PROP( osgDB::OutputStream& os, const osg::Geometry& geom ) { \
|
||||
const osg::Geometry::ArrayDataList& LISTNAME = geom.get##LISTNAME(); \
|
||||
os << LISTNAME.size() << osgDB::BEGIN_BRACKET << std::endl; \
|
||||
os.writeSize(LISTNAME.size()); os << osgDB::BEGIN_BRACKET << std::endl; \
|
||||
for ( osg::Geometry::ArrayDataList::const_iterator itr=LISTNAME.begin(); \
|
||||
itr!=LISTNAME.end(); ++itr ) { \
|
||||
os << osgDB::PROPERTY("Data") << osgDB::BEGIN_BRACKET << std::endl; \
|
||||
|
||||
@@ -24,7 +24,7 @@ static bool readFileNames( osgDB::InputStream& is, osg::ImageSequence& image )
|
||||
static bool writeFileNames( osgDB::OutputStream& os, const osg::ImageSequence& image )
|
||||
{
|
||||
const osg::ImageSequence::FileNames& files = image.getFileNames();
|
||||
os << files.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(files.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::ImageSequence::FileNames::const_iterator itr=files.begin();
|
||||
itr!=files.end(); ++itr )
|
||||
{
|
||||
@@ -43,7 +43,7 @@ static bool checkImages( const osg::ImageSequence& image )
|
||||
|
||||
static bool readImages( osgDB::InputStream& is, osg::ImageSequence& image )
|
||||
{
|
||||
unsigned int images = 0; is >> images >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int images = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<images; ++i )
|
||||
{
|
||||
osg::Image* img = dynamic_cast<osg::Image*>( is.readObject() );
|
||||
@@ -56,7 +56,7 @@ static bool readImages( osgDB::InputStream& is, osg::ImageSequence& image )
|
||||
static bool writeImages( osgDB::OutputStream& os, const osg::ImageSequence& image )
|
||||
{
|
||||
const osg::ImageSequence::Images& images = image.getImages();
|
||||
os << images.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(images.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::ImageSequence::Images::const_iterator itr=images.begin();
|
||||
itr!=images.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ static bool checkRangeList( const osg::LOD& node )
|
||||
|
||||
static bool readRangeList( osgDB::InputStream& is, osg::LOD& node )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
float min, max;
|
||||
@@ -45,7 +45,7 @@ static bool readRangeList( osgDB::InputStream& is, osg::LOD& node )
|
||||
static bool writeRangeList( osgDB::OutputStream& os, const osg::LOD& node )
|
||||
{
|
||||
const osg::LOD::RangeList& ranges = node.getRangeList();
|
||||
os << ranges.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(ranges.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::LOD::RangeList::const_iterator itr=ranges.begin();
|
||||
itr!=ranges.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ static bool checkDescriptions( const osg::Node& node )
|
||||
|
||||
static bool readDescriptions( osgDB::InputStream& is, osg::Node& node )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
std::string value;
|
||||
@@ -53,7 +53,7 @@ static bool readDescriptions( osgDB::InputStream& is, osg::Node& node )
|
||||
static bool writeDescriptions( osgDB::OutputStream& os, const osg::Node& node )
|
||||
{
|
||||
const osg::Node::DescriptionList& slist = node.getDescriptions();
|
||||
os << slist.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(slist.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::Node::DescriptionList::const_iterator itr=slist.begin();
|
||||
itr!=slist.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
static bool check##PROP(const osg::Program& attr) \
|
||||
{ return attr.get##TYPE().size()>0; } \
|
||||
static bool read##PROP(osgDB::InputStream& is, osg::Program& attr) { \
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET; \
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET; \
|
||||
for ( unsigned int i=0; i<size; ++i ) { \
|
||||
std::string key; unsigned int value; \
|
||||
is >> key >> value; attr.add##DATA(key, value); \
|
||||
@@ -18,7 +18,7 @@
|
||||
static bool write##PROP( osgDB::OutputStream& os, const osg::Program& attr ) \
|
||||
{ \
|
||||
const osg::Program::TYPE& plist = attr.get##TYPE(); \
|
||||
os << plist.size() << osgDB::BEGIN_BRACKET << std::endl; \
|
||||
os.writeSize(plist.size()); os << osgDB::BEGIN_BRACKET << std::endl; \
|
||||
for ( osg::Program::TYPE::const_iterator itr=plist.begin(); \
|
||||
itr!=plist.end(); ++itr ) { \
|
||||
os << itr->first << itr->second << std::endl; \
|
||||
@@ -55,7 +55,7 @@ static bool checkShaders( const osg::Program& attr )
|
||||
|
||||
static bool readShaders( osgDB::InputStream& is, osg::Program& attr )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
osg::Shader* shader = dynamic_cast<osg::Shader*>( is.readObject() );
|
||||
@@ -68,7 +68,7 @@ static bool readShaders( osgDB::InputStream& is, osg::Program& attr )
|
||||
static bool writeShaders( osgDB::OutputStream& os, const osg::Program& attr )
|
||||
{
|
||||
unsigned int size = attr.getNumShaders();
|
||||
os << size << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(size); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
os << attr.getShader(i);
|
||||
|
||||
@@ -11,7 +11,7 @@ static bool checkShaderSource( const osg::Shader& shader )
|
||||
static bool readShaderSource( osgDB::InputStream& is, osg::Shader& shader )
|
||||
{
|
||||
std::string code;
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
std::string line;
|
||||
@@ -33,7 +33,7 @@ static bool writeShaderSource( osgDB::OutputStream& os, const osg::Shader& shade
|
||||
lines.push_back( line );
|
||||
}
|
||||
|
||||
os << lines.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(lines.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( std::vector<std::string>::const_iterator itr=lines.begin();
|
||||
itr!=lines.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ static int readValue( osgDB::InputStream& is )
|
||||
|
||||
static void readModes( osgDB::InputStream& is, osg::StateSet::ModeList& modes )
|
||||
{
|
||||
unsigned int size = 0; is >> size;
|
||||
unsigned int size = is.readSize();
|
||||
if ( size>0 )
|
||||
{
|
||||
is >> osgDB::BEGIN_BRACKET;
|
||||
@@ -45,7 +45,7 @@ static void readModes( osgDB::InputStream& is, osg::StateSet::ModeList& modes )
|
||||
|
||||
static void readAttributes( osgDB::InputStream& is, osg::StateSet::AttributeList& attrs )
|
||||
{
|
||||
unsigned int size = 0; is >> size;
|
||||
unsigned int size = is.readSize();
|
||||
if ( size>0 )
|
||||
{
|
||||
is >> osgDB::BEGIN_BRACKET;
|
||||
@@ -84,7 +84,7 @@ static void writeValue( osgDB::OutputStream& os, int value )
|
||||
|
||||
static void writeModes( osgDB::OutputStream& os, const osg::StateSet::ModeList& modes )
|
||||
{
|
||||
os << modes.size();
|
||||
os.writeSize(modes.size());
|
||||
if ( modes.size()>0 )
|
||||
{
|
||||
os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
@@ -102,7 +102,7 @@ static void writeModes( osgDB::OutputStream& os, const osg::StateSet::ModeList&
|
||||
|
||||
static void writeAttributes( osgDB::OutputStream& os, const osg::StateSet::AttributeList& attrs )
|
||||
{
|
||||
os << attrs.size();
|
||||
os.writeSize(attrs.size());
|
||||
if ( attrs.size()>0 )
|
||||
{
|
||||
os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
@@ -173,7 +173,7 @@ static bool checkTextureModeList( const osg::StateSet& ss )
|
||||
|
||||
static bool readTextureModeList( osgDB::InputStream& is, osg::StateSet& ss )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
osg::StateSet::ModeList modes;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
@@ -193,7 +193,7 @@ static bool readTextureModeList( osgDB::InputStream& is, osg::StateSet& ss )
|
||||
static bool writeTextureModeList( osgDB::OutputStream& os, const osg::StateSet& ss )
|
||||
{
|
||||
const osg::StateSet::TextureModeList& tml = ss.getTextureModeList();
|
||||
os << tml.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(tml.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::StateSet::TextureModeList::const_iterator itr=tml.begin();
|
||||
itr!=tml.end(); ++itr )
|
||||
{
|
||||
@@ -212,7 +212,7 @@ static bool checkTextureAttributeList( const osg::StateSet& ss )
|
||||
|
||||
static bool readTextureAttributeList( osgDB::InputStream& is, osg::StateSet& ss )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
osg::StateSet::AttributeList attrs;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
@@ -232,7 +232,7 @@ static bool readTextureAttributeList( osgDB::InputStream& is, osg::StateSet& ss
|
||||
static bool writeTextureAttributeList( osgDB::OutputStream& os, const osg::StateSet& ss )
|
||||
{
|
||||
const osg::StateSet::TextureAttributeList& tal = ss.getTextureAttributeList();
|
||||
os << tal.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(tal.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::StateSet::TextureAttributeList::const_iterator itr=tal.begin();
|
||||
itr!=tal.end(); ++itr )
|
||||
{
|
||||
@@ -251,7 +251,7 @@ static bool checkUniformList( const osg::StateSet& ss )
|
||||
|
||||
static bool readUniformList( osgDB::InputStream& is, osg::StateSet& ss )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
osg::Uniform* uniform = dynamic_cast<osg::Uniform*>( is.readObject() );
|
||||
@@ -267,7 +267,7 @@ static bool readUniformList( osgDB::InputStream& is, osg::StateSet& ss )
|
||||
static bool writeUniformList( osgDB::OutputStream& os, const osg::StateSet& ss )
|
||||
{
|
||||
const osg::StateSet::UniformList& ul = ss.getUniformList();
|
||||
os << ul.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(ul.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::StateSet::UniformList::const_iterator itr=ul.begin();
|
||||
itr!=ul.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ static bool checkColorMap( const osg::TransferFunction1D& func )
|
||||
|
||||
static bool readColorMap( osgDB::InputStream& is, osg::TransferFunction1D& func )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
float key = 0.0f;
|
||||
@@ -25,7 +25,7 @@ static bool readColorMap( osgDB::InputStream& is, osg::TransferFunction1D& func
|
||||
static bool writeColorMap( osgDB::OutputStream& os, const osg::TransferFunction1D& func )
|
||||
{
|
||||
const osg::TransferFunction1D::ColorMap& map = func.getColorMap();
|
||||
os << map.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(map.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::TransferFunction1D::ColorMap::const_iterator itr=map.begin();
|
||||
itr!=map.end(); ++itr )
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ static bool checkLocalParameters( const osg::VertexProgram& vp )
|
||||
|
||||
static bool readLocalParameters( osgDB::InputStream& is, osg::VertexProgram& vp )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
GLuint key; osg::Vec4d value;
|
||||
@@ -25,7 +25,7 @@ static bool readLocalParameters( osgDB::InputStream& is, osg::VertexProgram& vp
|
||||
static bool writeLocalParameters( osgDB::OutputStream& os, const osg::VertexProgram& vp )
|
||||
{
|
||||
const osg::VertexProgram::LocalParamList& params = vp.getLocalParameters();
|
||||
os << params.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(params.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::VertexProgram::LocalParamList::const_iterator itr=params.begin();
|
||||
itr!=params.end(); ++itr )
|
||||
{
|
||||
@@ -43,7 +43,7 @@ static bool checkMatrices( const osg::VertexProgram& vp )
|
||||
|
||||
static bool readMatrices( osgDB::InputStream& is, osg::VertexProgram& vp )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
unsigned int key; osg::Matrixd value;
|
||||
@@ -57,7 +57,7 @@ static bool readMatrices( osgDB::InputStream& is, osg::VertexProgram& vp )
|
||||
static bool writeMatrices( osgDB::OutputStream& os, const osg::VertexProgram& vp )
|
||||
{
|
||||
const osg::VertexProgram::MatrixList& matrices = vp.getMatrices();
|
||||
os << matrices.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(matrices.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::VertexProgram::MatrixList::const_iterator itr=matrices.begin();
|
||||
itr!=matrices.end(); ++itr )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user