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:
Klaus Basan
2018-06-01 18:02:11 +02:00
parent d39978a1d0
commit 181ed36f3d
13 changed files with 55 additions and 37 deletions

View File

@@ -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);
}