]> git.mxchange.org Git - flightgear.git/commitdiff
Moving towards increased dependence on ssg.
authorcurt <curt>
Sat, 7 Aug 1999 18:27:29 +0000 (18:27 +0000)
committercurt <curt>
Sat, 7 Aug 1999 18:27:29 +0000 (18:27 +0000)
src/Airports/genapt.cxx
src/Objects/fragment.cxx
src/Objects/fragment.hxx
src/Objects/materialmgr.cxx
src/Objects/obj.cxx
src/Objects/obj.hxx
src/Scenery/tileentry.cxx
src/Scenery/tilemgr.cxx

index f4cbec0609049dbfac9fd10922bbe9fe07190cbc..2e2bcb66aea629f838252d0b0e4793d1ccc8e426 100644 (file)
@@ -197,7 +197,7 @@ gen_base( const Point3D& average, const container& perimeter, FGTileEntry *t)
     xglEndList();
 
     fragment.bounding_radius = sqrt(max_dist);
-    fragment.display_list = display_list;
+    // fragment.display_list = display_list;
 
     t->fragment_list.push_back(fragment);
 }
index 2459dd13f47588ac9e078fcc07cfc14c9db69a80..3398e16530eec76b536531e15270d6dcb9e0f136 100644 (file)
@@ -66,7 +66,7 @@ fgFRAGMENT::fgFRAGMENT ( const fgFRAGMENT & rhs ) :
     bounding_radius( rhs.bounding_radius ),
     material_ptr   ( rhs.material_ptr    ),
     tile_ptr       ( rhs.tile_ptr        ),
-    display_list   ( rhs.display_list    ),
+    /* display_list   ( rhs.display_list    ), */
     faces          ( rhs.faces           )
 {
 }
index ab7d32b12ff5dbb8eedc2077b5ab27b39903d467..cd631420f9abe39e54745a65cdef59714eb8ddea 100644 (file)
@@ -104,7 +104,7 @@ public:
     FGTileEntry *tile_ptr;
 
     // OpenGL display list for fragment data
-    GLint display_list;
+    // GLint display_list;
 
     // face list (this indexes into the master tile vertex list)
     typedef vector < fgFACE > container;
@@ -154,9 +154,9 @@ public:
        faces.erase( faces.begin(), faces.end() );
     }
 
-    int deleteDisplayList() {
-       xglDeleteLists( display_list, 1 ); return 0;
-    }
+    // int deleteDisplayList() {
+    //    xglDeleteLists( display_list, 1 ); return 0;
+    // }
 
     friend bool operator== ( const fgFRAGMENT & lhs, const fgFRAGMENT & rhs );
 };
index c6e30d55886a6a1802105994c3001deec11ec009..30495b8f2a831452171fa987e1bb45887a4c5980 100644 (file)
@@ -76,6 +76,10 @@ fgMATERIAL_MGR::fgMATERIAL_MGR ( void ) {
 void
 FGMaterialSlot::render_fragments()
 {
+    FG_LOG( FG_GENERAL, FG_ALERT, 
+           "FGMaterialSlot::render_fragments() is depricated ... " <<
+           "we shouldn't be here!" );
+
     int tris_rendered = current_view.get_tris_rendered();
 
     // cout << "rendering " + texture_name + " = " << list_size << "\n";
@@ -117,7 +121,7 @@ FGMaterialSlot::render_fragments()
 
        // Woohoo!!!  We finally get to draw something!
        // printf("  display_list = %d\n", frag_ptr->display_list);
-       xglCallList( frag_ptr->display_list );
+       // xglCallList( frag_ptr->display_list );
     }
 
     current_view.set_tris_rendered( tris_rendered );
index eb400bb78ccd6067b287fd198b8a0b4eaf47204c..38729da3f1fb2f230960eb652d055106abcaf5b0 100644 (file)
 #  include <math.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
+// #ifdef HAVE_WINDOWS_H
+// #  include <windows.h>
+// #endif
 
 #include <stdio.h>
 #include <string.h>
-#include <GL/glut.h>
-#include <XGL/xgl.h>
+// #include <GL/glut.h>
+// #include <XGL/xgl.h>
 
 // #if defined ( __sun__ )
 // extern "C" void *memmove(void *, const void *, size_t);
@@ -134,14 +134,14 @@ static Point3D calc_tex_coords(const Point3D& node, const Point3D& ref) {
 }
 
 
-// Load a .obj file and build the GL fragment list
+// Load a .obj file and build the fragment list
 ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
     fgFRAGMENT fragment;
     Point3D pp;
-    double approx_normal[3], normal[3] /*, scale = 0.0 */;
+    double approx_normal[3] /*, normal[3], scale = 0.0 */;
     // double x, y, z, xmax, xmin, ymax, ymin, zmax, zmin;
     // GLfloat sgenparams[] = { 1.0, 0.0, 0.0, 0.0 };
-    GLint display_list = 0;
+    // GLint display_list = 0;
     int shading;
     bool in_fragment = false, in_faces = false;
     int vncount, vtcount;
@@ -228,7 +228,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                // shared_done true and build the ssg shared lists
                if ( ! shared_done ) {
                    // sanity check
-                   if ( nodes.size() != vncount ) {
+                   if ( (int)nodes.size() != vncount ) {
                        FG_LOG( FG_TERRAIN, FG_ALERT, 
                                "Tile has mismatched nodes and normals: " 
                                << path );
@@ -257,18 +257,18 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                }
 
                // series of individual triangles
-               if ( in_faces ) {
-                   xglEnd();
-               }
+               // if ( in_faces ) {
+               //     xglEnd();
+               // }
 
                // this also signals the start of a new fragment
                if ( in_fragment ) {
                    // close out the previous structure and start the next
-                   xglEndList();
+                   // xglEndList();
                    // printf("xglEnd(); xglEndList();\n");
 
                    // update fragment
-                   fragment.display_list = display_list;
+                   // fragment.display_list = display_list;
 
                    // push this fragment onto the tile's object list
                    t->fragment_list.push_back(fragment);
@@ -278,8 +278,8 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
 
                // printf("start of fragment (usemtl)\n");
 
-               display_list = xglGenLists(1);
-               xglNewList(display_list, GL_COMPILE);
+               // display_list = xglGenLists(1);
+               // xglNewList(display_list, GL_COMPILE);
                // printf("xglGenLists(); xglNewList();\n");
                in_faces = false;
 
@@ -383,7 +383,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
 
                // fgPrintf( FG_TERRAIN, FG_DEBUG, "(t) = ");
 
-               xglBegin(GL_TRIANGLE_STRIP);
+               // xglBegin(GL_TRIANGLE_STRIP);
                // printf("xglBegin(tristrip) %d %d %d\n", n1, n2, n3);
 
                odd = 1; 
@@ -393,22 +393,22 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                    // Shading model is "GL_SMOOTH" so use precalculated
                    // (averaged) normals
                    // MAT3_SCALE_VEC(normal, normals[n1], scale);
-                   xglNormal3dv(normal);
+                   // xglNormal3dv(normal);
                    pp = calc_tex_coords(nodes[n1], center);
-                   xglTexCoord2f(pp.lon(), pp.lat());
-                   xglVertex3dv(nodes[n1].get_n());            
+                   // xglTexCoord2f(pp.lon(), pp.lat());
+                   // xglVertex3dv(nodes[n1].get_n());         
 
                    // MAT3_SCALE_VEC(normal, normals[n2], scale);
-                   xglNormal3dv(normal);
+                   // xglNormal3dv(normal);
                    pp = calc_tex_coords(nodes[n2], center);
-                   xglTexCoord2f(pp.lon(), pp.lat());
-                   xglVertex3dv(nodes[n2].get_n());                            
+                   // xglTexCoord2f(pp.lon(), pp.lat());
+                   // xglVertex3dv(nodes[n2].get_n());                         
 
                    // MAT3_SCALE_VEC(normal, normals[n3], scale);
-                   xglNormal3dv(normal);
+                   // xglNormal3dv(normal);
                    pp = calc_tex_coords(nodes[n3], center);
-                   xglTexCoord2f(pp.lon(), pp.lat());
-                   xglVertex3dv(nodes[n3].get_n());
+                   // xglTexCoord2f(pp.lon(), pp.lat());
+                   // xglVertex3dv(nodes[n3].get_n());
                } else {
                    // Shading model is "GL_FLAT" so calculate per face
                    // normals on the fly.
@@ -420,19 +420,19 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                                    nodes[n3], approx_normal);
                    }
                    // MAT3_SCALE_VEC(normal, approx_normal, scale);
-                   xglNormal3dv(normal);
+                   // xglNormal3dv(normal);
 
                    pp = calc_tex_coords(nodes[n1], center);
-                   xglTexCoord2f(pp.lon(), pp.lat());
-                   xglVertex3dv(nodes[n1].get_n());            
+                   // xglTexCoord2f(pp.lon(), pp.lat());
+                   // xglVertex3dv(nodes[n1].get_n());         
 
                    pp = calc_tex_coords(nodes[n2], center);
-                   xglTexCoord2f(pp.lon(), pp.lat());
-                   xglVertex3dv(nodes[n2].get_n());            
+                   // xglTexCoord2f(pp.lon(), pp.lat());
+                   // xglVertex3dv(nodes[n2].get_n());         
                    
                    pp = calc_tex_coords(nodes[n3], center);
-                   xglTexCoord2f(pp.lon(), pp.lat());
-                   xglVertex3dv(nodes[n3].get_n());            
+                   // xglTexCoord2f(pp.lon(), pp.lat());
+                   // xglVertex3dv(nodes[n3].get_n());         
                }
                // printf("some normals, texcoords, and vertices\n");
 
@@ -465,10 +465,10 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                                    approx_normal);
                        // MAT3_SCALE_VEC(normal, approx_normal, scale);
                    }
-                   xglNormal3dv(normal);
+                   // xglNormal3dv(normal);
                    pp = calc_tex_coords(nodes[n4], center);
-                   xglTexCoord2f(pp.lon(), pp.lat());
-                   xglVertex3dv(nodes[n4].get_n());            
+                   // xglTexCoord2f(pp.lon(), pp.lat());
+                   // xglVertex3dv(nodes[n4].get_n());         
                    
                    odd = 1 - odd;
                    last1 = n3;
@@ -482,11 +482,11 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                fan_vertices.clear();
                fan_tex_coords.clear();
 
-               xglBegin(GL_TRIANGLE_FAN);
+               // xglBegin(GL_TRIANGLE_FAN);
 
                in >> n1;
                fan_vertices.push_back( n1 );
-               xglNormal3dv(normals[n1]);
+               // xglNormal3dv(normals[n1]);
                if ( in.get( c ) && c == '/' ) {
                    in >> tex;
                    fan_tex_coords.push_back( tex );
@@ -496,12 +496,12 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                    in.putback( c );
                    pp = calc_tex_coords(nodes[n1], center);
                }
-               xglTexCoord2f(pp.x(), pp.y());
-               xglVertex3dv(nodes[n1].get_n());
+               // xglTexCoord2f(pp.x(), pp.y());
+               // xglVertex3dv(nodes[n1].get_n());
 
                in >> n2;
                fan_vertices.push_back( n2 );
-               xglNormal3dv(normals[n2]);
+               // xglNormal3dv(normals[n2]);
                if ( in.get( c ) && c == '/' ) {
                    in >> tex;
                    fan_tex_coords.push_back( tex );
@@ -511,8 +511,8 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                    in.putback( c );
                    pp = calc_tex_coords(nodes[n2], center);
                }
-               xglTexCoord2f(pp.x(), pp.y());
-               xglVertex3dv(nodes[n2].get_n());
+               // xglTexCoord2f(pp.x(), pp.y());
+               // xglVertex3dv(nodes[n2].get_n());
                
                // read all subsequent numbers until next thing isn't a number
                while ( true ) {
@@ -534,7 +534,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                    // cout << "  triangle = " 
                    //      << n1 << "," << n2 << "," << n3 
                    //      << endl;
-                   xglNormal3dv(normals[n3]);
+                   // xglNormal3dv(normals[n3]);
                    if ( in.get( c ) && c == '/' ) {
                        in >> tex;
                        fan_tex_coords.push_back( tex );
@@ -544,14 +544,14 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                        in.putback( c );
                        pp = calc_tex_coords(nodes[n3], center);
                    }
-                   xglTexCoord2f(pp.x(), pp.y());
-                   xglVertex3dv(nodes[n3].get_n());
+                   // xglTexCoord2f(pp.x(), pp.y());
+                   // xglVertex3dv(nodes[n3].get_n());
 
                    fragment.add_face(n1, n2, n3);
                    n2 = n3;
                }
 
-               xglEnd();
+               // xglEnd();
 
                // build the ssg entity
                unsigned short *vindex = 
@@ -578,7 +578,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                // unoptimized face
 
                if ( !in_faces ) {
-                   xglBegin(GL_TRIANGLES);
+                   // xglBegin(GL_TRIANGLES);
                    // printf("xglBegin(triangles)\n");
                    in_faces = true;
                }
@@ -588,20 +588,20 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                fragment.add_face(n1, n2, n3);
 
                // xglNormal3d(normals[n1][0], normals[n1][1], normals[n1][2]);
-               xglNormal3dv(normals[n1]);
+               // xglNormal3dv(normals[n1]);
                pp = calc_tex_coords(nodes[n1], center);
-               xglTexCoord2f(pp.lon(), pp.lat());
-               xglVertex3dv(nodes[n1].get_n());
+               // xglTexCoord2f(pp.lon(), pp.lat());
+               // xglVertex3dv(nodes[n1].get_n());
 
-               xglNormal3dv(normals[n2]);
+               // xglNormal3dv(normals[n2]);
                pp = calc_tex_coords(nodes[n2], center);
-               xglTexCoord2f(pp.lon(), pp.lat());
-               xglVertex3dv(nodes[n2].get_n());
+               // xglTexCoord2f(pp.lon(), pp.lat());
+               // xglVertex3dv(nodes[n2].get_n());
                
-               xglNormal3dv(normals[n3]);
+               // xglNormal3dv(normals[n3]);
                pp = calc_tex_coords(nodes[n3], center);
-               xglTexCoord2f(pp.lon(), pp.lat());
-               xglVertex3dv(nodes[n3].get_n());
+               // xglTexCoord2f(pp.lon(), pp.lat());
+               // xglVertex3dv(nodes[n3].get_n());
                // printf("some normals, texcoords, and vertices (tris)\n");
            } else if ( token == "q" ) {
                // continue a triangle strip
@@ -646,11 +646,11 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                    }
                    // MAT3_SCALE_VEC(normal, approx_normal, scale);
                }
-               xglNormal3dv(normal);
+               // xglNormal3dv(normal);
 
                pp = calc_tex_coords(nodes[n1], center);
-               xglTexCoord2f(pp.lon(), pp.lat());
-               xglVertex3dv(nodes[n1].get_n());
+               // xglTexCoord2f(pp.lon(), pp.lat());
+               // xglVertex3dv(nodes[n1].get_n());
                // printf("a normal, texcoord, and vertex (4th)\n");
    
                odd = 1 - odd;
@@ -680,11 +680,11 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
                        }
                        // MAT3_SCALE_VEC(normal, approx_normal, scale);
                    }
-                   xglNormal3dv(normal);
+                   // xglNormal3dv(normal);
                
                    pp = calc_tex_coords(nodes[n2], center);
-                   xglTexCoord2f(pp.lon(), pp.lat());
-                   xglVertex3dv(nodes[n2].get_n());            
+                   // xglTexCoord2f(pp.lon(), pp.lat());
+                   // xglVertex3dv(nodes[n2].get_n());         
                    // printf("a normal, texcoord, and vertex (4th)\n");
 
                    odd = 1 -odd;
@@ -708,12 +708,12 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
 
     if ( in_fragment ) {
        // close out the previous structure and start the next
-       xglEnd();
-       xglEndList();
+       // xglEnd();
+       // xglEndList();
        // printf("xglEnd(); xglEndList();\n");
        
        // update fragment
-       fragment.display_list = display_list;
+       // fragment.display_list = display_list;
        
        // push this fragment onto the tile's object list
        t->fragment_list.push_back(fragment);
index 586df9062c4ac02df9dc28af02e8272b1544377e..d07ec5d466a49cfa3a7a40a8951c6ad50c389711 100644 (file)
 
 #include <Include/compiler.h>
 
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
+// #ifdef HAVE_WINDOWS_H
+// #  include <windows.h>
+// #endif
 
-#include <GL/glut.h>
+// #include <GL/glut.h>
 
 #include STL_STRING
 
@@ -51,7 +51,7 @@
 FG_USING_STD(string);
 
 
-// Load a .obj file and build the GL fragment list
+// Load a .obj file and build the fragment list
 ssgBranch *fgObjLoad(const string& path, FGTileEntry *tile);
 
 
index b4847b367ed349aabbb04e261a5ce3a9915f8891..5633e2f7b65f9da9cbd9e5fbce917f18b51ef8c3 100644 (file)
@@ -73,8 +73,8 @@ FGTileEntry::free_tile()
     // delete fragment list
     FG_LOG( FG_TERRAIN, FG_INFO,
            "  deleting " << fragment_list.size() << " fragments" );
-    for_each( begin(), end(),
-             mem_fun_ref( &fgFRAGMENT::deleteDisplayList ));
+    // for_each( begin(), end(),
+    //           mem_fun_ref( &fgFRAGMENT::deleteDisplayList ));
     fragment_list.erase( begin(), end() );
 
     // delete the ssg used structures
index 4a07fc7b1260fecbf22e4ec6640880506742f273..10e2867faf1a13455c85036e65c8445d33e82239 100644 (file)
@@ -845,6 +845,9 @@ void FGTileMgr::prep_ssg_nodes( void ) {
 
 // Render the local tiles
 void FGTileMgr::render( void ) {
+    FG_LOG( FG_TERRAIN, FG_ALERT,
+           "FGTileMgr::render() is depricated.  We shouldn't be here!" );
+
     FGInterface *f;
     FGTileCache *c;
     FGTileEntry *t;
@@ -901,7 +904,7 @@ void FGTileMgr::render( void ) {
                for ( ; current != last; ++current ) {
                    frag_ptr = &(*current);
                
-                   if ( frag_ptr->display_list >= 0 ) {
+                   if ( false /* frag_ptr->display_list >= 0 */ ) {
                        // Fine (fragment based) culling
                        frag_offset = frag_ptr->center - scenery.center;