From: curt Date: Tue, 19 Oct 1999 20:34:58 +0000 (+0000) Subject: Updates to tools to move the class FGArray into the lib area so it could X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=eb81fb7a2dbac82529382af4f359e18f4290896c;p=flightgear.git Updates to tools to move the class FGArray into the lib area so it could be used by multiple programs. Fixed a triangle loading bug in obj.cxx introduced when I added tri-strip functionality. --- diff --git a/src/Objects/obj.cxx b/src/Objects/obj.cxx index 4d3cdfb17..fb725fd46 100644 --- a/src/Objects/obj.cxx +++ b/src/Objects/obj.cxx @@ -700,15 +700,21 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) { // xglTexCoord2f(pp.x(), pp.y()); // xglVertex3dv(nodes[n3].get_n()); - if ( odd ) { + if ( token == "tf" ) { + // triangle fan fragment.add_face(n1, n2, n3); + n2 = n3; } else { - fragment.add_face(n2, n1, n3); + // triangle strip + if ( odd ) { + fragment.add_face(n1, n2, n3); + } else { + fragment.add_face(n2, n1, n3); + } + odd = !odd; + n1 = n2; + n2 = n3; } - - odd = !odd; - n1 = n2; - n2 = n3; } // xglEnd();