X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Ffg_init.cxx;h=bddcc69f1d00c2c3f8410336a057d577a1a9e5f2;hb=7563ece882247d1fa5ae105c8445d93048da041b;hp=d10bf40764190e559b9c2f1500d59766733d1075;hpb=50c1fe2d3e8bbfdb54873b213eb3a148cfa1f00d;p=flightgear.git diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index d10bf4076..bddcc69f1 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -32,12 +32,12 @@ #if defined( unix ) || defined( __CYGWIN__ ) # include // for gethostname() #endif -#if defined( _MSC_VER) || defined(__MINGW32__) +#ifdef _WIN32 # include // for getcwd() # define getcwd _getcwd # include // 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 @@ -49,6 +49,8 @@ #include #include +#include +#include #include #include @@ -71,8 +73,15 @@ #include #include -#include -#include + +#if ENABLE_ATCDCL +# include +# include +# include "ATCDCL/commlist.hxx" +#else +# include "ATC/atcutils.hxx" +#endif + #include #include #include @@ -80,7 +89,8 @@ #include #include #include -#ifdef ENABLE_SP_FDM + +#if ENABLE_SP_FDM #include #include #include @@ -128,13 +138,14 @@ #include "renderer.hxx" #include "viewmgr.hxx" #include "main.hxx" -#include "ATCDCL/commlist.hxx" + #ifdef __APPLE__ # include #endif using std::string; +using namespace boost::algorithm; extern const char *default_root; @@ -266,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 @@ -553,7 +564,7 @@ static string fgFindAircraftPath( const SGPath &path, const string &aircraft, n->setStringValue(path.str().c_str()); n->setAttribute(SGPropertyNode::USERARCHIVE, true); - if ( !strcmp(dire->d_name, aircraft.c_str()) ) { + if ( boost::equals(dire->d_name, aircraft.c_str(), is_iequal()) ) { result = path.str(); break; } @@ -582,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 ); @@ -636,7 +647,7 @@ bool fgInitConfig ( int argc, char **argv ) { vector cache = cache_root->getChildren("aircraft"); for (unsigned int i = 0; i < cache.size(); i++) { const char *name = cache[i]->getStringValue("file", ""); - if (aircraft_set == name) { + if (boost::equals(aircraft_set, name, is_iequal())) { const char *path = cache[i]->getStringValue("path", ""); SGPath xml(path); xml.append(name); @@ -799,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()); @@ -970,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() ); @@ -1452,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 devices = - globals->get_soundmgr()->get_available_devices(); - for (unsigned int i=0; isetStringValue(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. @@ -1547,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 ); @@ -1607,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 //////////////////////////////////////////////////////////////////// @@ -1618,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 ////////////////////////////////////////////////////////////////////