]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tilemgr.cxx
Modified Files:
[flightgear.git] / src / Scenery / tilemgr.cxx
index 198ad436e81392c24a15c9264c5d4a24408dce16..baf830659a4649eba6f422f7b86016632933fb06 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>
@@ -59,8 +56,6 @@ queue<FGTileEntry *> FGTileMgr::delete_queue;
 
 bool FGTileMgr::tile_filter = true;
 
-extern SGShadowVolume *shadows;
-
 // Constructor
 FGTileMgr::FGTileMgr():
     state( Start ),
@@ -126,7 +121,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 );
@@ -163,9 +159,10 @@ void FGTileMgr::schedule_needed( double vis, const SGBucket& curr_bucket) {
         SG_LOG( SG_TERRAIN, SG_ALERT,
                 "Attempting to schedule tiles for bogus lon and lat  = ("
                 << longitude << "," << latitude << ")" );
+        return;                // FIXME
         SG_LOG( SG_TERRAIN, SG_ALERT,
                 "This is a FATAL error.  Exiting!" );
-        exit(-1);        
+        exit(-1);
     }
 
     SG_LOG( SG_TERRAIN, SG_INFO,
@@ -309,9 +306,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(),
@@ -319,10 +317,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());
@@ -495,7 +494,7 @@ int FGTileMgr::tile_filter_cb( ssgEntity *, int )
 bool FGTileMgr::scenery_available(double lat, double lon, double range_m)
 {
   // sanity check (unfortunately needed!)
-  if ( lon < -180.0 || lon > 180.0 || lat < -90.0 || lat > 90.0 )
+  if ( lon <= -180.0 || lon >= 180.0 || lat <= -90.0 || lat >= 90.0 )
     return false;
   
   SGBucket bucket(lon, lat);