From a6ce9a5b2af4324b17060047165ec3edc376600b Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 30 Nov 2002 14:22:00 +0000 Subject: [PATCH] A small amount of additional massaging of tile manager update() interface. --- src/Main/main.cxx | 4 ++-- src/Scenery/tilemgr.cxx | 39 ++++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 478baf576..5a68ab140 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1213,7 +1213,7 @@ static void fgMainLoop( void ) { acmodel_location->get_absolute_view_pos(), acmodel_location->get_current_bucket(), acmodel_location->get_previous_bucket(), - acmodel_location->get_tile_center() + globals->get_scenery()->get_center() ); // save results of update in FGLocation for fdm... if ( globals->get_scenery()->get_cur_elev() > -9990 ) { @@ -1236,7 +1236,7 @@ static void fgMainLoop( void ) { current_view->get_absolute_view_pos(), current_view->getFGLocation()->get_current_bucket(), current_view->getFGLocation()->get_previous_bucket(), - current_view->getFGLocation()->get_tile_center() + globals->get_scenery()->get_center() ); // save results of update in FGLocation for fdm... if ( globals->get_scenery()->get_cur_elev() > -9990 ) { diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 1babc5174..c1e760609 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -267,20 +267,6 @@ void FGTileMgr::initialize_queue() } -// given the current lon/lat (in degrees), fill in the array of local -// chunks. If the chunk isn't already in the cache, then read it from -// disk. -int FGTileMgr::update( double visibility_meters ) { - FGLocation *location = globals->get_current_view()->getFGLocation(); - sgdVec3 abs_pos_vector; - sgdCopyVec3( abs_pos_vector, - globals->get_current_view()->get_absolute_view_pos() ); - return update( location, visibility_meters, abs_pos_vector, - current_bucket, previous_bucket, - globals->get_scenery()->get_center() ); -} - - /** * Update the various queues maintained by the tilemagr (private * internal function, do not call directly.) @@ -369,9 +355,25 @@ void FGTileMgr::update_queues() } +// given the current lon/lat (in degrees), fill in the array of local +// chunks. If the chunk isn't already in the cache, then read it from +// disk. +int FGTileMgr::update( double visibility_meters ) +{ + FGLocation *location = globals->get_current_view()->getFGLocation(); + sgdVec3 abs_pos_vector; + sgdCopyVec3( abs_pos_vector, + globals->get_current_view()->get_absolute_view_pos() ); + return update( location, visibility_meters, abs_pos_vector, + current_bucket, previous_bucket, + globals->get_scenery()->get_center() ); +} + + int FGTileMgr::update( FGLocation *location, double visibility_meters, sgdVec3 abs_pos_vector, SGBucket p_current, - SGBucket p_previous, Point3D center ) { + SGBucket p_previous, Point3D center ) +{ // SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update() for " // << lon << " " << lat ); @@ -414,12 +416,7 @@ int FGTileMgr::update( FGLocation *location, double visibility_meters, // no reason to update this if we haven't moved... if ( longitude != last_longitude || latitude != last_latitude ) { // update current elevation... - if ( updateCurrentElevAtPos( abs_pos_vector, center ) - ) - /*if ( updateCurrentElevAtPos( abs_pos_vector, - globals->get_scenery()->get_next_center() ) - )*/ - { + if ( updateCurrentElevAtPos( abs_pos_vector, center ) ) { last_longitude = longitude; last_latitude = latitude; } -- 2.39.5