From eac767d494368e610075b79333991a050b313815 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 11 Feb 2010 09:13:33 +0000 Subject: [PATCH] Added futher use of readSize/writeSize. --- src/osgDB/InputStream.cpp | 4 ++-- src/osgDB/OutputStream.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osgDB/InputStream.cpp b/src/osgDB/InputStream.cpp index 741887e3a..57b4675fa 100644 --- a/src/osgDB/InputStream.cpp +++ b/src/osgDB/InputStream.cpp @@ -524,7 +524,7 @@ osg::Image* InputStream::readImage() } // _mipmapData - unsigned int levelSize = 0; *this >> levelSize; + unsigned int levelSize = readSize(); osg::Image::MipmapDataType levels(levelSize); for ( unsigned int i=0; i> size; + unsigned int size = readSize(); if ( size>0 ) { char* data = new char[size]; diff --git a/src/osgDB/OutputStream.cpp b/src/osgDB/OutputStream.cpp index 1d256850a..edca48310 100644 --- a/src/osgDB/OutputStream.cpp +++ b/src/osgDB/OutputStream.cpp @@ -355,11 +355,11 @@ void OutputStream::writeImage( const osg::Image* img ) *this << img->getDataType(); // _dataType *this << img->getPacking(); // _packing *this << img->getAllocationMode(); // _allocationMode - + // _data unsigned int size = img->getTotalSizeInBytesIncludingMipmaps(); - *this << size; writeCharArray( (char*)img->data(), size ); - + writeSize(size); writeCharArray( (char*)img->data(), size ); + // _mipmapData const osg::Image::MipmapDataType& levels = img->getMipmapLevels(); writeSize(levels.size()); @@ -379,7 +379,7 @@ void OutputStream::writeImage( const osg::Image* img ) { infile.seekg( 0, std::ios::end ); unsigned int size = infile.tellg(); - *this << size; + writeSize(size); if ( size>0 ) {