]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.cxx
Reset: use new copy-properties helper.
[flightgear.git] / src / Main / options.cxx
index 06e57f36f35963d879ceae520903955346215f8e..44d5d7c5fc10bd1f7d75efbb97e2c952f6ed4e6b 100644 (file)
 #  include <Include/no_version.h>
 #endif
 
-#ifdef __APPLE__
-#  include <CoreFoundation/CoreFoundation.h>
-#endif
-
 using std::string;
 using std::sort;
 using std::cout;
@@ -1932,6 +1928,10 @@ void Options::initAircraft()
     SG_LOG(SG_INPUT, SG_INFO, "No user specified aircraft, using default" );
   }
   
+// persist across reset
+  SGPropertyNode* aircraftProp = fgGetNode("/sim/aircraft", true);
+  aircraftProp->setAttribute(SGPropertyNode::PRESERVE, true);
+    
   if (p->showAircraft) {
     fgOptLogLevel( "alert" );
     SGPath path( globals->get_fg_root() );
@@ -2350,36 +2350,13 @@ string Options::platformDefaultRoot() const
   return "../data";
 }
 
-#elif defined(_WIN32)
+#elif defined(SG_WINDOWS)
 string Options::platformDefaultRoot() const
 {
   return "..\\data";
 }
-#elif defined(__APPLE__)
-string Options::platformDefaultRoot() const
-{
-  /*
-   The following code looks for the base package inside the application 
-   bundle, in the standard Contents/Resources location. 
-   */
-  CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
-  
-  // look for a 'data' subdir
-  CFURLRef dataDir = CFURLCreateCopyAppendingPathComponent(NULL, resourcesUrl, CFSTR("data"), true);
-  
-  CFURLRef absoluteDataUrl = CFURLCopyAbsoluteURL(dataDir);
-  
-  // now convert down to a path, and the a c-string
-  CFStringRef path = CFURLCopyFileSystemPath(absoluteDataUrl, kCFURLPOSIXPathStyle);  
-  string root = CFStringGetCStringPtr(path, CFStringGetSystemEncoding());
-  
-  CFRelease(absoluteDataUrl);
-  CFRelease(resourcesUrl);
-  CFRelease(dataDir);
-  CFRelease(path);
-  
-  return root;
-}
+#elif defined(SG_MAC)
+// platformDefaultRoot defined in CocoaHelpers.mm
 #else
 string Options::platformDefaultRoot() const
 {