From 95d6d93bed500dd2548dd1ee75d5693ee46accde Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 13 Dec 2000 20:36:04 +0000 Subject: [PATCH] Renamed FGBucket -> SGBucket. --- src/Main/keyboard.cxx | 2 +- src/Objects/obj.cxx | 2 +- src/Scenery/newcache.cxx | 19 ++++++++++--------- src/Scenery/newcache.hxx | 6 +++--- src/Scenery/tileentry.hxx | 2 +- src/Scenery/tilemgr.cxx | 10 +++++----- src/Scenery/tilemgr.hxx | 12 ++++++------ src/Time/moonpos.cxx | 6 +++--- src/Time/sunpos.cxx | 3 ++- 9 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/Main/keyboard.cxx b/src/Main/keyboard.cxx index 7ebc023a1..f983144ea 100644 --- a/src/Main/keyboard.cxx +++ b/src/Main/keyboard.cxx @@ -345,7 +345,7 @@ void GLUTkey(unsigned char k, int x, int y) { globals->set_freeze( ! globals->get_freeze() ); { - FGBucket p( f->get_Longitude() * RAD_TO_DEG, + SGBucket p( f->get_Longitude() * RAD_TO_DEG, f->get_Latitude() * RAD_TO_DEG ); FGPath tile_path( globals->get_options()->get_fg_root() ); tile_path.append( "Scenery" ); diff --git a/src/Objects/obj.cxx b/src/Objects/obj.cxx index 0cb64fe8a..7eca9a6bf 100644 --- a/src/Objects/obj.cxx +++ b/src/Objects/obj.cxx @@ -159,7 +159,7 @@ ssgBranch *fgGenTile( const string& path, FGTileEntry *t) { } // Calculate center point - FGBucket b = t->tile_bucket; + SGBucket b = t->tile_bucket; double clon = b.get_center_lon(); double clat = b.get_center_lat(); double height = b.get_height(); diff --git a/src/Scenery/newcache.cxx b/src/Scenery/newcache.cxx index daa67c82a..53e0af00e 100644 --- a/src/Scenery/newcache.cxx +++ b/src/Scenery/newcache.cxx @@ -100,7 +100,7 @@ void FGNewCache::init( void ) { for ( ; current != end; ++current ) { long index = current->first; - cout << "clearing " << index << endl; + FG_LOG( FG_TERRAIN, FG_DEBUG, "clearing " << index ); FGTileEntry *e = current->second; e->tile_bucket.make_bad(); entry_free(index); @@ -114,7 +114,7 @@ void FGNewCache::init( void ) { // Search for the specified "bucket" in the cache -bool FGNewCache::exists( const FGBucket& b ) { +bool FGNewCache::exists( const SGBucket& b ) { long tile_index = b.gen_index(); tile_map_iterator it = tile_cache.find( tile_index ); @@ -191,7 +191,7 @@ static ssgLeaf *gen_lights( ssgVertexArray *lights, int inc, float bright ) { // Fill in a tile cache entry with real data for the specified bucket -void FGNewCache::fill_in( const FGBucket& b ) { +void FGNewCache::fill_in( const SGBucket& b ) { FG_LOG( FG_TERRAIN, FG_INFO, "FILL IN CACHE ENTRY = " << b.gen_index() ); // clear out a distant entry in the cache if needed. @@ -239,13 +239,13 @@ void FGNewCache::fill_in( const FGBucket& b ) { } // load custom objects - cout << "CUSTOM OBJECTS" << endl; + FG_LOG( FG_TERRAIN, FG_DEBUG, "CUSTOM OBJECTS" ); FGPath index_path = tile_path; index_path.append( b.gen_index_str() ); index_path.concat( ".ind" ); - cout << "Looking in " << index_path.str() << endl; + FG_LOG( FG_TERRAIN, FG_DEBUG, "Looking in " << index_path.str() ); fg_gzifstream in( index_path.str() ); @@ -260,7 +260,8 @@ void FGNewCache::fill_in( const FGBucket& b ) { #else in >> skipws; #endif - cout << "token = " << token << " name = " << name << endl; + FG_LOG( FG_TERRAIN, FG_DEBUG, "token = " << token + << " name = " << name ); FGPath custom_path = tile_path; custom_path.append( name ); @@ -287,7 +288,7 @@ void FGNewCache::fill_in( const FGBucket& b ) { e->lights_range = NULL; /* uncomment this section for testing ground lights */ if ( light_pts->getNum() ) { - cout << "generating lights" << endl; + FG_LOG( FG_TERRAIN, FG_DEBUG, "generating lights" ); e->lights_transform = new ssgTransform; e->lights_range = new ssgRangeSelector; e->lights_brightness = new ssgSelector; @@ -316,8 +317,8 @@ void FGNewCache::make_space() { FG_LOG( FG_TERRAIN, FG_INFO, "Make space in cache" ); - cout << "cache size = " << tile_cache.size() << endl; - cout << "max size = " << max_cache_size << endl; + FG_LOG( FG_TERRAIN, FG_DEBUG, "cache entries = " << tile_cache.size() ); + FG_LOG( FG_TERRAIN, FG_INFO, "max size = " << max_cache_size ); if ( (int)tile_cache.size() < max_cache_size ) { // space in the cache, return diff --git a/src/Scenery/newcache.hxx b/src/Scenery/newcache.hxx index 7d3c7b3b1..20272b983 100644 --- a/src/Scenery/newcache.hxx +++ b/src/Scenery/newcache.hxx @@ -82,13 +82,13 @@ public: void init( void ); // Check if the specified "bucket" exists in the cache - bool exists( const FGBucket& b ); + bool exists( const SGBucket& b ); // Ensure at least one entry is free in the cache void FGNewCache::make_space(); // Fill in a tile cache entry with real data for the specified bucket - void fill_in( const FGBucket& b ); + void fill_in( const SGBucket& b ); // Return a pointer to the specified tile cache entry inline FGTileEntry *get_tile( const long tile_index ) { @@ -101,7 +101,7 @@ public: } // Return a pointer to the specified tile cache entry - inline FGTileEntry *get_tile( const FGBucket& b ) { + inline FGTileEntry *get_tile( const SGBucket& b ) { return get_tile( b.gen_index() ); } diff --git a/src/Scenery/tileentry.hxx b/src/Scenery/tileentry.hxx index 5bf057daa..dbbf8a42e 100644 --- a/src/Scenery/tileentry.hxx +++ b/src/Scenery/tileentry.hxx @@ -82,7 +82,7 @@ public: Point3D offset; // this tile's official location in the world - FGBucket tile_bucket; + SGBucket tile_bucket; // list of pointers to memory chunks that need to be freed when // tile entry goes away diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 9697a5d1d..5bc82ddbc 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -111,7 +111,7 @@ int FGTileMgr::init() { // schedule a tile for loading -void FGTileMgr::sched_tile( const FGBucket& b ) { +void FGTileMgr::sched_tile( const SGBucket& b ) { // see if tile already exists in the cache FGTileEntry *t = global_tile_cache.get_tile( b ); @@ -123,7 +123,7 @@ void FGTileMgr::sched_tile( const FGBucket& b ) { // load a tile -void FGTileMgr::load_tile( const FGBucket& b ) { +void FGTileMgr::load_tile( const SGBucket& b ) { // see if tile already exists in the cache FGTileEntry *t = global_tile_cache.get_tile( b ); @@ -230,7 +230,7 @@ void FGTileMgr::schedule_needed() { for ( int x = -xrange; x <= xrange; ++x ) { for ( int y = -yrange; y <= yrange; ++y ) { - FGBucket b = fgBucketOffset( longitude, latitude, x, y ); + SGBucket b = sgBucketOffset( longitude, latitude, x, y ); if ( ! global_tile_cache.exists( b ) ) { sched_tile( b ); } @@ -269,7 +269,7 @@ void FGTileMgr::initialize_queue() FG_LOG( FG_TERRAIN, FG_DEBUG, "Load queue not empty, loading a tile" ); - FGBucket pending = load_queue.front(); + SGBucket pending = load_queue.front(); load_queue.pop_front(); load_tile( pending ); } @@ -327,7 +327,7 @@ int FGTileMgr::update( double lon, double lat ) { FG_LOG( FG_TERRAIN, FG_INFO, "Load queue size = " << load_queue.size() << " loading a tile" ); - FGBucket pending = load_queue.front(); + SGBucket pending = load_queue.front(); load_queue.pop_front(); load_tile( pending ); } diff --git a/src/Scenery/tilemgr.hxx b/src/Scenery/tilemgr.hxx index 7be5fe52c..97b4bf3fc 100644 --- a/src/Scenery/tilemgr.hxx +++ b/src/Scenery/tilemgr.hxx @@ -67,7 +67,7 @@ private: load_state state; // pending tile load queue - list < FGBucket > load_queue; + list < SGBucket > load_queue; // initialize the cache void initialize_queue(); @@ -78,10 +78,10 @@ private: void destroy_queue(); // schedule a tile for loading - void sched_tile( const FGBucket& b ); + void sched_tile( const SGBucket& b ); // load a tile - void load_tile( const FGBucket& b ); + void load_tile( const SGBucket& b ); // schedule a needed buckets for loading void FGTileMgr::schedule_needed(); @@ -95,9 +95,9 @@ private: // ssgEntity *last_hit; FGHitList hit_list; - FGBucket previous_bucket; - FGBucket current_bucket; - FGBucket pending; + SGBucket previous_bucket; + SGBucket current_bucket; + SGBucket pending; FGTileEntry *current_tile; diff --git a/src/Time/moonpos.cxx b/src/Time/moonpos.cxx index 0fb907236..e1aebcf41 100644 --- a/src/Time/moonpos.cxx +++ b/src/Time/moonpos.cxx @@ -391,8 +391,8 @@ void fgUpdateMoonPos( void ) { // << nmoon[2] << endl; l->moon_angle = acos( sgScalarProductVec3( nup, nmoon ) ); - cout << "moon angle relative to current location = " - << l->moon_angle << endl; + FG_LOG( FG_EVENT, FG_INFO, "moon angle relative to current location = " + << l->moon_angle ); // calculate vector to moon's position on the earth's surface Point3D vp( v->get_view_pos()[0], @@ -421,7 +421,7 @@ void fgUpdateMoonPos( void ) { // v->surface_east. We do this so we can sort out the acos() // ambiguity. I wish I could think of a more efficient way ... :-( east_dot = sgScalarProductVec3( surface_to_moon, v->get_surface_east() ); - // cout << " East dot product = " << east_dot << endl; + // cout << " East dot product = " << east_dot << endl; // calculate the angle between v->surface_to_moon and // v->surface_south. this is how much we have to rotate the sky diff --git a/src/Time/sunpos.cxx b/src/Time/sunpos.cxx index 1c31b2982..896b0c531 100644 --- a/src/Time/sunpos.cxx +++ b/src/Time/sunpos.cxx @@ -298,7 +298,8 @@ void fgUpdateSunPos( void ) { // << nsun[2] << endl; l->sun_angle = acos( sgScalarProductVec3 ( nup, nsun ) ); - cout << "sun angle relative to current location = " << l->sun_angle << endl; + FG_LOG( FG_EVENT, FG_INFO, "sun angle relative to current location = " + << l->sun_angle ); // calculate vector to sun's position on the earth's surface Point3D vp( v->get_view_pos()[0], -- 2.39.5