mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T270, interpolator optimization by passing aircraft number
Rational: Except for FS9 we interpolate all aircraft in one loop at the same time. This can cause that some steps are always done at the same time for all aircraft of that loop. By passing the number we can more equally distribute such tasks, avoiding peaks.
This commit is contained in:
@@ -711,6 +711,7 @@ namespace BlackSimPlugin
|
||||
PlanesPositions planesPositions;
|
||||
PlanesSurfaces planesSurfaces;
|
||||
|
||||
int aircraftNumber = 0;
|
||||
for (const CXPlaneMPAircraft &xplaneAircraft : xplaneAircraftList)
|
||||
{
|
||||
const CCallsign callsign(xplaneAircraft.getCallsign());
|
||||
@@ -720,7 +721,7 @@ namespace BlackSimPlugin
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupConsolidated(callsign);
|
||||
|
||||
// interpolated situation/parts
|
||||
const CInterpolationResult result = xplaneAircraft.getInterpolation(currentTimestamp, setup);
|
||||
const CInterpolationResult result = xplaneAircraft.getInterpolation(currentTimestamp, setup, aircraftNumber++);
|
||||
if (result.getInterpolationStatus().hasValidSituation())
|
||||
{
|
||||
const CAircraftSituation interpolatedSituation(result);
|
||||
@@ -767,7 +768,7 @@ namespace BlackSimPlugin
|
||||
|
||||
} // all callsigns
|
||||
|
||||
if (! planesPositions.isEmpty())
|
||||
if (!planesPositions.isEmpty())
|
||||
{
|
||||
m_trafficProxy->setPlanesPositions(planesPositions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user