#include <Math/vector.hxx>
#include <Objects/materialmgr.hxx>
#include <Objects/obj.hxx>
-#include <Weather/weather.hxx>
+
+#ifdef FG_NEW_WEATHER
+# include <WeatherCM/FGLocalWeatherDatabase.h>
+#else
+# include <Weather/weather.hxx>
+#endif
#include "scenery.hxx"
#include "tilecache.hxx"
material_mgr.load_lib();
}
+ global_tile_cache.init();
+
state = Inited;
return 1;
// schedule a tile for loading
static void disable_tile( int cache_index ) {
// see if tile already exists in the cache
- cout << "DISABLING CACHE ENTRY = " << cache_index << endl;
+ // cout << "DISABLING CACHE ENTRY = " << cache_index << endl;
FGTileEntry *t = global_tile_cache.get_tile( cache_index );
t->ssg_disable();
}
if ( cache_index >= 0 ) {
// tile exists in cache, reenable it.
- cout << "REENABLING DISABLED TILE" << endl;
+ // cout << "REENABLING DISABLED TILE" << endl;
FGTileEntry *t = global_tile_cache.get_tile( cache_index );
t->select_ptr->select( 1 );
t->mark_loaded();
for ( int i = 0 ; i < num_hits ; i++ ) {
ssgHit *h = &(results [ i ]) ;
- cout << "got a hit!" << endl;
+ // cout << "got a hit!" << endl;
/* Do something with 'h' */
}
// have something to see in our first frame.
for ( i = 0; i < 9; ++i ) {
if ( load_queue.size() ) {
- FG_LOG( FG_TERRAIN, FG_INFO,
+ FG_LOG( FG_TERRAIN, FG_DEBUG,
"Load queue not empty, loading a tile" );
FGLoadRec pending = load_queue.front();
#if 0
// make sure load queue is flushed before doing shift
while ( load_queue.size() ) {
- FG_LOG( FG_TERRAIN, FG_INFO,
+ FG_LOG( FG_TERRAIN, FG_DEBUG,
"Load queue not empty, flushing queue before tile shift." );
FGLoadRec pending = load_queue.front();
}
if ( load_queue.size() ) {
- FG_LOG( FG_TERRAIN, FG_INFO, "Load queue not empty, loading a tile" );
+ FG_LOG( FG_TERRAIN, FG_DEBUG, "Load queue not empty, loading a tile" );
FGLoadRec pending = load_queue.front();
load_queue.pop_front();
if ( t->is_loaded() ) {
// set range selector (LOD trick) to be distance to center
// of tile + bounding radius
- ranges[1] = current_weather.get_visibility() + t->bounding_radius;
+#ifdef FG_NEW_WEATHER
+ ranges[1] = WeatherDatabase->getWeatherVisibility()
+ + t->bounding_radius;
+#else
+ ranges[1] = current_weather.get_visibility()+t->bounding_radius;
+#endif
t->range_ptr->setRanges( ranges, 2 );
// calculate tile offset