X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FScenery%2FFGTileLoader.hxx;h=74d237f34e8ce321916a5198faf9bb749b3bbab6;hb=048da049f87fe3f543795f3b1b511d774caa2787;hp=912475abe44bcdf004c5438c3516507fae3ac1c1;hpb=a29cb28e9386a7fcfcbcbde47d6d5553476d58d9;p=flightgear.git diff --git a/src/Scenery/FGTileLoader.hxx b/src/Scenery/FGTileLoader.hxx index 912475abe..74d237f34 100644 --- a/src/Scenery/FGTileLoader.hxx +++ b/src/Scenery/FGTileLoader.hxx @@ -24,16 +24,18 @@ #ifndef FG_TILE_LOADER_HXX #define FG_TILE_LOADER_HXX -#include -#include - #include #include #ifdef ENABLE_THREADS # include +# include +#else +# include + SG_USING_STD( queue ); #endif + // Forward reference. class FGTileEntry; @@ -54,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 @@ -73,16 +91,22 @@ 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: +#ifdef ENABLE_THREADS /** * FIFO queue of tiles to load from data files. */ - std::queue< 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. @@ -131,7 +155,6 @@ private: * Lock and synchronize access to tile queue. */ SGMutex mutex; - SGCondition queue_cond; SGCondition frame_cond; /**