diff --git a/src/osgWrappers/serializers/osgAnimation/Animation.cpp b/src/osgWrappers/serializers/osgAnimation/Animation.cpp index 30e599324..5f08723c0 100644 --- a/src/osgWrappers/serializers/osgAnimation/Animation.cpp +++ b/src/osgWrappers/serializers/osgAnimation/Animation.cpp @@ -23,7 +23,7 @@ static void readContainer( osgDB::InputStream& is, ContainerType* container ) if ( hasContainer ) { unsigned int size = 0; - is >> size >> osgDB::BEGIN_BRACKET; + size = is.readSize(); is >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; i> size >> osgDB::BEGIN_BRACKET; + size = is.readSize(); is >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; isize() << osgDB::BEGIN_BRACKET << std::endl; + os.writeSize(container->size()); os << osgDB::BEGIN_BRACKET << std::endl; for ( unsigned int i=0; isize(); ++i ) { os << (*container)[i].getTime() << (*container)[i].getValue() << std::endl; @@ -107,7 +107,7 @@ static void writeContainer2( osgDB::OutputStream& os, ContainerType* container ) os << osgDB::PROPERTY("KeyFrameContainer") << (container!=NULL); if ( container!=NULL ) { - os << container->size() << osgDB::BEGIN_BRACKET << std::endl; + os.writeSize(container->size()); os << osgDB::BEGIN_BRACKET << std::endl; for ( unsigned int i=0; isize(); ++i ) { const KeyType& keyframe = (*container)[i]; @@ -149,7 +149,7 @@ static bool checkChannels( const osgAnimation::Animation& ani ) static bool readChannels( osgDB::InputStream& is, osgAnimation::Animation& ani ) { - 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 >> osgDB::BEGIN_BRACKET; + unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; i( is.readObject() ); @@ -26,7 +26,7 @@ static bool readAnimations( osgDB::InputStream& is, osgAnimation::AnimationManag static bool writeAnimations( osgDB::OutputStream& os, const osgAnimation::AnimationManagerBase& manager ) { const osgAnimation::AnimationList& animations = manager.getAnimationList(); - os << animations.size() << osgDB::BEGIN_BRACKET << std::endl; + os.writeSize(animations.size()); os << osgDB::BEGIN_BRACKET << std::endl; for ( osgAnimation::AnimationList::const_iterator itr=animations.begin(); itr!=animations.end(); ++itr ) { diff --git a/src/osgWrappers/serializers/osgAnimation/MorphGeometry.cpp b/src/osgWrappers/serializers/osgAnimation/MorphGeometry.cpp index 6cc6aa4f1..2f9a3ea67 100644 --- a/src/osgWrappers/serializers/osgAnimation/MorphGeometry.cpp +++ b/src/osgWrappers/serializers/osgAnimation/MorphGeometry.cpp @@ -10,7 +10,7 @@ static bool checkMorphTargets( const osgAnimation::MorphGeometry& geom ) static bool readMorphTargets( osgDB::InputStream& is, osgAnimation::MorphGeometry& 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 >> osgDB::BEGIN_BRACKET; + unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; i> osgDB::PROPERTY("VertexInfluence") >> name >> viSize >> osgDB::BEGIN_BRACKET; + is >> osgDB::PROPERTY("VertexInfluence") >> name; viSize = is.readSize(); is >> osgDB::BEGIN_BRACKET; osgAnimation::VertexInfluence vi; vi.setName( name ); @@ -40,7 +40,7 @@ static bool readInfluenceMap( osgDB::InputStream& is, osgAnimation::RigGeometry& static bool writeInfluenceMap( osgDB::OutputStream& os, const osgAnimation::RigGeometry& geom ) { const osgAnimation::VertexInfluenceMap* map = geom.getInfluenceMap(); - os << map->size() << osgDB::BEGIN_BRACKET << std::endl; + os.writeSize(map->size()); os << osgDB::BEGIN_BRACKET << std::endl; for ( osgAnimation::VertexInfluenceMap::const_iterator itr=map->begin(); itr!=map->end(); ++itr ) { @@ -48,8 +48,8 @@ static bool writeInfluenceMap( osgDB::OutputStream& os, const osgAnimation::RigG const osgAnimation::VertexInfluence& vi = itr->second; if ( name.empty() ) name = "Empty"; - os << osgDB::PROPERTY("VertexInfluence") << name << vi.size() - << osgDB::BEGIN_BRACKET << std::endl; + os << osgDB::PROPERTY("VertexInfluence") << name; os.writeSize(vi.size()) ; os << osgDB::BEGIN_BRACKET << std::endl; + for ( osgAnimation::VertexInfluence::const_iterator vitr=vi.begin(); vitr != vi.end(); ++vitr ) { diff --git a/src/osgWrappers/serializers/osgAnimation/UpdateMatrixTransform.cpp b/src/osgWrappers/serializers/osgAnimation/UpdateMatrixTransform.cpp index 0b98cb8ef..fc7a4340a 100644 --- a/src/osgWrappers/serializers/osgAnimation/UpdateMatrixTransform.cpp +++ b/src/osgWrappers/serializers/osgAnimation/UpdateMatrixTransform.cpp @@ -14,7 +14,7 @@ static bool checkStackedTransforms( const osgAnimation::UpdateMatrixTransform& o static bool readStackedTransforms( osgDB::InputStream& is, osgAnimation::UpdateMatrixTransform& obj ) { osgAnimation::StackedTransform& transform = obj.getStackedTransforms(); - 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 >> osgDB::BEGIN_BRACKET; + unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; i> weight; @@ -23,7 +23,7 @@ static bool readTextureWeights( osgDB::InputStream& is, osgFX::MultiTextureContr static bool writeTextureWeights( osgDB::OutputStream& os, const osgFX::MultiTextureControl& ctrl ) { unsigned int size = ctrl.getNumTextureWeights(); - os << size << osgDB::BEGIN_BRACKET << std::endl; + os.writeSize(size); os << osgDB::BEGIN_BRACKET << std::endl; for ( unsigned int i=0; i