mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Fix #67 by unregistering XPMP2's flight loop callback
and instead calling it from within our own flight loop callback
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
|
||||
// clazy:excludeall=reserve-candidates
|
||||
|
||||
float XPMP_PrepListHook(float, float, int, void *); // defined in xplanemp2/src/Renderer.cpp
|
||||
|
||||
using namespace BlackMisc::Simulation::XPlane::QtFreeUtils;
|
||||
|
||||
namespace XSwiftBus
|
||||
@@ -107,6 +109,9 @@ namespace XSwiftBus
|
||||
else
|
||||
{
|
||||
m_enabledMultiplayer = true;
|
||||
|
||||
// we will call xplanemp's callback from within our own callback
|
||||
XPLMUnregisterFlightLoopCallback(XPMP_PrepListHook, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -819,6 +824,8 @@ namespace XSwiftBus
|
||||
m_updates.push_back({ plane->id, &plane->position, &plane->surfaces, &plane->surveillance });
|
||||
}
|
||||
XPMPUpdatePlanes(m_updates.data(), sizeof(XPMPUpdate_t), m_updates.size());
|
||||
|
||||
XPMP_PrepListHook(0, 0, 0, nullptr);
|
||||
}
|
||||
|
||||
void CTraffic::interpolateGear(Plane* plane)
|
||||
|
||||
Submodule src/xswiftbus/xplanemp2 updated: 71b339f88c...b1dd0c8458
Reference in New Issue
Block a user