From b408b351d093bb521c90eac2a4640a66fbf531ef Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Sat, 2 Oct 2010 10:06:34 +0200 Subject: [PATCH] Fix index trashing --- src/BuildTiles/GenOutput/genobj.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/BuildTiles/GenOutput/genobj.cxx b/src/BuildTiles/GenOutput/genobj.cxx index d2b41762..a8f80d2e 100644 --- a/src/BuildTiles/GenOutput/genobj.cxx +++ b/src/BuildTiles/GenOutput/genobj.cxx @@ -209,14 +209,15 @@ int TGGenOutput::build( TGConstruct& c ) { ti_list.push_back( index ); } } else { + int k; std::vector < SGGeod > convGeodNodes; - for ( j = 0; j < geod_nodes.size(); j++ ) { - Point3D node = geod_nodes[j]; + for ( k = 0; k < geod_nodes.size(); k++ ) { + Point3D node = geod_nodes[k]; convGeodNodes.push_back( SGGeod::fromDegM( node.x(), node.y(), node.z() ) ); } std::vector< SGVec2f > tp_list = sgCalcTexCoords( b, convGeodNodes, fans[i][j] ); - for ( j = 0; j < (int)tp_list.size(); ++j ) { - SGVec2f tc = tp_list[j]; + for ( k = 0; k < (int)tp_list.size(); ++k ) { + SGVec2f tc = tp_list[k]; // SG_LOG(SG_GENERAL, SG_DEBUG, "base_tc = " << tc); int index = tex_coords.simple_add( Point3D( tc.x(), tc.y(), 0 ) ); ti_list.push_back( index ); @@ -287,7 +288,7 @@ void TGGenOutput::calc_group_bounding_sphere( TGConstruct& c, } -// caclulate the bounding sphere for the specified triangle face +// calculate the bounding sphere for the specified triangle face void TGGenOutput::calc_bounding_sphere( TGConstruct& c, const TGTriEle& t, Point3D *center, double *radius ) {