mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Enable MSFS 64 bit build
This commit is contained in:
committed by
Mat Sutcliffe
parent
7e04a2c40f
commit
308081cfcc
@@ -96,11 +96,6 @@ This plugin acts as the interface between swift and MSFS.</detailedDescription>
|
||||
<platformTest>
|
||||
<type>windows</type>
|
||||
</platformTest>
|
||||
<compareText>
|
||||
<logic>equals</logic>
|
||||
<text>${architecture}</text>
|
||||
<value>32</value>
|
||||
</compareText>
|
||||
</shouldPackRuleList>
|
||||
</component>
|
||||
<component>
|
||||
|
||||
@@ -103,8 +103,8 @@ win32-g++: CONFIG += separate_debug_info
|
||||
# FSX or FS9 on 32bit Windows only
|
||||
################################
|
||||
|
||||
!win32: disableSwiftConfig(sims.p3d)
|
||||
equals(WORD_SIZE,64)|!win32: disableSwiftConfig(sims.fsx, sims.fs9, sims.fs2020)
|
||||
!win32: disableSwiftConfig(sims.p3d, sims.msfs)
|
||||
equals(WORD_SIZE,64)|!win32: disableSwiftConfig(sims.fsx, sims.fs9)
|
||||
# equals(WORD_SIZE,64):win32-g++: disableSwiftConfig(sims.p3d)
|
||||
|
||||
################################
|
||||
|
||||
@@ -244,6 +244,35 @@ bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool loadAndResolveMSFSimConnect()
|
||||
{
|
||||
// Check if already loaded
|
||||
if (gSymbols.SimConnect_Open) { return true; }
|
||||
|
||||
QString simConnectFileName(QStringLiteral("SimConnect.MSFS"));
|
||||
|
||||
QLibrary simConnectDll(simConnectFileName);
|
||||
simConnectDll.setLoadHints(QLibrary::PreventUnloadHint);
|
||||
if (simConnectDll.load())
|
||||
{
|
||||
const bool resolvedCommon = resolveCommonSimConnectSymbols(simConnectDll);
|
||||
if (!resolvedCommon)
|
||||
{
|
||||
CLogMessage(CLogCategories::driver()).error(u"Failed to resolve common symbols from SimConnect.dll: '%1'") << simConnectFileName;
|
||||
return false;
|
||||
}
|
||||
|
||||
CLogMessage(CLogCategories::driver()).info(u"Loaded and resolved MSFS symbols from SimConnect.dll: '%1'") << simConnectFileName;
|
||||
return resolvedCommon;
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(CLogCategories::driver()).error(u"Failed to load SimConnect.dll: '%1' '%2'") << simConnectFileName << simConnectDll.errorString();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
bool loadAndResolveFsxSimConnect(bool manifestProbing)
|
||||
{
|
||||
|
||||
@@ -39,6 +39,8 @@ FSXCOMMON_EXPORT bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version);
|
||||
//! Same but string version
|
||||
inline bool loadAndResolveP3DSimConnectByString(const QString &version) { return loadAndResolveP3DSimConnect(stringToP3DVersion(version)); }
|
||||
|
||||
FSXCOMMON_EXPORT bool loadAndResolveMSFSimConnect();
|
||||
|
||||
#else
|
||||
|
||||
//! Load and resolve FSX SimConnect.
|
||||
|
||||
@@ -6,7 +6,7 @@ TEMPLATE = lib
|
||||
|
||||
CONFIG += plugin shared
|
||||
CONFIG += blackconfig blackmisc blackcore blackgui
|
||||
CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon simconnect
|
||||
CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon
|
||||
|
||||
DEPENDPATH += . $$SourceRoot/src
|
||||
INCLUDEPATH += . $$SourceRoot/src
|
||||
@@ -17,8 +17,7 @@ HEADERS += *.h
|
||||
|
||||
DEFINES += SIMCONNECT_H_NOMANIFEST
|
||||
equals(WORD_SIZE,64) {
|
||||
SIMCONNECT_INCLUDE += $$EXTERNALSROOT/common/include/simconnect/P3D-v4
|
||||
DEFINES += P3D_SDK_VERSION=400
|
||||
SIMCONNECT_INCLUDE += $$EXTERNALSROOT/common/include/simconnect/MSFS
|
||||
}
|
||||
equals(WORD_SIZE,32) {
|
||||
SIMCONNECT_INCLUDE += $$EXTERNALSROOT/common/include/simconnect/FSX-XPack
|
||||
|
||||
@@ -42,14 +42,24 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimulatorMsFs::connectTo()
|
||||
{
|
||||
//if (!loadAndResolveFsxSimConnect(true)) { return false; }
|
||||
#ifdef Q_OS_WIN64
|
||||
if (!loadAndResolveMSFSimConnect()) { return false; }
|
||||
return CSimulatorFsxCommon::connectTo();
|
||||
#else
|
||||
if (!loadAndResolveFsxSimConnect(true)) { return false; }
|
||||
return CSimulatorFsxCommon::connectTo();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CSimulatorMsFsListener::startImpl()
|
||||
{
|
||||
//if (!loadAndResolveFsxSimConnect(true)) { return; }
|
||||
return CSimulatorFsxCommonListener::startImpl();
|
||||
#ifdef Q_OS_WIN64
|
||||
if (!loadAndResolveMSFSimConnect()) { return; }
|
||||
CSimulatorFsxCommonListener::startImpl();
|
||||
#else
|
||||
if (!loadAndResolveFsxSimConnect(true)) { return; }
|
||||
CSimulatorFsxCommonListener::startImpl();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user