mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T709, update labels every n-th frame
This commit is contained in:
committed by
Mat Sutcliffe
parent
01f90fc9bf
commit
4a0101feed
@@ -255,7 +255,13 @@ namespace XSwiftBus
|
||||
|
||||
void CTraffic::setDrawingLabels(bool drawing)
|
||||
{
|
||||
s_settingsProvider->getSettings().setDrawingLabels(drawing);
|
||||
CSettings s = this->getSettings();
|
||||
if (s.isDrawingLabels() != drawing)
|
||||
{
|
||||
s.setDrawingLabels(drawing);
|
||||
this->setSettings(s);
|
||||
}
|
||||
|
||||
if (drawing)
|
||||
{
|
||||
XPMPEnableAircraftLabels();
|
||||
@@ -954,6 +960,17 @@ namespace XSwiftBus
|
||||
traffic->emitSimFrame();
|
||||
}
|
||||
|
||||
traffic->m_countFrame++;
|
||||
if (traffic->m_countFrame % 250 == 0)
|
||||
{
|
||||
// update labels
|
||||
const CSettings s = traffic->getSettings();
|
||||
if (traffic->isDrawingLabels() != s.isDrawingLabels())
|
||||
{
|
||||
traffic->setDrawingLabels(s.isDrawingLabels());
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -210,6 +210,7 @@ namespace XSwiftBus
|
||||
DeltaCameraPosition m_deltaCameraPosition;
|
||||
|
||||
bool m_emitSimFrame = true;
|
||||
int m_countFrame = 0; //!< allows to do something every n-th frame
|
||||
|
||||
int getPlaneData(void *id, int dataType, void *io_data);
|
||||
static int getPlaneData(void *id, int dataType, void *io_data, void *self)
|
||||
|
||||
Reference in New Issue
Block a user