]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tilemgr.hxx
NavDisplay: fix update lag when switching range or centre.
[flightgear.git] / src / Scenery / tilemgr.hxx
index 048fe7692320b3a462eb86f7d8beaa9508659233..848225b61ff753436d973f48d676a291ca52154f 100644 (file)
 #include <simgear/scene/tgdb/TileEntry.hxx>
 #include <simgear/scene/tgdb/TileCache.hxx>
 
-class SGReaderWriterBTGOptions;
-
 namespace osg
 {
 class Node;
 }
 
+namespace simgear
+{
+class SGTerraSync;
+class SGReaderWriterOptions;
+}
+
 class FGTileMgr : public SGSubsystem, public simgear::ModelLoadHelper {
 
 private:
@@ -49,8 +53,8 @@ private:
        Running = 2
     };
 
-    load_state state;
-    
+    load_state state, last_state;
+
     // schedule a tile for loading, returns true when tile is already loaded
     bool sched_tile( const SGBucket& b, double priority,bool current_view, double request_time);
 
@@ -60,7 +64,7 @@ private:
     SGBucket previous_bucket;
     SGBucket current_bucket;
     SGBucket pending;
-    osg::ref_ptr<SGReaderWriterBTGOptions> _options;
+    osg::ref_ptr<simgear::SGReaderWriterOptions> _options;
 
     // x and y distance of tiles to load/draw
     float vis;
@@ -75,12 +79,16 @@ private:
      * tile cache
      */
     simgear::TileCache tile_cache;
+    simgear::SGTerraSync* _terra_sync;
 
     // Update the various queues maintained by the tilemagr (private
     // internal function, do not call directly.)
     void update_queues();
-    
+
+    static void refresh_tile(void* tileMgr, long tileIndex);
+
     SGPropertyNode* _visibilityMeters;
+    SGPropertyNode_ptr _maxTileRangeM;
     
 public:
     FGTileMgr();
@@ -104,7 +112,7 @@ public:
     bool schedule_scenery(const SGGeod& position, double range_m, double duration=0.0);
 
     // Load a model for a tile
-    osg::Node* loadTileModel(const string& modelPath, bool cacheModel);
+    osg::Node* loadTileModel(const std::string& modelPath, bool cacheModel);
 
     // Returns true if tiles around current view position have been loaded
     bool isSceneryLoaded();