mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +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
|
// clazy:excludeall=reserve-candidates
|
||||||
|
|
||||||
|
float XPMP_PrepListHook(float, float, int, void *); // defined in xplanemp2/src/Renderer.cpp
|
||||||
|
|
||||||
using namespace BlackMisc::Simulation::XPlane::QtFreeUtils;
|
using namespace BlackMisc::Simulation::XPlane::QtFreeUtils;
|
||||||
|
|
||||||
namespace XSwiftBus
|
namespace XSwiftBus
|
||||||
@@ -107,6 +109,9 @@ namespace XSwiftBus
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_enabledMultiplayer = true;
|
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 });
|
m_updates.push_back({ plane->id, &plane->position, &plane->surfaces, &plane->surveillance });
|
||||||
}
|
}
|
||||||
XPMPUpdatePlanes(m_updates.data(), sizeof(XPMPUpdate_t), m_updates.size());
|
XPMPUpdatePlanes(m_updates.data(), sizeof(XPMPUpdate_t), m_updates.size());
|
||||||
|
|
||||||
|
XPMP_PrepListHook(0, 0, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTraffic::interpolateGear(Plane* plane)
|
void CTraffic::interpolateGear(Plane* plane)
|
||||||
|
|||||||
Submodule src/xswiftbus/xplanemp2 updated: 71b339f88c...b1dd0c8458
Reference in New Issue
Block a user