From: curt Date: Tue, 8 Sep 1998 21:40:42 +0000 (+0000) Subject: Updates from Bernie Bright. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b318fec021cb750c96813eba122954b5d4644f2e;p=flightgear.git Updates from Bernie Bright. --- diff --git a/Objects/fragment.cxx b/Objects/fragment.cxx index 645a5c5ea..c36136479 100644 --- a/Objects/fragment.cxx +++ b/Objects/fragment.cxx @@ -99,7 +99,6 @@ int fgFRAGMENT::intersect( const fgPoint3d *end0, fgPoint3d *result) const { fgTILE *t; - fgFACE face; MAT3vec v1, v2, n, center; double p1[3], p2[3], p3[3]; double x, y, z; // temporary holding spot for result @@ -116,12 +115,9 @@ int fgFRAGMENT::intersect( const fgPoint3d *end0, // printf("Intersecting\n"); // traverse the face list for this fragment - const_iterator current = faces.begin(); const_iterator last = faces.end(); - while ( current != last ) { - face = *current; - current++; - + for ( const_iterator current = faces.begin(); current != last; ++current ) + { // printf("."); // get face vertex coordinates @@ -129,9 +125,9 @@ int fgFRAGMENT::intersect( const fgPoint3d *end0, center[1] = t->center.y; center[2] = t->center.z; - MAT3_ADD_VEC(p1, t->nodes[face.n1], center); - MAT3_ADD_VEC(p2, t->nodes[face.n2], center); - MAT3_ADD_VEC(p3, t->nodes[face.n3], center); + MAT3_ADD_VEC(p1, t->nodes[(*current).n1], center); + MAT3_ADD_VEC(p2, t->nodes[(*current).n2], center); + MAT3_ADD_VEC(p3, t->nodes[(*current).n3], center); // printf("point 1 = %.2f %.2f %.2f\n", p1[0], p1[1], p1[2]); // printf("point 2 = %.2f %.2f %.2f\n", p2[0], p2[1], p2[2]); @@ -334,6 +330,9 @@ int fgFRAGMENT::intersect( const fgPoint3d *end0, } // $Log$ +// Revision 1.3 1998/09/08 21:40:42 curt +// Updates from Bernie Bright. +// // Revision 1.2 1998/09/01 19:03:07 curt // Changes contributed by Bernie Bright // - The new classes in libmisc.tgz define a stream interface into zlib. diff --git a/Objects/fragment.hxx b/Objects/fragment.hxx index 92d67675b..3c9e728e4 100644 --- a/Objects/fragment.hxx +++ b/Objects/fragment.hxx @@ -46,7 +46,7 @@ extern "C" void *memmove(void *, const void *, size_t); extern "C" void *memset(void *, int, size_t); #endif -#include // STL list +#include #include #include @@ -116,7 +116,7 @@ public: GLint display_list; // face list (this indexes into the master tile vertex list) - typedef list < fgFACE > container; + typedef vector < fgFACE > container; typedef container::iterator iterator; typedef container::const_iterator const_iterator; @@ -142,7 +142,7 @@ public: fgPoint3d *result) const; // Constructors - fgFRAGMENT () {} + fgFRAGMENT () : num_faces(0) { /*faces.reserve(512);*/} fgFRAGMENT ( const fgFRAGMENT &image ); // Destructor @@ -161,8 +161,8 @@ public: num_faces = 0; } - void deleteDisplayList() { - xglDeleteLists( display_list, 1 ); + int deleteDisplayList() { + xglDeleteLists( display_list, 1 ); return 0; } }; @@ -178,6 +178,9 @@ operator == ( const fgFRAGMENT & lhs, const fgFRAGMENT & rhs ) { // $Log$ +// Revision 1.3 1998/09/08 21:40:44 curt +// Updates from Bernie Bright. +// // Revision 1.2 1998/09/01 19:03:08 curt // Changes contributed by Bernie Bright // - The new classes in libmisc.tgz define a stream interface into zlib.