Added s/getByteSwap to teh InputStreamOperator base class and use of this method in the InputStream::start(InputStreamOperator*) method to ensure the bytes are swapped consistently.
This commit is contained in:
@@ -140,6 +140,9 @@ public:
|
||||
osg::Object* readObject( osg::Object* existingObj=0 );
|
||||
osg::Object* readObjectFields( const std::string& className, unsigned int id, osg::Object* existingObj=0);
|
||||
|
||||
void setByteSwap(int byteSwap) { _byteSwap = byteSwap; }
|
||||
int getByteSwap() const { return _byteSwap; }
|
||||
|
||||
/// set an input iterator, used directly when not using InputStream with a traditional file releated stream.
|
||||
void setInputIterator( InputIterator* ii ) { _in = ii; }
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ protected:
|
||||
class OSGDB_EXPORT InputIterator : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
InputIterator() : _in(0), _inputStream(0), _failed(false) {}
|
||||
InputIterator() : _in(0), _inputStream(0), _byteSwap(0), _failed(false) {}
|
||||
virtual ~InputIterator() {}
|
||||
|
||||
void setStream( std::istream* istream ) { _in = istream; }
|
||||
@@ -79,7 +79,10 @@ public:
|
||||
void setInputStream( InputStream* inputStream) { _inputStream = inputStream; }
|
||||
InputStream* getInputStream() { return _inputStream; }
|
||||
const InputStream* getInputStream() const { return _inputStream; }
|
||||
|
||||
|
||||
void setByteSwap(int byteSwap) { _byteSwap = byteSwap; }
|
||||
int getByteSwap() const { return _byteSwap; }
|
||||
|
||||
void checkStream() const { if (_in->rdstate()&_in->failbit) _failed = true; }
|
||||
bool isFailed() const { return _failed; }
|
||||
|
||||
@@ -115,7 +118,8 @@ public:
|
||||
protected:
|
||||
std::istream* _in;
|
||||
osgDB::InputStream* _inputStream;
|
||||
mutable bool _failed;
|
||||
int _byteSwap;
|
||||
mutable bool _failed;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user