1
0
Fork 0

tilemanager: initialize member variables

Also drop some obsolete members.
This commit is contained in:
ThorstenB 2012-03-25 13:43:28 +02:00
parent 4bde2451b0
commit f14ca9c611
2 changed files with 10 additions and 11 deletions

View file

@ -54,7 +54,9 @@ using flightgear::SceneryPager;
FGTileMgr::FGTileMgr():
state( Start ),
last_state( Running ),
vis( 16000 ),
longitude(-1000.0),
latitude(-1000.0),
scheduled_visibility(100.0),
_terra_sync(NULL),
_visibilityMeters(fgGetNode("/environment/visibility-m", true)),
_maxTileRangeM(fgGetNode("/sim/rendering/static-lod/bare", true)),
@ -115,6 +117,7 @@ void FGTileMgr::reinit()
previous_bucket.make_bad();
current_bucket.make_bad();
longitude = latitude = -1000.0;
scheduled_visibility = 100.0;
_terra_sync = (simgear::SGTerraSync*) globals->get_subsystem("terrasync");
if (_terra_sync)
@ -180,8 +183,8 @@ void FGTileMgr::schedule_needed(const SGBucket& curr_bucket, double vis)
// << tile_height << endl;
double tileRangeM = std::min(vis,_maxTileRangeM->getDoubleValue());
xrange = (int)(tileRangeM / tile_width) + 1;
yrange = (int)(tileRangeM / tile_height) + 1;
int xrange = (int)(tileRangeM / tile_width) + 1;
int yrange = (int)(tileRangeM / tile_height) + 1;
if ( xrange < 1 ) { xrange = 1; }
if ( yrange < 1 ) { yrange = 1; }
@ -319,7 +322,7 @@ int FGTileMgr::schedule_tiles_at(const SGGeod& location, double range_m)
// schedule more tiles when visibility increased considerably
// TODO Calculate tile size - instead of using fixed value (5000m)
if (range_m-scheduled_visibility > 5000.0)
if (range_m - scheduled_visibility > 5000.0)
previous_bucket.make_bad();
// SG_LOG( SG_TERRAIN, SG_DEBUG, "Updating tile list for "

View file

@ -48,9 +48,9 @@ private:
// Tile loading state
enum load_state {
Start = 0,
Inited = 1,
Running = 2
Start = 0,
Inited = 1,
Running = 2
};
load_state state, last_state;
@ -66,10 +66,6 @@ private:
SGBucket pending;
osg::ref_ptr<simgear::SGReaderWriterOptions> _options;
// x and y distance of tiles to load/draw
float vis;
int xrange, yrange;
// current longitude latitude
double longitude;
double latitude;