mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +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:
@@ -421,6 +421,7 @@ namespace BlackSimPlugin
|
||||
void CSimulatorEmulated::fetchFromInterpolator()
|
||||
{
|
||||
const qint64 now = QDateTime::currentMSecsSinceEpoch();
|
||||
int aircraftNumber = 0;
|
||||
for (const CSimulatedAircraft &aircraft : m_renderedAircraft)
|
||||
{
|
||||
const CCallsign cs = aircraft.getCallsign();
|
||||
@@ -428,7 +429,7 @@ namespace BlackSimPlugin
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(cs); // threadsafe copy
|
||||
CInterpolatorMulti *im = m_interpolators[cs];
|
||||
Q_ASSERT_X(im, Q_FUNC_INFO, "interpolator missing");
|
||||
CInterpolationResult result = im->getInterpolation(now, setup);
|
||||
const CInterpolationResult result = im->getInterpolation(now, setup, aircraftNumber++);
|
||||
const CAircraftSituation s = result;
|
||||
const CAircraftParts p = result;
|
||||
m_countInterpolatedParts++;
|
||||
|
||||
Reference in New Issue
Block a user