From 4c8a7c3cefe3fff8a5ebb7e5f2da2f308d564433 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 20 Jun 2001 22:22:26 +0000 Subject: [PATCH] - fixed an initialization order bug that prevented reading correct ground elevation at start-up --- src/Scenery/tilemgr.cxx | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 9ecffda84..399336849 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -378,6 +378,30 @@ int FGTileMgr::update( double lon, double lat ) { delete dm; } + // cout << "current elevation (ssg) == " << scenery.cur_elev << endl; + + previous_bucket = current_bucket; + last_longitude = longitude; + last_latitude = latitude; + + // activate loader thread one out of every 5 frames + if ( counter_hack == 0 ) { + // Notify the tile loader that it can load another tile + // loader.update(); + + if ( !attach_queue.empty() ) { +#ifdef ENABLE_THREADS + FGTileEntry* e = attach_queue.pop(); +#else + FGTileEntry* e = attach_queue.front(); + attach_queue.pop(); +#endif + e->add_ssg_nodes( terrain, ground ); + // cout << "Adding ssg nodes for " + } + } + counter_hack = (counter_hack + 1) % 5; + if ( scenery.center == Point3D(0.0) ) { // initializing cout << "initializing scenery current elevation ... " << endl; @@ -414,30 +438,6 @@ int FGTileMgr::update( double lon, double lat ) { } } - // cout << "current elevation (ssg) == " << scenery.cur_elev << endl; - - previous_bucket = current_bucket; - last_longitude = longitude; - last_latitude = latitude; - - // activate loader thread one out of every 5 frames - counter_hack = (counter_hack + 1) % 5; - if ( !counter_hack ) { - // Notify the tile loader that it can load another tile - // loader.update(); - - if ( !attach_queue.empty() ) { -#ifdef ENABLE_THREADS - FGTileEntry* e = attach_queue.pop(); -#else - FGTileEntry* e = attach_queue.front(); - attach_queue.pop(); -#endif - e->add_ssg_nodes( terrain, ground ); - // cout << "Adding ssg nodes for " - } - } - return 1; } -- 2.39.5