]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tilemgr.cxx
Modified Files:
[flightgear.git] / src / Scenery / tilemgr.cxx
index debc796fe9625e22343b975c5ef97c0f416a902a..16104e612f2051abb6ccc91e4ee2e250d5628b1e 100644 (file)
@@ -25,8 +25,6 @@
 #  include <config.h>
 #endif
 
-#include <plib/ssg.h>
-
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/point3d.hxx>
@@ -35,7 +33,6 @@
 #include <simgear/math/vector.hxx>
 #include <simgear/structure/exception.hxx>
 #include <simgear/scene/model/modellib.hxx>
-#include <simgear/scene/model/shadowvolume.hxx>
 
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
@@ -57,10 +54,6 @@ queue<FGDeferredModel *> FGTileMgr::model_queue;
 #endif // ENABLE_THREADS
 queue<FGTileEntry *> FGTileMgr::delete_queue;
 
-bool FGTileMgr::tile_filter = true;
-
-extern SGShadowVolume *shadows;
-
 // Constructor
 FGTileMgr::FGTileMgr():
     state( Start ),
@@ -126,7 +119,8 @@ void FGTileMgr::sched_tile( const SGBucket& b, const bool is_inner_ring ) {
             long index = tile_cache.get_oldest_tile();
             if ( index >= 0 ) {
                 FGTileEntry *old = tile_cache.get_tile( index );
-                shadows->deleteOccluderFromTile( (ssgBranch *) old->get_terra_transform() );
+                // OSGFIXME
+//                 shadows->deleteOccluderFromTile( (ssgBranch *) old->get_terra_transform() );
                 old->disconnect_ssg_nodes();
                 delete_queue.push( old );
                 tile_cache.clear_entry( index );
@@ -310,9 +304,10 @@ void FGTileMgr::update_queues()
             // tile cache
             FGTileEntry *t = tile_cache.get_tile( dm->get_bucket() );
             if ( t != NULL ) {
-                ssgTexturePath( (char *)(dm->get_texture_path().c_str()) );
+              //OSGFIXME
+//                 ssgTexturePath( (char *)(dm->get_texture_path().c_str()) );
                 try {
-                    ssgEntity *obj_model =
+                    osg::Node *obj_model =
                         globals->get_model_lib()->load_model( ".",
                                                   dm->get_model_path(),
                                                   globals->get_props(),
@@ -320,10 +315,11 @@ void FGTileMgr::update_queues()
                                                   dm->get_cache_state(),
                                                   new FGNasalModelData );
                     if ( obj_model != NULL ) {
-                        dm->get_obj_trans()->addKid( obj_model );
-                        shadows->addOccluder( (ssgBranch *) obj_model->getParent(0),
-                            SGShadowVolume::occluderTypeTileObject,
-                            (ssgBranch *) dm->get_tile()->get_terra_transform());
+                        dm->get_obj_trans()->addChild( obj_model );
+              //OSGFIXME
+//                         shadows->addOccluder( (ssgBranch *) obj_model->getParent(0),
+//                             SGShadowVolume::occluderTypeTileObject,
+//                             (ssgBranch *) dm->get_tile()->get_terra_transform());
                     }
                 } catch (const sg_io_exception& exc) {
                                        string m(exc.getMessage());
@@ -350,11 +346,7 @@ void FGTileMgr::update_queues()
         FGTileEntry* e = attach_queue.front();
         attach_queue.pop();
 #endif
-        e->add_ssg_nodes( globals->get_scenery()->get_terrain_branch(),
-                          globals->get_scenery()->get_gnd_lights_root(),
-                          globals->get_scenery()->get_vasi_lights_root(),
-                          globals->get_scenery()->get_rwy_lights_root(),
-                          globals->get_scenery()->get_taxi_lights_root() );
+        e->add_ssg_nodes( globals->get_scenery()->get_terrain_branch() );
         // cout << "Adding ssg nodes for "
     }
 
@@ -371,7 +363,7 @@ void FGTileMgr::update_queues()
                 // get real serious and agressively free up some tiles so
                 // we don't explode our memory usage.
 
-                SG_LOG( SG_TERRAIN, SG_ALERT,
+                SG_LOG( SG_TERRAIN, SG_WARN,
                         "Warning: catching up on tile delete queue" );
             }
 
@@ -459,22 +451,18 @@ void FGTileMgr::refresh_view_timestamps() {
     }
 }
 
-void FGTileMgr::prep_ssg_nodes( SGLocation *location, float vis ) {
+void FGTileMgr::prep_ssg_nodes(float vis) {
 
     // traverse the potentially viewable tile list and update range
     // selector and transform
 
-    float *up = location->get_world_up();
-
     FGTileEntry *e;
     tile_cache.reset_traversal();
 
-    const double *vp = location->get_absolute_view_pos();
-    Point3D viewpos(vp[0], vp[1], vp[2]);
     while ( ! tile_cache.at_end() ) {
         // cout << "processing a tile" << endl;
         if ( (e = tile_cache.get_current()) ) {
-            e->prep_ssg_node( viewpos, up, vis);
+            e->prep_ssg_node(vis);
         } else {
             SG_LOG(SG_INPUT, SG_ALERT, "warning ... empty tile in cache");
         }
@@ -482,17 +470,6 @@ void FGTileMgr::prep_ssg_nodes( SGLocation *location, float vis ) {
     }
 }
 
-bool FGTileMgr::set_tile_filter( bool f ) {
-    bool old = tile_filter;
-    tile_filter = f;
-    return old;
-}
-
-int FGTileMgr::tile_filter_cb( ssgEntity *, int )
-{
-  return tile_filter ? 1 : 0;
-}
-
 bool FGTileMgr::scenery_available(double lat, double lon, double range_m)
 {
   // sanity check (unfortunately needed!)