From c9f43996f3147100627ee2c6f9da993ceb160113 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 Apr 2012 02:26:34 +0300 Subject: Improve iterators part 2. --- src/openglgraphics.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/openglgraphics.cpp') diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index 9dd655420..40f1087d0 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -671,19 +671,22 @@ void OpenGLGraphics::drawImagePattern2(GraphicsVertexes *vert, Image *image) std::vector *intVertPool = ogl->getIntVertPool(); std::vector::const_iterator iv; + std::vector::const_iterator iv_end = intVertPool->end(); std::vector *vp = ogl->getVp(); std::vector::const_iterator ivp; + std::vector::const_iterator ivp_end = vp->end(); // Draw a set of textured rectangles if (image->mTextureType == GL_TEXTURE_2D) { std::vector *floatTexPool = ogl->getFloatTexPool(); std::vector::const_iterator ft; + std::vector::const_iterator ft_end = floatTexPool->end(); for (iv = intVertPool->begin(), ft = floatTexPool->begin(), ivp = vp->begin(); - iv != intVertPool->end(), ft != floatTexPool->end(), - ivp != vp->end(); + iv != iv_end, ft != ft_end, + ivp != ivp_end; ++ iv, ++ ft, ++ ivp) { drawQuadArrayfi(*iv, *ft, *ivp); @@ -693,11 +696,12 @@ void OpenGLGraphics::drawImagePattern2(GraphicsVertexes *vert, Image *image) { std::vector *intTexPool = ogl->getIntTexPool(); std::vector::const_iterator it; + std::vector::const_iterator it_end = intTexPool->end(); for (iv = intVertPool->begin(), it = intTexPool->begin(), ivp = vp->begin(); - iv != intVertPool->end(), it != intTexPool->end(), - ivp != vp->end(); + iv != iv_end, it != it_end, + ivp != ivp_end; ++ iv, ++ it, ++ ivp) { drawQuadArrayii(*iv, *it, *ivp); -- cgit v1.2.3-60-g2f50