diff --git a/src/osgAnimation/LinkVisitor.cpp b/src/osgAnimation/LinkVisitor.cpp index e9f0bcd03..b8db5f25a 100644 --- a/src/osgAnimation/LinkVisitor.cpp +++ b/src/osgAnimation/LinkVisitor.cpp @@ -48,8 +48,8 @@ void LinkVisitor::handle_stateset(osg::StateSet* stateset) { if (!stateset) return; - osg::StateSet::AttributeList& attr = stateset->getAttributeList(); - for (osg::StateSet::AttributeList::iterator it = attr.begin(); it != attr.end(); ++it) + const osg::StateSet::AttributeList& attr = stateset->getAttributeList(); + for (osg::StateSet::AttributeList::const_iterator it = attr.begin(); it != attr.end(); ++it) { osg::StateAttribute* sattr = it->second.first.get(); osgAnimation::AnimationUpdateCallbackBase* cb = dynamic_cast(sattr->getUpdateCallback()); diff --git a/src/osgDB/SharedStateManager.cpp b/src/osgDB/SharedStateManager.cpp index 83d1330a2..b0b1baa32 100644 --- a/src/osgDB/SharedStateManager.cpp +++ b/src/osgDB/SharedStateManager.cpp @@ -183,7 +183,7 @@ void SharedStateManager::setStateSet(osg::StateSet* ss, osg::Object* object) //---------------------------------------------------------------- void SharedStateManager::shareTextures(osg::StateSet* ss) { - osg::StateSet::TextureAttributeList& texAttributes = ss->getTextureAttributeList(); + const osg::StateSet::TextureAttributeList& texAttributes = ss->getTextureAttributeList(); for(unsigned int unit=0;unitgetTextureAttribute(unit, osg::StateAttribute::TEXTURE); diff --git a/src/osgUtil/GLObjectsVisitor.cpp b/src/osgUtil/GLObjectsVisitor.cpp index 6a686f2cf..94b10d099 100644 --- a/src/osgUtil/GLObjectsVisitor.cpp +++ b/src/osgUtil/GLObjectsVisitor.cpp @@ -128,8 +128,8 @@ void GLObjectsVisitor::apply(osg::StateSet& stateset) _renderInfo.getState()->setLastAppliedProgramObject(pcp); - osg::StateSet::UniformList& ul = stateset.getUniformList(); - for(osg::StateSet::UniformList::iterator itr = ul.begin(); + const osg::StateSet::UniformList& ul = stateset.getUniformList(); + for(osg::StateSet::UniformList::const_iterator itr = ul.begin(); itr != ul.end(); ++itr) { diff --git a/src/osgUtil/IncrementalCompileOperation.cpp b/src/osgUtil/IncrementalCompileOperation.cpp index 49365d148..6690ed897 100644 --- a/src/osgUtil/IncrementalCompileOperation.cpp +++ b/src/osgUtil/IncrementalCompileOperation.cpp @@ -138,7 +138,7 @@ void StateToCompile::apply(osg::StateSet& stateset) _programs.insert(program); } - osg::StateSet::TextureAttributeList& tal = stateset.getTextureAttributeList(); + const osg::StateSet::TextureAttributeList& tal = stateset.getTextureAttributeList(); #if 0 if (tal.size()>1) @@ -146,13 +146,13 @@ void StateToCompile::apply(osg::StateSet& stateset) tal.erase(tal.begin()+1,tal.end()); } #endif - for(osg::StateSet::TextureAttributeList::iterator itr = tal.begin(); + for(osg::StateSet::TextureAttributeList::const_iterator itr = tal.begin(); itr != tal.end(); ++itr) { - osg::StateSet::AttributeList& al = *itr; + const osg::StateSet::AttributeList& al = *itr; osg::StateAttribute::TypeMemberPair tmp(osg::StateAttribute::TEXTURE,0); - osg::StateSet::AttributeList::iterator texItr = al.find(tmp); + osg::StateSet::AttributeList::const_iterator texItr = al.find(tmp); if (texItr != al.end()) { osg::Texture* texture = dynamic_cast(texItr->second.first.get()); diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index b71382d0c..576ec98d6 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -516,8 +516,8 @@ void Optimizer::StateVisitor::optimize() sitr!=_statesets.end(); ++sitr) { - osg::StateSet::AttributeList& attributes = sitr->first->getAttributeList(); - for(osg::StateSet::AttributeList::iterator aitr= attributes.begin(); + const osg::StateSet::AttributeList& attributes = sitr->first->getAttributeList(); + for(osg::StateSet::AttributeList::const_iterator aitr= attributes.begin(); aitr!=attributes.end(); ++aitr) { @@ -528,11 +528,11 @@ void Optimizer::StateVisitor::optimize() } - osg::StateSet::TextureAttributeList& texAttributes = sitr->first->getTextureAttributeList(); + const osg::StateSet::TextureAttributeList& texAttributes = sitr->first->getTextureAttributeList(); for(unsigned int unit=0;unitfirst->getUniformList(); - for(osg::StateSet::UniformList::iterator uitr= uniforms.begin(); + const osg::StateSet::UniformList& uniforms = sitr->first->getUniformList(); + for(osg::StateSet::UniformList::const_iterator uitr= uniforms.begin(); uitr!=uniforms.end(); ++uitr) { @@ -1808,10 +1808,10 @@ void Optimizer::CheckGeometryVisitor::checkGeode(osg::Geode& geode) osg::Geometry* geom = geode.getDrawable(i)->asGeometry(); if (geom && isOperationPermissibleForObject(geom)) { -#ifdef GEOMETRYDEPRECATED +#ifdef GEOMETRYDEPRECATED geom1829 ->computeCorrectBindingsAndArraySizes(); -#endif +#endif } } } @@ -4071,7 +4071,7 @@ void Optimizer::TextureAtlasVisitor::reset() bool Optimizer::TextureAtlasVisitor::pushStateSet(osg::StateSet* stateset) { - osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList(); + const osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList(); // if no textures ignore if (tal.empty()) return false; @@ -4209,7 +4209,7 @@ void Optimizer::TextureAtlasVisitor::optimize() osg::StateSet* stateset = sitr->first; Drawables& drawables = sitr->second; - osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList(); + const osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList(); for(unsigned int unit=0; unit(stateset->getTextureAttribute(unit,osg::StateAttribute::TEXTURE)); @@ -4376,7 +4376,7 @@ void Optimizer::TextureAtlasVisitor::optimize() ++sitr) { osg::StateSet* stateset = sitr->first; - osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList(); + const osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList(); for(unsigned int unit=0; unit(stateset->getTextureAttribute(unit,osg::StateAttribute::TEXTURE));