]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
set /sim/fg-current to current working directory; getcwd() is defined in
[flightgear.git] / src / Main / main.cxx
index b47080c304b00b9193f37ee0f48c12ade6d2563f..ffb8d499bfb9a631e06135eb01c0b861b58d2635 100644 (file)
@@ -66,8 +66,6 @@
 #include <Sound/beacon.hxx>
 #include <Sound/morse.hxx>
 #include <FDM/flight.hxx>
-// #include <FDM/ADA.hxx>
-#include <ATC/ATCdisplay.hxx>
 #include <ATC/ATCmgr.hxx>
 #include <ATC/AIMgr.hxx>
 #include <Time/tmp.hxx>
@@ -513,29 +511,8 @@ static void fgMainLoop( void ) {
     //
     double visibility_meters = fgGetDouble("/environment/visibility-m");
     FGViewer *current_view = globals->get_current_view();
-    // Let the scenery center follow the current view position with
-    // 30m increments.
-    //
-    // Having the scenery center near the view position will eliminate
-    // jitter of objects which are placed very near the view position
-    // and haveing it's center near that view position.
-    // So the 3d insruments of the aircraft will not jitter with this.
-    // 
-    // Following the view position exactly would introduce jitter of
-    // the scenery tiles (they would be from their center up to 10000m
-    // to the view and this will introduce roundoff too). By stepping
-    // at 30m incements the roundoff error of the scenery tiles is
-    // still present, but we will make exactly the same roundoff error
-    // at each frame until the center is switched to a new
-    // position. This roundoff is still visible but you will most
-    // propably not notice.
-    double *vp = globals->get_current_view()->get_absolute_view_pos();
-    SGVec3d cntr(vp);
-    if (30.0*30.0 < distSqr(cntr, globals->get_scenery()->get_center()))
-      globals->get_scenery()->set_center( cntr );
-
-    globals->get_tile_mgr()->prep_ssg_nodes( current_view->getSGLocation(),
-                                             visibility_meters );
+
+    globals->get_tile_mgr()->prep_ssg_nodes( visibility_meters );
     // update tile manager for view...
     SGLocation *view_location = globals->get_current_view()->getSGLocation();
     globals->get_tile_mgr()->update( view_location, visibility_meters );
@@ -548,8 +525,7 @@ static void fgMainLoop( void ) {
         double ref_time, r;
         SGVec3d pt;
         bool valid = cur_fdm_state->is_valid_m(&ref_time, pt.sg(), &r);
-        double *vp = globals->get_current_view()->get_absolute_view_pos();
-        SGVec3d viewpos(vp);
+        SGVec3d viewpos(globals->get_current_view()->get_view_pos());
         if (valid && distSqr(viewpos, pt) < r*r) {
             // Reuse the cache ...
             double lev
@@ -627,13 +603,12 @@ static void fgMainLoop( void ) {
 // then on.
 
 static void fgIdleFunction ( void ) {
+    // Some intialization requires a valid graphics context, in
+    // particular that of plib. Boo, hiss!
+    fgMakeCurrent();
     if ( idle_state == 0 ) {
         idle_state++;
 
-#ifdef GL_EXT_texture_lod_bias
-        // negative values sharpen, positive values blur mipmapped textures
-        glTexEnvf( GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, -0.5 ) ;
-#endif
         // This seems to be the absolute earliest in the init sequence
         // that these calls will return valid info.  Too bad it's after
         // we've already created and sized our window. :-(
@@ -960,7 +935,7 @@ bool fgMainInit( int argc, char **argv ) {
     fgInitFGRoot(argc, argv);
 
     // Check for the correct base package version
-    static char required_version[] = "0.9.10";
+    static char required_version[] = "0.9.11";
     string base_version = fgBasePackageVersion();
     if ( !(base_version == required_version) ) {
         // tell the operator how to use this application
@@ -977,9 +952,6 @@ bool fgMainInit( int argc, char **argv ) {
         exit(-1);
     }
 
-    //OSGFIXME
-//     sgUseDisplayList = fgGetBool( "/sim/rendering/use-display-list", true );
-
     // Load the configuration parameters.  (Command line options
     // override config file options.  Config file options override
     // defaults.)
@@ -1021,7 +993,7 @@ bool fgMainInit( int argc, char **argv ) {
 
     // Initialize the splash screen right away
     fntInit();
-    fgSplashInit(fgGetString("/sim/startup/splash-texture"));
+    fgSplashInit();
 
     // pass control off to the master event handler
     fgOSMainLoop();