]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tileentry.cxx
Check for the plib version when using display lists, just to be sure.
[flightgear.git] / src / Scenery / tileentry.cxx
index 6b132e7ee62e2e1a69c43d41f6aea98724354d19..108e6d0c831835dd0d15d0d7fc2d0997db2a08bc 100644 (file)
@@ -818,6 +818,7 @@ FGTileEntry::load( const string_list &path_list, bool is_base )
                     FGDeferredModel *dm
                         = new FGDeferredModel( custom_path.str(),
                                                tile_path.str(),
+                                               tile_bucket,
                                                this, obj_trans );
                     FGTileMgr::model_ready( dm );
 
@@ -981,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,
@@ -991,6 +1005,10 @@ 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.
+#if PLIB_VERSION > 183
+    makeDList( terra_transform );
+#endif
+
     terra_transform->ref();
     terrain_branch->addKid( terra_transform );