#include "positioninit.hxx"
#include "util.hxx"
+#if defined(SG_MAC)
+#include <GUI/CocoaHelpers.h> // for Mac impl of platformDefaultDataPath()
+#endif
+
using std::string;
using std::endl;
using std::cerr;
return config;
}
-#elif __APPLE__
-#include <CoreServices/CoreServices.h>
-
-static SGPath platformDefaultDataPath()
-{
- FSRef ref;
- OSErr err = FSFindFolder(kUserDomain, kApplicationSupportFolderType, false, &ref);
- if (err) {
- return SGPath();
- }
+#elif defined(SG_MAC)
- unsigned char path[1024];
- if (FSRefMakePath(&ref, path, 1024) != noErr) {
- return SGPath();
- }
+// platformDefaultDataPath defined in GUI/CocoaHelpers.h
- SGPath appData;
- appData.set((const char*) path);
- appData.append("FlightGear");
- return appData;
-}
#else
static SGPath platformDefaultDataPath()
{
home->setStringValue(dataPath.c_str());
home->setAttribute(SGPropertyNode::WRITE, false);
+ fgSetDefaults();
flightgear::Options* options = flightgear::Options::sharedInstance();
options->init(argc, argv, dataPath);
bool loadDefaults = flightgear::Options::sharedInstance()->shouldLoadDefaultConfig();