- Change the global_tile_mgr to a globals->get_tile_mgr() which is
dynamically created at run time. - Further clean ups to the FGTileMgr class interface.
This commit is contained in:
parent
49d843e22e
commit
1feedec8d1
8 changed files with 71 additions and 104 deletions
|
@ -83,7 +83,7 @@ void reInit(puObject *cb)
|
||||||
|
|
||||||
fgReInitSubsystems();
|
fgReInitSubsystems();
|
||||||
|
|
||||||
global_tile_mgr.update( fgGetDouble("/environment/visibility-m") );
|
globals->get_tile_mgr()->update( fgGetDouble("/environment/visibility-m") );
|
||||||
|
|
||||||
cur_light_params.Update();
|
cur_light_params.Update();
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,7 @@ do_view_next( bool )
|
||||||
globals->get_current_view()->setHeadingOffset_deg(0.0);
|
globals->get_current_view()->setHeadingOffset_deg(0.0);
|
||||||
globals->get_viewmgr()->next_view();
|
globals->get_viewmgr()->next_view();
|
||||||
fix_hud_visibility();
|
fix_hud_visibility();
|
||||||
global_tile_mgr.refresh_view_timestamps();
|
globals->get_tile_mgr()->refresh_view_timestamps();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -246,7 +246,7 @@ do_view_prev( bool )
|
||||||
globals->get_current_view()->setHeadingOffset_deg(0.0);
|
globals->get_current_view()->setHeadingOffset_deg(0.0);
|
||||||
globals->get_viewmgr()->prev_view();
|
globals->get_viewmgr()->prev_view();
|
||||||
fix_hud_visibility();
|
fix_hud_visibility();
|
||||||
global_tile_mgr.refresh_view_timestamps();
|
globals->get_tile_mgr()->refresh_view_timestamps();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -258,7 +258,7 @@ do_view_cycle (const SGPropertyNode * arg)
|
||||||
globals->get_current_view()->setHeadingOffset_deg(0.0);
|
globals->get_current_view()->setHeadingOffset_deg(0.0);
|
||||||
globals->get_viewmgr()->next_view();
|
globals->get_viewmgr()->next_view();
|
||||||
fix_hud_visibility();
|
fix_hud_visibility();
|
||||||
global_tile_mgr.refresh_view_timestamps();
|
globals->get_tile_mgr()->refresh_view_timestamps();
|
||||||
// fgReshape(fgGetInt("/sim/startup/xsize"), fgGetInt("/sim/startup/ysize"));
|
// fgReshape(fgGetInt("/sim/startup/xsize"), fgGetInt("/sim/startup/ysize"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -288,10 +288,10 @@ do_tile_cache_reload (const SGPropertyNode * arg)
|
||||||
fgSetBool("/sim/freeze/master", true);
|
fgSetBool("/sim/freeze/master", true);
|
||||||
}
|
}
|
||||||
// BusyCursor(0);
|
// BusyCursor(0);
|
||||||
if ( global_tile_mgr.init() ) {
|
if ( globals->get_tile_mgr()->init() ) {
|
||||||
// Load the local scenery data
|
// Load the local scenery data
|
||||||
double visibility_meters = fgGetDouble("/environment/visibility-m");
|
double visibility_meters = fgGetDouble("/environment/visibility-m");
|
||||||
global_tile_mgr.update( visibility_meters );
|
globals->get_tile_mgr()->update( visibility_meters );
|
||||||
} else {
|
} else {
|
||||||
SG_LOG( SG_GENERAL, SG_ALERT,
|
SG_LOG( SG_GENERAL, SG_ALERT,
|
||||||
"Error in Tile Manager initialization!" );
|
"Error in Tile Manager initialization!" );
|
||||||
|
@ -607,7 +607,7 @@ do_presets_commit (const SGPropertyNode * arg)
|
||||||
// BusyCursor(0);
|
// BusyCursor(0);
|
||||||
fgReInitSubsystems();
|
fgReInitSubsystems();
|
||||||
|
|
||||||
global_tile_mgr.update( fgGetDouble("/environment/visibility-m") );
|
globals->get_tile_mgr()->update( fgGetDouble("/environment/visibility-m") );
|
||||||
|
|
||||||
if ( ! fgGetBool("/sim/presets/onground") ) {
|
if ( ! fgGetBool("/sim/presets/onground") ) {
|
||||||
fgSetBool( "/sim/freeze/master", true );
|
fgSetBool( "/sim/freeze/master", true );
|
||||||
|
|
|
@ -1264,11 +1264,11 @@ bool fgInitSubsystems() {
|
||||||
// Initialize the scenery management subsystem.
|
// Initialize the scenery management subsystem.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
if ( global_tile_mgr.init() ) {
|
if ( globals->get_tile_mgr()->init() ) {
|
||||||
// Load the local scenery data
|
// Load the local scenery data
|
||||||
double visibility_meters = fgGetDouble("/environment/visibility-m");
|
double visibility_meters = fgGetDouble("/environment/visibility-m");
|
||||||
|
|
||||||
global_tile_mgr.update( visibility_meters );
|
globals->get_tile_mgr()->update( visibility_meters );
|
||||||
} else {
|
} else {
|
||||||
SG_LOG( SG_GENERAL, SG_ALERT, "Error in Tile Manager initialization!" );
|
SG_LOG( SG_GENERAL, SG_ALERT, "Error in Tile Manager initialization!" );
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
@ -1276,7 +1276,8 @@ bool fgInitSubsystems() {
|
||||||
|
|
||||||
// cause refresh of viewer scenery timestamps every 15 seconds...
|
// cause refresh of viewer scenery timestamps every 15 seconds...
|
||||||
global_events.Register( "FGTileMgr::refresh_view_timestamps()",
|
global_events.Register( "FGTileMgr::refresh_view_timestamps()",
|
||||||
&global_tile_mgr, &FGTileMgr::refresh_view_timestamps,
|
globals->get_tile_mgr(),
|
||||||
|
&FGTileMgr::refresh_view_timestamps,
|
||||||
15000 );
|
15000 );
|
||||||
|
|
||||||
SG_LOG( SG_GENERAL, SG_DEBUG,
|
SG_LOG( SG_GENERAL, SG_DEBUG,
|
||||||
|
|
|
@ -47,30 +47,32 @@ typedef vector<string> string_list;
|
||||||
|
|
||||||
class SGEphemeris;
|
class SGEphemeris;
|
||||||
|
|
||||||
|
class SGCommandMgr;
|
||||||
class SGMagVar;
|
class SGMagVar;
|
||||||
|
class SGPropertyNode;
|
||||||
class SGRoute;
|
class SGRoute;
|
||||||
class SGTime;
|
class SGTime;
|
||||||
class SGPropertyNode;
|
|
||||||
class SGCommandMgr;
|
|
||||||
|
|
||||||
class FGSubsystemMgr;
|
class FGAIMgr;
|
||||||
class FGEnvironmentMgr;
|
|
||||||
class FGEnvironment;
|
|
||||||
class FGControls;
|
|
||||||
class FGSteam;
|
|
||||||
class FGSoundMgr;
|
|
||||||
class FGAutopilot;
|
|
||||||
class FGViewMgr;
|
|
||||||
class FGViewer;
|
|
||||||
class FGATCMgr;
|
class FGATCMgr;
|
||||||
class FGATCDisplay;
|
class FGATCDisplay;
|
||||||
class FGAIMgr;
|
|
||||||
class FGModelLoader;
|
|
||||||
class FGTextureLoader;
|
|
||||||
class FGAircraftModel;
|
class FGAircraftModel;
|
||||||
|
class FGAutopilot;
|
||||||
|
class FGControls;
|
||||||
|
class FGEnvironment;
|
||||||
|
class FGEnvironmentMgr;
|
||||||
|
class FGIO;
|
||||||
|
class FGModelLoader;
|
||||||
class FGModelMgr;
|
class FGModelMgr;
|
||||||
class FGScenery;
|
class FGScenery;
|
||||||
class FGIO;
|
class FGSoundMgr;
|
||||||
|
class FGSteam;
|
||||||
|
class FGSubsystemMgr;
|
||||||
|
class FGTextureLoader;
|
||||||
|
class FGTileMgr;
|
||||||
|
class FGViewMgr;
|
||||||
|
class FGViewer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bucket for subsystem pointers representing the sim's state.
|
* Bucket for subsystem pointers representing the sim's state.
|
||||||
|
@ -166,6 +168,9 @@ private:
|
||||||
// FlightGear scenery manager
|
// FlightGear scenery manager
|
||||||
FGScenery *scenery;
|
FGScenery *scenery;
|
||||||
|
|
||||||
|
// Tile manager
|
||||||
|
FGTileMgr *tile_mgr;
|
||||||
|
|
||||||
FGIO* io;
|
FGIO* io;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -290,6 +295,9 @@ public:
|
||||||
inline FGScenery * get_scenery () const { return scenery; }
|
inline FGScenery * get_scenery () const { return scenery; }
|
||||||
inline void set_scenery ( FGScenery *s ) { scenery = s; }
|
inline void set_scenery ( FGScenery *s ) { scenery = s; }
|
||||||
|
|
||||||
|
inline FGTileMgr * get_tile_mgr () const { return tile_mgr; }
|
||||||
|
inline void set_tile_mgr ( FGTileMgr *t ) { tile_mgr = t; }
|
||||||
|
|
||||||
FGIO* get_io() const { return io; }
|
FGIO* get_io() const { return io; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
#include <simgear/constants.h>
|
#include <simgear/constants.h>
|
||||||
#include <simgear/bucket/newbucket.hxx>
|
|
||||||
#include <simgear/math/point3d.hxx>
|
#include <simgear/math/point3d.hxx>
|
||||||
|
|
||||||
#include <plib/sg.h> // plib include
|
#include <plib/sg.h> // plib include
|
||||||
|
@ -112,10 +111,6 @@ public:
|
||||||
void set_cur_elev_m ( double elev ) { _cur_elev_m = elev; }
|
void set_cur_elev_m ( double elev ) { _cur_elev_m = elev; }
|
||||||
inline double get_cur_elev_m () { return _cur_elev_m; }
|
inline double get_cur_elev_m () { return _cur_elev_m; }
|
||||||
// Interface to current buckets for use with tilemgr...
|
// Interface to current buckets for use with tilemgr...
|
||||||
void set_current_bucket ( SGBucket current_bucket ) { _current_bucket = current_bucket; }
|
|
||||||
inline SGBucket get_current_bucket () { return _current_bucket; }
|
|
||||||
void set_previous_bucket ( SGBucket previous_bucket ) { _previous_bucket = previous_bucket; }
|
|
||||||
inline SGBucket get_previous_bucket () { return _previous_bucket; }
|
|
||||||
void set_tile_center ( Point3D tile_center ) { _tile_center = tile_center; }
|
void set_tile_center ( Point3D tile_center ) { _tile_center = tile_center; }
|
||||||
inline Point3D get_tile_center () { return _tile_center; }
|
inline Point3D get_tile_center () { return _tile_center; }
|
||||||
|
|
||||||
|
@ -149,10 +144,6 @@ private:
|
||||||
|
|
||||||
// elevation of ground under this location...
|
// elevation of ground under this location...
|
||||||
double _cur_elev_m;
|
double _cur_elev_m;
|
||||||
// current and previous scenery buckets to be saved for use in
|
|
||||||
// getting current elevation from tilemgr.
|
|
||||||
SGBucket _previous_bucket;
|
|
||||||
SGBucket _current_bucket;
|
|
||||||
Point3D _tile_center;
|
Point3D _tile_center;
|
||||||
|
|
||||||
// surface vector heading south
|
// surface vector heading south
|
||||||
|
|
|
@ -699,11 +699,6 @@ void fgRenderFrame() {
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// position tile nodes and update range selectors
|
|
||||||
|
|
||||||
// this is done in the main loop now...
|
|
||||||
// global_tile_mgr.prep_ssg_nodes(visibility_meters);
|
|
||||||
|
|
||||||
if ( fgGetBool("/sim/rendering/skyblend") ) {
|
if ( fgGetBool("/sim/rendering/skyblend") ) {
|
||||||
// draw the sky backdrop
|
// draw the sky backdrop
|
||||||
|
|
||||||
|
@ -1208,42 +1203,34 @@ static void fgMainLoop( void ) {
|
||||||
// ...only if location is different than the viewer (to avoid duplicating effort)
|
// ...only if location is different than the viewer (to avoid duplicating effort)
|
||||||
if( acmodel_location != current_view->getFGLocation() ) {
|
if( acmodel_location != current_view->getFGLocation() ) {
|
||||||
if( acmodel_location != 0 ) {
|
if( acmodel_location != 0 ) {
|
||||||
global_tile_mgr.prep_ssg_nodes( acmodel_location, visibility_meters );
|
globals->get_tile_mgr()->prep_ssg_nodes( acmodel_location,
|
||||||
global_tile_mgr.update( acmodel_location, visibility_meters,
|
visibility_meters );
|
||||||
acmodel_location->get_absolute_view_pos(),
|
globals->get_tile_mgr()->
|
||||||
acmodel_location->get_current_bucket(),
|
update( acmodel_location, visibility_meters,
|
||||||
acmodel_location->get_previous_bucket(),
|
acmodel_location->get_absolute_view_pos() );
|
||||||
globals->get_scenery()->get_center()
|
|
||||||
);
|
|
||||||
// save results of update in FGLocation for fdm...
|
// save results of update in FGLocation for fdm...
|
||||||
if ( globals->get_scenery()->get_cur_elev() > -9990 ) {
|
if ( globals->get_scenery()->get_cur_elev() > -9990 ) {
|
||||||
acmodel_location->set_cur_elev_m( globals->get_scenery()->get_cur_elev() );
|
acmodel_location->
|
||||||
|
set_cur_elev_m( globals->get_scenery()->get_cur_elev() );
|
||||||
}
|
}
|
||||||
acmodel_location->set_current_bucket( global_tile_mgr.get_current_bucket() );
|
acmodel_location->
|
||||||
acmodel_location->set_previous_bucket( global_tile_mgr.get_previous_bucket() );
|
set_tile_center( globals->get_scenery()->get_next_center() );
|
||||||
acmodel_location->set_tile_center( globals->get_scenery()->get_next_center() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global_tile_mgr.prep_ssg_nodes( current_view->getFGLocation(),
|
globals->get_tile_mgr()->prep_ssg_nodes( current_view->getFGLocation(),
|
||||||
visibility_meters );
|
visibility_meters );
|
||||||
// update tile manager for view...
|
// update tile manager for view...
|
||||||
// IMPORTANT!!! the tilemgr update for view location _must_ be done last
|
// IMPORTANT!!! the tilemgr update for view location _must_ be done last
|
||||||
// after the FDM's until all of Flight Gear code references the viewer's location
|
// after the FDM's until all of Flight Gear code references the viewer's location
|
||||||
// for elevation instead of the "scenery's" current elevation.
|
// for elevation instead of the "scenery's" current elevation.
|
||||||
FGLocation *view_location = globals->get_current_view()->getFGLocation();
|
FGLocation *view_location = globals->get_current_view()->getFGLocation();
|
||||||
global_tile_mgr.update( view_location, visibility_meters,
|
globals->get_tile_mgr()->update( view_location, visibility_meters,
|
||||||
current_view->get_absolute_view_pos(),
|
current_view->get_absolute_view_pos() );
|
||||||
current_view->getFGLocation()->get_current_bucket(),
|
|
||||||
current_view->getFGLocation()->get_previous_bucket(),
|
|
||||||
globals->get_scenery()->get_center()
|
|
||||||
);
|
|
||||||
// save results of update in FGLocation for fdm...
|
// save results of update in FGLocation for fdm...
|
||||||
if ( globals->get_scenery()->get_cur_elev() > -9990 ) {
|
if ( globals->get_scenery()->get_cur_elev() > -9990 ) {
|
||||||
current_view->getFGLocation()->set_cur_elev_m( globals->get_scenery()->get_cur_elev() );
|
current_view->getFGLocation()->set_cur_elev_m( globals->get_scenery()->get_cur_elev() );
|
||||||
}
|
}
|
||||||
current_view->getFGLocation()->set_current_bucket( global_tile_mgr.get_current_bucket() );
|
|
||||||
current_view->getFGLocation()->set_previous_bucket( global_tile_mgr.get_previous_bucket() );
|
|
||||||
current_view->getFGLocation()->set_tile_center( globals->get_scenery()->get_next_center() );
|
current_view->getFGLocation()->set_tile_center( globals->get_scenery()->get_next_center() );
|
||||||
|
|
||||||
// If fdm location is same as viewer's then we didn't do the update for fdm location
|
// If fdm location is same as viewer's then we didn't do the update for fdm location
|
||||||
|
@ -1253,8 +1240,6 @@ static void fgMainLoop( void ) {
|
||||||
if ( globals->get_scenery()->get_cur_elev() > -9990 ) {
|
if ( globals->get_scenery()->get_cur_elev() > -9990 ) {
|
||||||
acmodel_location->set_cur_elev_m( globals->get_scenery()->get_cur_elev() );
|
acmodel_location->set_cur_elev_m( globals->get_scenery()->get_cur_elev() );
|
||||||
}
|
}
|
||||||
acmodel_location->set_current_bucket( global_tile_mgr.get_current_bucket() );
|
|
||||||
acmodel_location->set_previous_bucket( global_tile_mgr.get_previous_bucket() );
|
|
||||||
acmodel_location->set_tile_center( globals->get_scenery()->get_next_center() );
|
acmodel_location->set_tile_center( globals->get_scenery()->get_next_center() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1640,6 +1625,9 @@ static bool fgMainInit( int argc, char **argv ) {
|
||||||
globals->get_scenery()->init();
|
globals->get_scenery()->init();
|
||||||
globals->get_scenery()->bind();
|
globals->get_scenery()->bind();
|
||||||
|
|
||||||
|
// Initialize the global tile manager
|
||||||
|
globals->set_tile_mgr( new FGTileMgr );
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Initialize the property-based built-in commands
|
// Initialize the property-based built-in commands
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -53,10 +53,6 @@
|
||||||
|
|
||||||
#define TEST_LAST_HIT_CACHE
|
#define TEST_LAST_HIT_CACHE
|
||||||
|
|
||||||
// the tile manager
|
|
||||||
FGTileMgr global_tile_mgr;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_THREADS
|
#ifdef ENABLE_THREADS
|
||||||
SGLockedQueue<FGTileEntry *> FGTileMgr::attach_queue;
|
SGLockedQueue<FGTileEntry *> FGTileMgr::attach_queue;
|
||||||
SGLockedQueue<FGDeferredModel *> FGTileMgr::model_queue;
|
SGLockedQueue<FGDeferredModel *> FGTileMgr::model_queue;
|
||||||
|
@ -364,30 +360,30 @@ int FGTileMgr::update( double visibility_meters )
|
||||||
sgdVec3 abs_pos_vector;
|
sgdVec3 abs_pos_vector;
|
||||||
sgdCopyVec3( abs_pos_vector,
|
sgdCopyVec3( abs_pos_vector,
|
||||||
globals->get_current_view()->get_absolute_view_pos() );
|
globals->get_current_view()->get_absolute_view_pos() );
|
||||||
return update( location, visibility_meters, abs_pos_vector,
|
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,
|
int FGTileMgr::update( FGLocation *location, double visibility_meters,
|
||||||
sgdVec3 abs_pos_vector, SGBucket p_current,
|
sgdVec3 abs_pos_vector )
|
||||||
SGBucket p_previous, Point3D center )
|
|
||||||
{
|
{
|
||||||
// SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update() for "
|
|
||||||
// << lon << " " << lat );
|
|
||||||
|
|
||||||
longitude = location->getLongitude_deg();
|
longitude = location->getLongitude_deg();
|
||||||
latitude = location->getLatitude_deg();
|
latitude = location->getLatitude_deg();
|
||||||
current_bucket = p_current;
|
// SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update() for "
|
||||||
previous_bucket = p_previous;
|
// << longitude << " " << latatitude );
|
||||||
|
|
||||||
// SG_LOG( SG_TERRAIN, SG_DEBUG, "lon "<< lonlat[LON] <<
|
current_bucket.set_bucket( longitude, latitude );
|
||||||
// " lat " << lonlat[LAT] );
|
// SG_LOG( SG_TERRAIN, SG_DEBUG, "Updating tile list for "
|
||||||
|
// << current_bucket );
|
||||||
|
|
||||||
// SG_LOG( SG_TERRAIN, SG_DEBUG, "Updating Tile list for " << current_bucket );
|
// set global scenery center from current tile center
|
||||||
|
current_tile = tile_cache.get_tile( current_bucket );
|
||||||
setCurrentTile( longitude, latitude);
|
if ( current_tile != NULL ) {
|
||||||
|
globals->get_scenery()->set_next_center( current_tile->center );
|
||||||
|
} else {
|
||||||
|
SG_LOG( SG_TERRAIN, SG_WARN, "Tile not found (Ok if initializing)" );
|
||||||
|
globals->get_scenery()->set_next_center( Point3D(0.0) );
|
||||||
|
}
|
||||||
|
|
||||||
// do tile load scheduling.
|
// do tile load scheduling.
|
||||||
// Note that we need keep track of both viewer buckets and fdm buckets.
|
// Note that we need keep track of both viewer buckets and fdm buckets.
|
||||||
|
@ -416,7 +412,9 @@ int FGTileMgr::update( FGLocation *location, double visibility_meters,
|
||||||
// no reason to update this if we haven't moved...
|
// no reason to update this if we haven't moved...
|
||||||
if ( longitude != last_longitude || latitude != last_latitude ) {
|
if ( longitude != last_longitude || latitude != last_latitude ) {
|
||||||
// update current elevation...
|
// update current elevation...
|
||||||
if ( updateCurrentElevAtPos( abs_pos_vector, center ) ) {
|
if ( updateCurrentElevAtPos( abs_pos_vector,
|
||||||
|
globals->get_scenery()->get_center() ) )
|
||||||
|
{
|
||||||
last_longitude = longitude;
|
last_longitude = longitude;
|
||||||
last_latitude = latitude;
|
last_latitude = latitude;
|
||||||
}
|
}
|
||||||
|
@ -425,6 +423,7 @@ int FGTileMgr::update( FGLocation *location, double visibility_meters,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// timer event driven call to scheduler for the purpose of refreshing the tile timestamps
|
// timer event driven call to scheduler for the purpose of refreshing the tile timestamps
|
||||||
void FGTileMgr::refresh_view_timestamps() {
|
void FGTileMgr::refresh_view_timestamps() {
|
||||||
SG_LOG( SG_TERRAIN, SG_INFO,
|
SG_LOG( SG_TERRAIN, SG_INFO,
|
||||||
|
@ -434,21 +433,6 @@ void FGTileMgr::refresh_view_timestamps() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// check and set current tile and scenery center...
|
|
||||||
void FGTileMgr::setCurrentTile(double longitude, double latitude) {
|
|
||||||
|
|
||||||
// check tile cache entry...
|
|
||||||
current_bucket.set_bucket( longitude, latitude );
|
|
||||||
if ( tile_cache.exists( current_bucket ) ) {
|
|
||||||
current_tile = tile_cache.get_tile( current_bucket );
|
|
||||||
globals->get_scenery()->set_next_center( current_tile->center );
|
|
||||||
} else {
|
|
||||||
SG_LOG( SG_TERRAIN, SG_WARN, "Tile not found (Ok if initializing)" );
|
|
||||||
globals->get_scenery()->set_next_center( Point3D(0.0) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int FGTileMgr::updateCurrentElevAtPos(sgdVec3 abs_pos_vector, Point3D center) {
|
int FGTileMgr::updateCurrentElevAtPos(sgdVec3 abs_pos_vector, Point3D center) {
|
||||||
|
|
||||||
sgdVec3 sc;
|
sgdVec3 sc;
|
||||||
|
|
|
@ -165,9 +165,8 @@ public:
|
||||||
// read it from disk.
|
// read it from disk.
|
||||||
int update( double visibility_meters );
|
int update( double visibility_meters );
|
||||||
int update( FGLocation *location, double visibility_meters,
|
int update( FGLocation *location, double visibility_meters,
|
||||||
sgdVec3 abs_pos_vector, SGBucket p_current,
|
sgdVec3 abs_pos_vector );
|
||||||
SGBucket p_previous, Point3D center );
|
|
||||||
void setCurrentTile( double longitude, double latitude );
|
|
||||||
int updateCurrentElevAtPos(sgdVec3 abs_pos_vector, Point3D center );
|
int updateCurrentElevAtPos(sgdVec3 abs_pos_vector, Point3D center );
|
||||||
|
|
||||||
// Determine scenery altitude. Normally this just happens when we
|
// Determine scenery altitude. Normally this just happens when we
|
||||||
|
@ -196,8 +195,4 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// the tile manager
|
|
||||||
extern FGTileMgr global_tile_mgr;
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _TILEMGR_HXX
|
#endif // _TILEMGR_HXX
|
||||||
|
|
Loading…
Add table
Reference in a new issue