]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/newcache.hxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Scenery / newcache.hxx
index 4eb92388e8c5afc99731a0885c3595b721969791..10686641afd400dd5fd5b801ee5f29e8e98b6048 100644 (file)
@@ -46,7 +46,6 @@
 #include <simgear/math/point3d.hxx>
 
 #include "tileentry.hxx"
-#include "FGTileLoader.hxx"
 
 SG_USING_STD(map);
 
@@ -69,11 +68,6 @@ class FGNewCache {
     // Free a tile cache entry
     void entry_free( long cache_index );
 
-    /**
-     * Queue tiles for loading.
-     */
-    FGTileLoader loader;
-
 public:
 
     // Constructor
@@ -88,8 +82,21 @@ public:
     // Check if the specified "bucket" exists in the cache
     bool exists( const SGBucket& b ) const;
 
+#if 0
     // Ensure at least one entry is free in the cache
-    void make_space();
+    bool make_space();
+#endif
+
+    // Return the index of the oldest tile in the cache, return -1 if
+    // nothing available to be removed.
+    long get_oldest_tile();
+
+    // Clear a cache entry, note that the cache only holds pointers
+    // and this does not free the object which is pointed to.
+    void clear_entry( long cache_entry );
+
+    // Clear all completely loaded tiles (ignores partially loaded tiles)
+    void clear_cache();
 
     // Fill in a tile cache entry with real data for the specified bucket 
     // void fill_in( const SGBucket& b );
@@ -98,6 +105,7 @@ public:
     inline FGTileEntry *get_tile( const long tile_index ) {
        tile_map_iterator it = tile_cache.find( tile_index );
        if ( it != tile_cache.end() ) {
+           it->second->set_timestamp(globals->get_sim_time_sec());
            return it->second;
        } else {
            return NULL;
@@ -127,8 +135,9 @@ public:
     /**
      * Create a new tile and enqueue it for loading.
      * @param b 
+     * @return success/failure
      */
-    void load_tile( const SGBucket& b );
+    bool insert_tile( FGTileEntry* e );
 };