]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_init.cxx
Merge branch 'curt/make' into next
[flightgear.git] / src / Main / fg_init.cxx
index ded6765fcb1d0a5bddae82b918c26fb67949b955..bddcc69f1d00c2c3f8410336a057d577a1a9e5f2 100644 (file)
 #if defined( unix ) || defined( __CYGWIN__ )
 #  include <unistd.h>           // for gethostname()
 #endif
-#if defined( _MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
 #  include <direct.h>           // for getcwd()
 #  define getcwd _getcwd
 #  include <io.h>               // isatty()
 #  define isatty _isatty
-#  include "Winsock2.h"                // for gethostname()
+#  include "winsock2.h"                // for gethostname()
 #endif
 
 // work around a stdc++ lib bug in some versions of linux, but doesn't
@@ -78,6 +78,8 @@
 #   include <ATCDCL/ATCmgr.hxx>
 #   include <ATCDCL/AIMgr.hxx>
 #   include "ATCDCL/commlist.hxx"
+#else
+#   include "ATC/atcutils.hxx"
 #endif
 
 #include <Autopilot/route_mgr.hxx>
@@ -275,9 +277,9 @@ bool fgInitFGRoot ( int argc, char **argv ) {
     // find fg-root any other way.
     if ( root.empty() ) {
 #if defined( __CYGWIN__ )
-        root = "/FlightGear";
-#elif defined( WIN32 )
-        root = "\\FlightGear";
+        root = "../data";
+#elif defined( _WIN32 )
+        root = "..\\data";
 #elif defined(__APPLE__) 
         /*
         The following code looks for the base package inside the application 
@@ -591,7 +593,7 @@ bool fgInitConfig ( int argc, char **argv ) {
     }
 
     SGPropertyNode autosave;
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
+#ifdef _WIN32
     char *envp = ::getenv( "APPDATA" );
     if (envp != NULL ) {
         SGPath config( envp );
@@ -808,6 +810,7 @@ static bool fgSetPosFromAirportIDandParkpos( const string& id, const string& par
         return false;
     }
     FGParking* parking = dcs->getParking(park_index);
+    parking->setAvailable(false);
     fgApplyStartOffset(
       SGGeod::fromDeg(parking->getLongitude(), parking->getLatitude()),
       parking->getHeading());
@@ -982,13 +985,9 @@ fgInitNav ()
 
 
 
-#if ENABLE_ATCDCL
     current_commlist = new FGCommList;
     current_commlist->init( globals->get_fg_root() );
     fgAirportDBLoad( aptdb.str(), current_commlist, p_metar.str() );
-#else
-    fgAirportDBLoad( aptdb.str(), p_metar.str() );
-#endif
 
     FGNavList *navlist = new FGNavList;
     FGNavList *loclist = new FGNavList;
@@ -1468,21 +1467,6 @@ bool fgInitSubsystems() {
     globals->get_event_mgr()->init();
     globals->get_event_mgr()->setRealtimeProperty(fgGetNode("/sim/time/delta-realtime-sec", true));
 
-    ////////////////////////////////////////////////////////////////////
-    // Initialize the sound manager subsystem.
-    ////////////////////////////////////////////////////////////////////
-
-    globals->get_soundmgr()->bind();
-    globals->get_soundmgr()->init(fgGetString("/sim/sound/device-name", NULL));
-
-    vector <const char*>devices =
-                        globals->get_soundmgr()->get_available_devices();
-    for (unsigned int i=0; i<devices.size(); i++) {
-        SGPropertyNode *p = fgGetNode("/sim/sound/devices/device", i, true);
-        p->setStringValue(devices[i]);
-    }
-    devices.clear();
-
     ////////////////////////////////////////////////////////////////////
     // Initialize the property interpolator subsystem. Put into the INIT
     // group because the "nasal" subsystem may need it at GENERAL take-down.
@@ -1563,7 +1547,7 @@ bool fgInitSubsystems() {
     // Initialize the XML Autopilot subsystem.
     ////////////////////////////////////////////////////////////////////
 
-    globals->add_subsystem( "xml-autopilot", new FGXMLAutopilot );
+    globals->add_subsystem( "xml-autopilot", new FGXMLAutopilotGroup );
     globals->add_subsystem( "route-manager", new FGRouteMgr );
     globals->add_subsystem( "autobrake", new FGAutoBrake );
     
@@ -1623,10 +1607,11 @@ bool fgInitSubsystems() {
     // Initialise the ATC Manager 
     ////////////////////////////////////////////////////////////////////
 
+#if ENABLE_ATCDCL
     SG_LOG(SG_GENERAL, SG_INFO, "  ATC Manager");
     globals->set_ATC_mgr(new FGATCMgr);
     globals->get_ATC_mgr()->init(); 
-    
+
     ////////////////////////////////////////////////////////////////////
     // Initialise the AI Manager 
     ////////////////////////////////////////////////////////////////////
@@ -1634,7 +1619,7 @@ bool fgInitSubsystems() {
     SG_LOG(SG_GENERAL, SG_INFO, "  AI Manager");
     globals->set_AI_mgr(new FGAIMgr);
     globals->get_AI_mgr()->init();
-
+#endif
     ////////////////////////////////////////////////////////////////////
     // Initialise the AI Model Manager
     ////////////////////////////////////////////////////////////////////