]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/gui_local.cxx
Patch from Jim Wilson:
[flightgear.git] / src / GUI / gui_local.cxx
index 1506577c54abaacce5b3b85934e75f1d23b6a00a..df6ac67e1272c653af7eb4c735dca0400a491ec5 100644 (file)
@@ -51,12 +51,16 @@ void initMouseQuat(void) {
 
 void reInit(puObject *cb)
 {
-    BusyCursor(0);
+    // BusyCursor(0);
     Quat0();
 
-    int freeze = globals->get_freeze();
-    if(!freeze)
-        globals->set_freeze( true );
+    static const SGPropertyNode *master_freeze
+       = fgGetNode("/sim/freeze/master");
+
+    bool freeze = master_freeze->getBoolValue();
+    if ( !freeze ) {
+        fgSetBool("/sim/freeze/master", true);
+    }
 
     cur_fdm_state->unbind();
 
@@ -69,27 +73,33 @@ void reInit(puObject *cb)
 
     globals->restoreInitialState();
 
-       // Unsuccessful KLUDGE to fix the 'every other time'
-       // problem when doing a 'reset' after a 'goto airport'
+    // Unsuccessful KLUDGE to fix the 'every other time'
+    // problem when doing a 'reset' after a 'goto airport'
        
-       // string AptId( fgGetString("/sim/startup/airport-id") );
-       // if( AptId.c_str() != "\0" )
-       //      fgSetPosFromAirportID( AptId );
+    // string AptId( fgGetString("/sim/startup/airport-id") );
+    // if( AptId.c_str() != "\0" )
+    //      fgSetPosFromAirportID( AptId );
        
+    SGTime *t = globals->get_time_params();
+    delete t;
+    t = fgInitTime();
+    globals->set_time_params( t );
+
     fgReInitSubsystems();
 
     // reduntant(fgReInitSubsystems) ?
+    double visibility_meters = fgGetDouble("/environment/visibility-m");
     global_tile_mgr.update( fgGetDouble("/position/longitude-deg"),
-                            fgGetDouble("/position/latitude-deg") );
+                            fgGetDouble("/position/latitude-deg"),visibility_meters );
     
     cur_light_params.Update();
 
     fgReshape( xsize, ysize );
 
-    BusyCursor(1);
+    // BusyCursor(1);
     
     if ( !freeze ) {
-        globals->set_freeze( false );
+        fgSetBool("/sim/freeze/master", false);
     }
 }