]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/FGTileLoader.hxx
Check for the plib version when using display lists, just to be sure.
[flightgear.git] / src / Scenery / FGTileLoader.hxx
index b5fb759c7474655836bc85b7e958e586507f5b38..3d912fa753ce73715a4bafd50534c3dba442371c 100644 (file)
 #include <simgear/bucket/newbucket.hxx>
 #include <simgear/misc/sg_path.hxx>
 
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
 #  include <simgear/threads/SGThread.hxx>
 #  include <simgear/threads/SGQueue.hxx>
+#else
+#  include <queue>
+   SG_USING_STD( queue );
 #endif
 
+
 // Forward reference.
 class FGTileEntry;
 
@@ -52,13 +56,29 @@ public:
      */
     ~FGTileLoader();
 
+#if 0 // we don't ever want to do this I don't think
+    /**
+     * Flush anything in pending load queue without doing the work
+     * Leave the free queue intact since that's are only record of
+     * things we need to remove.
+     */
+    void reinit();
+#endif
+    
     /**
      * Add a tile to the end of the load queue.
      * @param tile The tile to be loaded from disk.
-     * @param vis Current visibilty (in feet?) (see FGTileMgr::vis).
      */
     void add( FGTileEntry* tile );
 
+#ifdef WISH_PLIB_WAS_THREADED // but it isn't
+    /**
+     * Remove a tile from memory.
+     * @param tile The tile to be removed from memory.
+     */
+    void remove( FGTileEntry* tile );
+#endif
+
     /**
      * The tile loader thread will only load one tile per call to the
      * update() method.  This is a way to spread out the work of the
@@ -71,23 +91,29 @@ public:
      * Returns whether the load queue is empty (contains no elements).
      * @return true if load queue is empty otherwise returns false.
      */
-    // bool empty() const { return tile_queue.empty(); }
+    // bool empty() const { return tile_load_queue.empty(); }
 
 private:
 
 private:
 
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
     /**
      * FIFO queue of tiles to load from data files.
      */
-    SGBlockingQueue< FGTileEntry* > tile_queue;
-    
+    SGBlockingQueue< FGTileEntry * > tile_load_queue;
+    // SGBlockingQueue< FGTileEntry * > tile_free_queue;
+#else
+    queue< FGTileEntry * > tile_load_queue;
+    // queue< FGTileEntry * > tile_free_queue;
+#endif
+
     /**
-     * Base name of directory containing tile data file.
+     * Base names of directories containing tile data files.
      */
-    SGPath tile_path;
+    string_list tile_path;
 
-#ifdef ENABLE_THREADS
+#if defined(ENABLE_THREADS) && ENABLE_THREADS
     /**
      * Maximum number of threads to create for loading tiles.
      */
@@ -129,7 +155,7 @@ private:
      * Lock and synchronize access to tile queue.
      */
     SGMutex mutex;
-    SGCondition frame_cond;
+    SGPthreadCond frame_cond;
 
     /**
      * Thread cleanup handler.