mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Use XPLM native path on MacOS
This commit is contained in:
committed by
Klaus Basan
parent
4db0b83310
commit
e64e7feb28
@@ -36,6 +36,11 @@ XSwiftBus::CPlugin *g_plugin;
|
||||
|
||||
PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc)
|
||||
{
|
||||
#if APL
|
||||
// https://developer.x-plane.com/2014/12/mac-plugin-developers-you-should-be-using-native-paths/
|
||||
XPLMEnableFeature("XPLM_USE_NATIVE_PATHS",1);
|
||||
#endif
|
||||
|
||||
std::strcpy(o_name, "XSwiftBus");
|
||||
std::strcpy(o_sig, "org.swift-project.xswiftbus");
|
||||
std::strcpy(o_desc, "Allows swift to connect to X-Plane via D-Bus IPC");
|
||||
|
||||
@@ -32,7 +32,10 @@ namespace XSwiftBus
|
||||
char xplanePath[512];
|
||||
XPLMGetSystemPath(xplanePath);
|
||||
#ifdef Q_OS_MAC
|
||||
HFS2PosixPath(xplanePath, xplanePath, sizeof(xplanePath));
|
||||
if (XPLMIsFeatureEnabled("XPLM_USE_NATIVE_PATHS") == 0)
|
||||
{
|
||||
HFS2PosixPath(xplanePath, xplanePath, sizeof(xplanePath));
|
||||
}
|
||||
g_sep = "/";
|
||||
#else
|
||||
g_sep = XPLMGetDirectorySeparator();
|
||||
|
||||
Reference in New Issue
Block a user