diff --git a/.gitignore b/.gitignore index 4ecfb48..0cf14cb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ *.cache/ *.d *.db -*.dll *.exe *.lib *.o diff --git a/config/navdatareader.cfg b/config/navdatareader.cfg index 0326b3f..18a1f1f 100644 --- a/config/navdatareader.cfg +++ b/config/navdatareader.cfg @@ -182,7 +182,7 @@ IncludeFilenames= # bvcf.bgl CENTER type airspace boundaries. # BNXWorld* Geopolitical and airspace boundaries. # Exclude DEM, bridges and other scenery per default -ExcludeFilenames=brx*,obx*,cvx*,dem*,wsx* +ExcludeFilenames=brx*.bgl,obx*.bgl,cvx*.bgl,dem*.bgl,wsx*.bgl,traffic*.bgl,AIRACCycle.bgl # Filter files by path relative from scenery.cfg minus the scenery directory # Example: Addon Scenery/JetwayExclude/*,Scenery/0501/*,Scenery/0601/* diff --git a/config/navdatareader_1801.cfg b/config/navdatareader_1801.cfg index 8ffd253..fce2fb9 100644 --- a/config/navdatareader_1801.cfg +++ b/config/navdatareader_1801.cfg @@ -138,7 +138,7 @@ IncludeFilenames= # bvcf.bgl CENTER type airspace boundaries. # BNXWorld* Geopolitical and airspace boundaries. # Exclude DEM, bridges and other scenery per default -ExcludeFilenames=brx*,obx*,cvx*,dem*,wsx* +ExcludeFilenames=brx*.bgl,obx*.bgl,cvx*.bgl,dem*.bgl,wsx*.bgl,traffic*.bgl,AIRACCycle.bgl # Filter files by path relative from scenery.cfg minus the scenery directory # Example: Addon Scenery/JetwayExclude/*,Scenery/0501/*,Scenery/0601/* diff --git a/navdatareader.cpp b/navdatareader.cpp index 2ab116b..f619d5d 100644 --- a/navdatareader.cpp +++ b/navdatareader.cpp @@ -24,6 +24,7 @@ #include "logging/logginghandler.h" #include "logging/loggingutil.h" #include "settings/settings.h" +#include "win/activationcontext.h" #include #include @@ -32,6 +33,12 @@ using atools::sql::SqlDatabase; using atools::fs::NavDatabaseErrors; using atools::fs::FsPaths; +#if defined(WINARCH64) +const QLatin1String SIMCONNECT_LOADER_DLL_NAME("SimConnect_msfs_2024.dll"); +#else +const QLatin1String SIMCONNECT_LOADER_DLL_NAME; +#endif + void NavdataReader::run() { // Fill NavDatabaseOptions from command line @@ -70,9 +77,14 @@ void NavdataReader::run() // FKs don't work currently db.open(DATABASE_PRAGMAS); + atools::win::ActivationContext context; + context.loadLibrary(SIMCONNECT_LOADER_DLL_NAME); + atools::fs::NavDatabaseErrors errors; - atools::fs::NavDatabase nd(&opts, &db, &errors, GIT_REVISION_NAVDATAREADER); - resultFlags = nd.compileDatabase(); + atools::fs::NavDatabase navDatabase(&opts, &db, &errors, GIT_REVISION_NAVDATAREADER); + navDatabase.setActivationContext(&context, SIMCONNECT_LOADER_DLL_NAME); + + resultFlags = navDatabase.compileDatabase(); db.close(); if(errors.getTotalErrors() > 0) @@ -111,7 +123,7 @@ void NavdataReader::parseArgs() QCommandLineOption fstypeOpt({"f", "flight-simulator"}, QObject::tr("Required option. Flight simulator type or other data source. " - "Either FSX, FSXSE, P3DV2, P3DV3, P3DV4, P3DV5, P3DV6, XP11, XP12, MSFS or DFD."), + "Either FSX, FSXSE, P3DV2, P3DV3, P3DV4, P3DV5, P3DV6, XP11, XP12, MSFS, MSFS24 or DFD."), QObject::tr("simulator")); parser.addOption(fstypeOpt); @@ -209,7 +221,7 @@ void NavdataReader::parseArgs() } // Scenery.cfg only FSX and P3D =================================================== - if(!FsPaths::isAnyXplane(type) && type != FsPaths::DFD && type != FsPaths::MSFS) + if(!FsPaths::isAnyXplane(type) && type != FsPaths::DFD && type != FsPaths::MSFS && type != FsPaths::MSFS_2024) { QString sceneryFile = parser.value(sceneryOpt); if(sceneryFile.isEmpty()) @@ -225,6 +237,8 @@ void NavdataReader::parseArgs() opts.setMsfsCommunityPath(FsPaths::getMsfsCommunityPath(opts.getBasepath())); opts.setMsfsOfficialPath(FsPaths::getMsfsOfficialPath(opts.getBasepath())); } + else if(type == FsPaths::MSFS_2024) + opts.setMsfs24StreamedPackagesPath(FsPaths::getMsfs24StreamedPackagesPath()); // Configuration file =================================================== configFile = parser.value(cfgOpt); diff --git a/navdatareader.pro b/navdatareader.pro index 7e11e79..247b8a3 100644 --- a/navdatareader.pro +++ b/navdatareader.pro @@ -61,6 +61,7 @@ TARGET_NAME=Navdatareader ATOOLS_INC_PATH=$$(ATOOLS_INC_PATH) ATOOLS_LIB_PATH=$$(ATOOLS_LIB_PATH) ATOOLS_NO_CRASHHANDLER=$$(ATOOLS_NO_CRASHHANDLER) +SIMCONNECT_PATH_WIN64_MSFS_2024=$$(ATOOLS_SIMCONNECT_PATH_WIN64_MSFS_2024) GIT_PATH=$$(ATOOLS_GIT_PATH) DEPLOY_BASE=$$(DEPLOY_BASE) @@ -92,9 +93,20 @@ unix:!macx { } win32 { + # MSFS + WINARCH = win64 + !isEmpty(SIMCONNECT_PATH_WIN64_MSFS_2024) { + DEFINES += SIMCONNECT_BUILD_WIN64 WINARCH64 + INCLUDEPATH += $$SIMCONNECT_PATH_WIN64_MSFS_2024"\include" + LIBS += $$SIMCONNECT_PATH_WIN64_MSFS_2024"\lib\SimConnect.lib" + } + WINDEPLOY_FLAGS = --compiler-runtime CONFIG(debug, debug|release) : WINDEPLOY_FLAGS += --debug -# CONFIG(release, debug|release) : WINDEPLOY_FLAGS += --release + + DEFINES += _USE_MATH_DEFINES + + LIBS += -L$$ATOOLS_LIB_PATH -latools -lz } macx { @@ -159,6 +171,7 @@ message(GIT_PATH: $$GIT_PATH) message(ATOOLS_INC_PATH: $$ATOOLS_INC_PATH) message(ATOOLS_LIB_PATH: $$ATOOLS_LIB_PATH) message(ATOOLS_NO_CRASHHANDLER: $$ATOOLS_NO_CRASHHANDLER) +message(SIMCONNECT_PATH_WIN64_MSFS_2024: $$SIMCONNECT_PATH_WIN64_MSFS_2024) message(DEPLOY_BASE: $$DEPLOY_BASE) message(DEFINES: $$DEFINES) message(INCLUDEPATH: $$INCLUDEPATH) @@ -249,6 +262,9 @@ win32 { deploy.commands += xcopy /F $$p($$PWD/CHANGELOG.txt) $$p($$DEPLOY_BASE/$$TARGET_NAME) && deploy.commands += xcopy /F $$p($$PWD/README.txt) $$p($$DEPLOY_BASE/$$TARGET_NAME) && deploy.commands += xcopy /F $$p($$PWD/LICENSE.txt) $$p($$DEPLOY_BASE/$$TARGET_NAME) && + exists($$SIMCONNECT_PATH_WIN64_MSFS_2024/lib/SimConnect.dll) { + deploy.commands += copy /Y $$p($$SIMCONNECT_PATH_WIN64_MSFS_2024/lib/SimConnect.dll) $$p($$DEPLOY_BASE/$$TARGET_NAME/SimConnect_msfs_2024.dll) && + } deploy.commands += xcopy /F $$p($$[QT_INSTALL_BINS]/libgcc*.dll) $$p($$DEPLOY_BASE/$$TARGET_NAME) && deploy.commands += xcopy /F $$p($$[QT_INSTALL_BINS]/libstdc*.dll) $$p($$DEPLOY_BASE/$$TARGET_NAME) && deploy.commands += xcopy /F $$p($$[QT_INSTALL_BINS]/libwinpthread*.dll) $$p($$DEPLOY_BASE/$$TARGET_NAME) && diff --git a/resources/config/navdatareader.cfg b/resources/config/navdatareader.cfg index 0326b3f..18a1f1f 100644 --- a/resources/config/navdatareader.cfg +++ b/resources/config/navdatareader.cfg @@ -182,7 +182,7 @@ IncludeFilenames= # bvcf.bgl CENTER type airspace boundaries. # BNXWorld* Geopolitical and airspace boundaries. # Exclude DEM, bridges and other scenery per default -ExcludeFilenames=brx*,obx*,cvx*,dem*,wsx* +ExcludeFilenames=brx*.bgl,obx*.bgl,cvx*.bgl,dem*.bgl,wsx*.bgl,traffic*.bgl,AIRACCycle.bgl # Filter files by path relative from scenery.cfg minus the scenery directory # Example: Addon Scenery/JetwayExclude/*,Scenery/0501/*,Scenery/0601/*