From 8f20bc91476d7504fcfe36b799f1d027bca2c1a2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 25 May 2016 10:10:43 +0100 Subject: [PATCH] Fixed shadows warnings --- src/osgText/GlyphGeometry.cpp | 8 ++++---- src/osgText/Text3D.cpp | 32 ++++++++++++++++---------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/osgText/GlyphGeometry.cpp b/src/osgText/GlyphGeometry.cpp index 55504816d..f86953dca 100644 --- a/src/osgText/GlyphGeometry.cpp +++ b/src/osgText/GlyphGeometry.cpp @@ -661,11 +661,11 @@ OSGTEXT_EXPORT osg::Geometry* computeGlyphGeometry(const osgText::Glyph3D* glyph orig_primitives.push_back(new_elements.get()); int num_indices = elements->size(); - for(int i = 0; isize()-2)] : (*elements)[i-1]; - int vi_curr = (*elements)[i]; - int vi_after = (*elements)[i+1]; + int vi_before = (ei==0) ? (*elements)[(elements->size()-2)] : (*elements)[ei-1]; + int vi_curr = (*elements)[ei]; + int vi_after = (*elements)[ei+1]; osg::Vec3 va = (*source_vertices)[vi_before]; osg::Vec3 vb = (*source_vertices)[vi_curr]; diff --git a/src/osgText/Text3D.cpp b/src/osgText/Text3D.cpp index 0868ae61f..4b9636a05 100644 --- a/src/osgText/Text3D.cpp +++ b/src/osgText/Text3D.cpp @@ -65,8 +65,8 @@ void Text3D::accept(osg::PrimitiveFunctor& pf) const for (itLine = _textRenderInfo.begin(); itLine!=endLine; ++itLine) { // ** for each glyph in the line, do ... - LineRenderInfo::const_iterator it, end = itLine->end(); - for (it = itLine->begin(); it!=end; ++it) + LineRenderInfo::const_iterator it, line_end = itLine->end(); + for (it = itLine->begin(); it!=line_end; ++it) { osg::Vec3Array* vertices = it->_glyphGeometry->getVertexArray(); @@ -601,12 +601,12 @@ void Text3D::renderPerGlyph(osg::State & state) const else if (backStateSet->getAttribute(osg::StateAttribute::MATERIAL)!=0) applyMainColor = true; // ** for each line, do ... - TextRenderInfo::const_iterator itLine, endLine = _textRenderInfo.end(); - for (itLine = _textRenderInfo.begin(); itLine!=endLine; ++itLine) + TextRenderInfo::const_iterator itLine, endText = _textRenderInfo.end(); + for (itLine = _textRenderInfo.begin(); itLine!=endText; ++itLine) { // ** for each glyph in the line, do ... - LineRenderInfo::const_iterator it, end = itLine->end(); - for (it = itLine->begin(); it!=end; ++it) + LineRenderInfo::const_iterator it, endLine = itLine->end(); + for (it = itLine->begin(); it!=endLine; ++it) { osg::Matrix matrix(original_modelview); @@ -677,12 +677,12 @@ void Text3D::renderPerFace(osg::State & state) const else if (backStateSet->getAttribute(osg::StateAttribute::MATERIAL)!=0) applyMainColor = true; - TextRenderInfo::const_iterator itLine, endLine = _textRenderInfo.end(); - for (itLine = _textRenderInfo.begin(); itLine!=endLine; ++itLine) + TextRenderInfo::const_iterator itLine, endText = _textRenderInfo.end(); + for (itLine = _textRenderInfo.begin(); itLine!=endText; ++itLine) { // ** for each glyph in the line, do ... - LineRenderInfo::const_iterator it, end = itLine->end(); - for (it = itLine->begin(); it!=end; ++it) + LineRenderInfo::const_iterator it, endLine = itLine->end(); + for (it = itLine->begin(); it!=endLine; ++it) { osg::Matrix matrix(original_modelview); matrix.preMultTranslate(osg::Vec3d(it->_position.x(), it->_position.y(), it->_position.z())); @@ -703,11 +703,11 @@ void Text3D::renderPerFace(osg::State & state) const if (wallStateSet!=frontStateSet) state.apply(wallStateSet); // ** render all wall face of the text - for (itLine = _textRenderInfo.begin(); itLine!=endLine; ++itLine) + for (itLine = _textRenderInfo.begin(); itLine!=endText; ++itLine) { // ** for each glyph in the line, do ... - LineRenderInfo::const_iterator it, end = itLine->end(); - for (it = itLine->begin(); it!=end; ++it) + LineRenderInfo::const_iterator it, endLine = itLine->end(); + for (it = itLine->begin(); it!=endLine; ++it) { osg::Matrix matrix(original_modelview); matrix.preMultTranslate(osg::Vec3d(it->_position.x(), it->_position.y(), it->_position.z())); @@ -736,11 +736,11 @@ void Text3D::renderPerFace(osg::State & state) const if (applyMainColor) state.Color(_color.r(),_color.g(),_color.b(),_color.a()); } - for (itLine = _textRenderInfo.begin(); itLine!=endLine; ++itLine) + for (itLine = _textRenderInfo.begin(); itLine!=endText; ++itLine) { // ** for each glyph in the line, do ... - LineRenderInfo::const_iterator it, end = itLine->end(); - for (it = itLine->begin(); it!=end; ++it) + LineRenderInfo::const_iterator it, endLine = itLine->end(); + for (it = itLine->begin(); it!=endLine; ++it) { osg::Matrix matrix(original_modelview); matrix.preMultTranslate(osg::Vec3d(it->_position.x(), it->_position.y(), it->_position.z()));