From 70d2c8571bb75359a1e5da2520be09fe675ccb61 Mon Sep 17 00:00:00 2001 From: Johannes Ebersold Date: Wed, 19 Nov 2014 14:04:49 +0100 Subject: [PATCH] ColladaParser::ReadPrimitives: get rid of "idx" iterator. We will be adding non-sequential access to the indices vector in one of the upcoming commits. --- code/ColladaParser.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 693588810..4a6737d9d 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -2093,10 +2093,6 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector& pPer acc->mData = &ResolveLibraryReference( mDataLibrary, acc->mSource); } - - // now assemble vertex data according to those indices - std::vector::const_iterator idx = indices.begin(); - // For continued primitives, the given count does not come all in one

, but only one primitive per

size_t numPrimitives = pNumPrimitives; if( pPrimType == Prim_TriFans || pPrimType == Prim_Polygon) @@ -2140,7 +2136,7 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector& pPer ai_assert( numOffsets < 20 && perVertexOffset < 20); size_t vindex[20]; for( size_t offsets = 0; offsets < numOffsets; ++offsets) - vindex[offsets] = *idx++; + vindex[offsets] = indices[currentPrimitive * numOffsets * numPoints + b * numOffsets + offsets]; // extract per-vertex channels using the global per-vertex offset for( std::vector::iterator it = pMesh->mPerVertexData.begin(); it != pMesh->mPerVertexData.end(); ++it)