refs #863 Change interpolation setup member to be a method parameter instead.

This commit is contained in:
Mathew Sutcliffe
2017-02-05 16:51:55 +00:00
parent 36474f65a0
commit 2181702c5c
12 changed files with 58 additions and 63 deletions

View File

@@ -48,9 +48,10 @@ namespace XBus
// also to disable aircraft parts / or logging parts (log file). I wonder if you want to consider it here
// e.g. interpolator->getInterpolatorSetup().getLogCallsigns().contains(callsign)
// if the setup is needed more than once, store it here to avoid multiple locks
BlackMisc::Simulation::CInterpolationAndRenderingSetup setup;
BlackMisc::Simulation::CInterpolationHints hints;
BlackMisc::Simulation::IInterpolator::PartsStatus status;
hints.setAircraftParts(interpolator->getInterpolatedParts(callsign, parts, -1, status));
hints.setAircraftParts(interpolator->getInterpolatedParts(callsign, parts, -1, setup, status));
hints.setElevationProvider([this](const auto & situation)
{
using namespace BlackMisc::PhysicalQuantities;
@@ -338,8 +339,9 @@ namespace XBus
{
if (plane->situations.size() < 3) { return xpmpData_Unavailable; } // avoid sudden movements when a pilot connects
BlackMisc::Simulation::CInterpolationAndRenderingSetup setup;
BlackMisc::Simulation::IInterpolator::InterpolationStatus status;
const auto situation = m_interpolator->getInterpolatedSituation(plane->callsign, plane->situations, -1, plane->hints(m_interpolator), status);
const auto situation = m_interpolator->getInterpolatedSituation(plane->callsign, plane->situations, -1, setup, plane->hints(m_interpolator), status);
if (! status.didInterpolationSucceed()) { return xpmpData_Unavailable; }
if (! status.hasChangedPosition()) { return xpmpData_Unchanged; }