]> git.mxchange.org Git - flightgear.git/commitdiff
Frederic: Add display list support without changing plib.
authorehofman <ehofman>
Sun, 10 Oct 2004 17:41:11 +0000 (17:41 +0000)
committerehofman <ehofman>
Sun, 10 Oct 2004 17:41:11 +0000 (17:41 +0000)
src/Scenery/tileentry.cxx
src/Scenery/tileentry.hxx

index 153d49183ceaa1e8e10472607d295244941419b8..8b987b0ad5a5253f38fc14f0c851d2d510799340 100644 (file)
@@ -982,6 +982,19 @@ FGTileEntry::load( const string_list &path_list, bool is_base )
     }
 }
 
+void
+FGTileEntry::makeDList( ssgBranch *b )
+{
+    int nb = b->getNumKids();
+    for (int i = 0; i<nb; i++) {
+        ssgEntity *e = b->getKid(i);
+        if (e->isAKindOf(ssgTypeLeaf())) {
+            ((ssgLeaf*)e)->makeDList();
+        } else if (e->isAKindOf(ssgTypeBranch())) {
+            makeDList( (ssgBranch*)e );
+        }
+    }
+}
 
 void
 FGTileEntry::add_ssg_nodes( ssgBranch *terrain_branch,
@@ -992,6 +1005,8 @@ FGTileEntry::add_ssg_nodes( ssgBranch *terrain_branch,
 {
     // bump up the ref count so we can remove this later without
     // having ssg try to free the memory.
+    makeDList( terra_transform );
+
     terra_transform->ref();
     terrain_branch->addKid( terra_transform );
 
index a442f7604c6b0d9aada635faca00db5d46029118..de188cd90ee51bdfa3170423658c0995c938d996 100644 (file)
@@ -259,6 +259,11 @@ public:
      */
     inline SGBucket get_tile_bucket() const { return tile_bucket; }
 
+    /**
+     * Apply ssgLeaf::makeDList to all leaf of a branch
+     */
+    void makeDList( ssgBranch *b );
+
     /**
      * Add terrain mesh and ground lighting to scene graph.
      */