]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/newcache.hxx
Currently, when the sim pauses, all IO is also halted. To me it generally
[flightgear.git] / src / Scenery / newcache.hxx
index 91b43c6baa0d47e185c035b227ab56f7df196362..eaf2c154151b42711d76f55eaa821cd894894fe6 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#include <GL/glut.h>
-
 #include <map>
 
 #include <simgear/bucket/newbucket.hxx>
@@ -82,8 +76,18 @@ 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();
@@ -95,6 +99,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;
@@ -124,8 +129,9 @@ public:
     /**
      * Create a new tile and enqueue it for loading.
      * @param b 
+     * @return success/failure
      */
-    void insert_tile( FGTileEntry* e );
+    bool insert_tile( FGTileEntry* e );
 };