From 83db7bcac5c4d97944d46599fc96fb6bd4655a61 Mon Sep 17 00:00:00 2001 From: TwinFan Date: Tue, 20 Jan 2026 22:35:49 +0100 Subject: [PATCH 1/2] Fix: Remove XPLM from LTAPIConnect constructor to continue to allow using a static object also with XP 12.4.0 --- .../xcschemes/LTAPIExample.xcscheme | 10 ++++------ LTAPI.cpp | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Example/LTAPI.xcodeproj/xcshareddata/xcschemes/LTAPIExample.xcscheme b/Example/LTAPI.xcodeproj/xcshareddata/xcschemes/LTAPIExample.xcscheme index 6439f2c..b679c16 100644 --- a/Example/LTAPI.xcodeproj/xcshareddata/xcschemes/LTAPIExample.xcscheme +++ b/Example/LTAPI.xcodeproj/xcshareddata/xcschemes/LTAPIExample.xcscheme @@ -1,7 +1,7 @@ + version = "2.0"> - - + allowLocationSimulation = "YES" + launchAutomaticallySubstyle = "2"> 100 ? 100 : numBulkAc), vBulkNum (new LTAPIAircraft::LTAPIBulkData[iBulkAc]), vInfoTexts(new LTAPIAircraft::LTAPIBulkInfoTexts[iBulkAc]), pfCreateAcObject(_pfCreateAcObject) -{ - // Create the shared dataRefs to access camera aircraft event notifications - XPLMShareData(SDR_CAMERA_MODES_ID, xplmType_Int, nullptr, nullptr); - XPLMShareData(SDR_CAMERA_TCAS_IDX, xplmType_Int, (XPLMDataChanged_f)(<APIConnect::CameraSharedDataCB), this); -} +{} LTAPIConnect::~LTAPIConnect() { @@ -407,6 +403,15 @@ std::chrono::system_clock::time_point LTAPIConnect::getLTSimTimePoint () const MapLTAPIAircraft& LTAPIConnect::UpdateAcList (ListLTAPIAircraft* plistRemovedAc) { + // One-time init that needs to be done before the first aircraft is created + static bool bOneTimeInitDone = false; + if (!bOneTimeInitDone) { + // Create the shared dataRefs to access camera aircraft event notifications + XPLMShareData(SDR_CAMERA_MODES_ID, xplmType_Int, nullptr, nullptr); + XPLMShareData(SDR_CAMERA_TCAS_IDX, xplmType_Int, (XPLMDataChanged_f)(<APIConnect::CameraSharedDataCB), this); + bOneTimeInitDone = true; + } + // These are the bulk input/output dataRefs in LiveTraffic, // with which we fetch mass data from LiveTraffic static LTDataRef DRquick("livetraffic/bulk/quick"); @@ -507,8 +512,8 @@ SPtrLTAPIAircraft LTAPIConnect::getAcInCameraView() const } -// LTAPIConnect::Clear camera information, ie. delcare that no aircraft is currently being viewed -void clearCameraInfo () +// Clear camera information, ie. delcare that no aircraft is currently being viewed +void LTAPIConnect::clearCameraInfo () { LTAPI::setCameraAcDataRefs(0, 0); } From 893ca340d15e99c2bc6639238a8c61a93f1b2084 Mon Sep 17 00:00:00 2001 From: TwinFan Date: Tue, 20 Jan 2026 22:45:28 +0100 Subject: [PATCH 2/2] Chore: Upgrade Linux bild env to Ubuntu -22.04 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f927cd..c934085 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: ##################################### # Linux with GCC build-lin: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: platform: lin steps: