Show
Ignore:
Timestamp:
01/27/10 18:09:05 (5 years ago)
Author:
robert
Message:

From Wang Rui, "Changes:

1. Rewrite the reading/writing exception handlers to work like the ive
plugin exceptions.
2. Write a header writing/checking function in ReaderWriterOSG2.cpp,
which may help decide if the stream is ascii or binary. The
readInputIterator() function will return null pointer if the input
file is nither osgb nor osgt format, which indicates that the old .osg
format could be used here, in case we've merged the two plugins
together.
3. Add a new ForceReadingImage? option in the InputStream?, which will
allocate an empty image object with the filename if specifed external
image file is missed. It may be useful for format converting in some
cases.
4. Add new osgParticle wrappers, as well as some modification to the
osgParticle headers, for instance, change isEnabled() to getEnabled().
5. Some fixes to the osg serialization wrappers."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/osg/BinaryStreamOperator.h

    r10986 r11018  
    7979    { 
    8080        char c = 0; 
    81         _in->read( &c, CHAR_SIZE ); checkStream(); 
     81        _in->read( &c, CHAR_SIZE ); 
    8282        b = (c!=0); 
    8383    } 
    8484     
    8585    virtual void readChar( char& c ) 
    86     { _in->read( &c, CHAR_SIZE ); checkStream(); } 
     86    { _in->read( &c, CHAR_SIZE ); } 
    8787     
    8888    virtual void readSChar( signed char& c ) 
    89     { _in->read( (char*)&c, CHAR_SIZE ); checkStream(); } 
     89    { _in->read( (char*)&c, CHAR_SIZE ); } 
    9090     
    9191    virtual void readUChar( unsigned char& c ) 
    92     { _in->read( (char*)&c, CHAR_SIZE ); checkStream(); } 
     92    { _in->read( (char*)&c, CHAR_SIZE ); } 
    9393     
    9494    virtual void readShort( short& s ) 
    9595    { 
    96         _in->read( (char*)&s, SHORT_SIZE ); checkStream(); 
     96        _in->read( (char*)&s, SHORT_SIZE ); 
    9797        if ( _byteSwap ) osg::swapBytes( (char*)&s, SHORT_SIZE ); 
    9898    } 
     
    100100    virtual void readUShort( unsigned short& s ) 
    101101    { 
    102         _in->read( (char*)&s, SHORT_SIZE ); checkStream(); 
     102        _in->read( (char*)&s, SHORT_SIZE ); 
    103103        if ( _byteSwap ) osg::swapBytes( (char*)&s, SHORT_SIZE ); 
    104104    } 
     
    106106    virtual void readInt( int& i ) 
    107107    { 
    108         _in->read( (char*)&i, INT_SIZE ); checkStream(); 
     108        _in->read( (char*)&i, INT_SIZE ); 
    109109        if ( _byteSwap ) osg::swapBytes( (char*)&i, INT_SIZE ); 
    110110    } 
     
    112112    virtual void readUInt( unsigned int& i ) 
    113113    { 
    114         _in->read( (char*)&i, INT_SIZE ); checkStream(); 
     114        _in->read( (char*)&i, INT_SIZE ); 
    115115        if ( _byteSwap ) osg::swapBytes( (char*)&i, INT_SIZE ); 
    116116    } 
     
    118118    virtual void readLong( long& l ) 
    119119    { 
    120         _in->read( (char*)&l, LONG_SIZE ); checkStream(); 
     120        _in->read( (char*)&l, LONG_SIZE ); 
    121121        if ( _byteSwap ) osg::swapBytes( (char*)&l, LONG_SIZE ); 
    122122    } 
     
    124124    virtual void readULong( unsigned long& l ) 
    125125    { 
    126         _in->read( (char*)&l, LONG_SIZE ); checkStream(); 
     126        _in->read( (char*)&l, LONG_SIZE ); 
    127127        if ( _byteSwap ) osg::swapBytes( (char*)&l, LONG_SIZE ); 
    128128    } 
     
    130130    virtual void readFloat( float& f ) 
    131131    { 
    132         _in->read( (char*)&f, FLOAT_SIZE ); checkStream(); 
     132        _in->read( (char*)&f, FLOAT_SIZE ); 
    133133        if ( _byteSwap ) osg::swapBytes( (char*)&f, FLOAT_SIZE ); 
    134134    } 
     
    136136    virtual void readDouble( double& d ) 
    137137    { 
    138         _in->read( (char*)&d, DOUBLE_SIZE ); checkStream(); 
     138        _in->read( (char*)&d, DOUBLE_SIZE ); 
    139139        if ( _byteSwap ) osg::swapBytes( (char*)&d, DOUBLE_SIZE ); 
    140140    } 
     
    146146        { 
    147147            s.resize( size ); 
    148             _in->read( (char*)s.c_str(), size ); checkStream(); 
     148            _in->read( (char*)s.c_str(), size ); 
    149149        } 
    150150    } 
     
    157157    { 
    158158        GLenum e = 0; 
    159         _in->read( (char*)&e, GLENUM_SIZE ); checkStream(); 
     159        _in->read( (char*)&e, GLENUM_SIZE ); 
    160160        if ( _byteSwap ) osg::swapBytes( (char*)&e, GLENUM_SIZE ); 
    161161        value.set( e ); 
     
    167167        if ( prop._mapProperty ) 
    168168        { 
    169             _in->read( (char*)&value, INT_SIZE ); checkStream(); 
     169            _in->read( (char*)&value, INT_SIZE ); 
    170170            if ( _byteSwap ) osg::swapBytes( (char*)&value, INT_SIZE ); 
    171171        } 
     
    176176     
    177177    virtual void readCharArray( char* s, unsigned int size ) 
    178     { if ( size>0 ) _in->read( s, size ); checkStream(); } 
     178    { if ( size>0 ) _in->read( s, size ); } 
    179179     
    180180protected: