X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FScenery%2FFGTileLoader.cxx;h=3bbe26521f994e9a27932f5885287540ff890c84;hb=56592f3869c41e4f189e9ab44abb1a0898c90f4b;hp=a27d79dd769781a496b52115bb77c0e882eee7f4;hpb=29d540901cd4212c24dc77811925d9eec36cdb9f;p=flightgear.git diff --git a/src/Scenery/FGTileLoader.cxx b/src/Scenery/FGTileLoader.cxx index a27d79dd7..3bbe26521 100644 --- a/src/Scenery/FGTileLoader.cxx +++ b/src/Scenery/FGTileLoader.cxx @@ -24,6 +24,8 @@ # include #endif +#include + #include
#include "FGTileLoader.hxx" #include "tileentry.hxx" @@ -65,6 +67,7 @@ FGTileLoader::~FGTileLoader() } +#if 0 // we don't ever want to do this I don't think /** * */ @@ -73,6 +76,7 @@ void FGTileLoader::reinit() { tile_load_queue.pop(); } } +#endif /** @@ -88,7 +92,7 @@ FGTileLoader::add( FGTileEntry* tile ) static bool beenhere = false; if (!beenhere) { - if ( globals->get_fg_scenery() != (string)"" ) { + if ( !globals->get_fg_scenery().empty() ) { tile_path.set( globals->get_fg_scenery() ); } else { tile_path.set( globals->get_fg_root() ); @@ -117,6 +121,7 @@ FGTileLoader::remove( FGTileEntry* tile ) void FGTileLoader::update() { + #ifdef ENABLE_THREADS // send a signal to the pager thread that it is allowed to load // another tile @@ -125,17 +130,19 @@ FGTileLoader::update() mutex.unlock(); #else if ( !tile_load_queue.empty() ) { - cout << "loading next tile ..." << endl; + // cout << "loading next tile ..." << endl; // load the next tile in the queue FGTileEntry* tile = tile_load_queue.front(); tile_load_queue.pop(); + tile->load( tile_path, true ); + FGTileMgr::ready_to_attach( tile ); } #ifdef WISH_PLIB_WAS_THREADED // but it isn't if ( !tile_free_queue.empty() ) { - cout << "freeing next tile ..." << endl; + // cout << "freeing next tile ..." << endl; // free the next tile in the queue FGTileEntry* tile = tile_free_queue.front(); tile_free_queue.pop(); @@ -145,6 +152,7 @@ FGTileLoader::update() #endif #endif // ENABLE_THREADS + } @@ -174,7 +182,7 @@ FGTileLoader::LoaderThread::run() #ifdef WISH_PLIB_WAS_THREADED // but it isn't // Handle and pending removals while ( !loader->tile_free_queue.empty() ) { - cout << "freeing next tile ..." << endl; + // cout << "freeing next tile ..." << endl; // free the next tile in the queue FGTileEntry* tile = loader->tile_free_queue.pop(); tile->free_tile();