]> 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 08d45373042c4c19ba1bdf2ca27b180f2665e4d9..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
@@ -60,6 +60,7 @@
 #include <simgear/misc/interpolator.hxx>
 #include <simgear/scene/material/matlib.hxx>
 #include <simgear/scene/model/particles.hxx>
+#include <simgear/sound/soundmgr_openal.hxx>
 #include <simgear/timing/sg_time.hxx>
 #include <simgear/timing/lowleveltime.h>
 
 #include <Airports/dynamics.hxx>
 
 #include <AIModel/AIManager.hxx>
-#include <ATCDCL/ATCmgr.hxx>
-#include <ATCDCL/AIMgr.hxx>
+
+#if ENABLE_ATCDCL
+#   include <ATCDCL/ATCmgr.hxx>
+#   include <ATCDCL/AIMgr.hxx>
+#   include "ATCDCL/commlist.hxx"
+#else
+#   include "ATC/atcutils.hxx"
+#endif
+
 #include <Autopilot/route_mgr.hxx>
 #include <Autopilot/xmlauto.hxx>
 #include <Autopilot/autobrake.hxx>
@@ -81,7 +89,8 @@
 #include <Cockpit/cockpit.hxx>
 #include <Cockpit/panel.hxx>
 #include <Cockpit/panel_io.hxx>
-#ifdef ENABLE_SP_FDM
+
+#if ENABLE_SP_FDM
 #include <FDM/SP/ADA.hxx>
 #include <FDM/SP/ACMS.hxx>
 #include <FDM/SP/MagicCarpet.hxx>
 #include <Scenery/scenery.hxx>
 #include <Scenery/tilemgr.hxx>
 #include <Scripting/NasalSys.hxx>
-#include <Sound/fg_fx.hxx>
-#include <Sound/beacon.hxx>
-#include <Sound/morse.hxx>
 #include <Sound/voice.hxx>
 #include <Systems/system_mgr.hxx>
 #include <Time/light.hxx>
 #include "renderer.hxx"
 #include "viewmgr.hxx"
 #include "main.hxx"
-#include "ATCDCL/commlist.hxx"
+
 
 #ifdef __APPLE__
 #  include <CoreFoundation/CoreFoundation.h>
 using std::string;
 using namespace boost::algorithm;
 
-class Sound;
 extern const char *default_root;
-float init_volume;
 
 
 // Scan the command line options for the specified option and return
@@ -273,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 
@@ -589,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 );
@@ -806,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());
@@ -977,6 +982,9 @@ fgInitNav ()
 
 // Initialise the frequency search map BEFORE reading
 // the airport database:
+
+
+
     current_commlist = new FGCommList;
     current_commlist->init( globals->get_fg_root() );
     fgAirportDBLoad( aptdb.str(), current_commlist, p_metar.str() );
@@ -1527,7 +1535,6 @@ bool fgInitSubsystems() {
     // Initialize the ridgelift subsystem
     globals->add_subsystem("ridgelift", new FGRidgeLift);
 
-
     ////////////////////////////////////////////////////////////////////
     // Initialize the aircraft systems and instrumentation (before the
     // autopilot.)
@@ -1540,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 );
     
@@ -1590,22 +1597,9 @@ bool fgInitSubsystems() {
     fgGetBool("/sim/rendering/bump-mapping", false);
 
 #ifdef ENABLE_AUDIO_SUPPORT
-    ////////////////////////////////////////////////////////////////////
-    // Initialize the sound subsystem.
-    ////////////////////////////////////////////////////////////////////
-
-    init_volume = fgGetFloat("/sim/sound/volume");
-    fgSetFloat("/sim/sound/volume", 0.0f);
-    globals->set_soundmgr(new SGSoundMgr);
-    globals->get_soundmgr()->init();
-    globals->get_soundmgr()->bind();
-
-
     ////////////////////////////////////////////////////////////////////
     // Initialize the sound-effects subsystem.
     ////////////////////////////////////////////////////////////////////
-
-    globals->add_subsystem("fx", new FGFX);
     globals->add_subsystem("voice", new FGVoiceMgr);
 #endif
 
@@ -1613,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 
     ////////////////////////////////////////////////////////////////////
@@ -1624,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
     ////////////////////////////////////////////////////////////////////
@@ -1688,6 +1683,7 @@ bool fgInitSubsystems() {
     ////////////////////////////////////////////////////////////////////
     globals->add_subsystem("replay", new FGReplay);
 
+
     ////////////////////////////////////////////////////////////////////
     // Bind and initialize subsystems.
     ////////////////////////////////////////////////////////////////////