mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +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)
|
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)
|
if (drawing)
|
||||||
{
|
{
|
||||||
XPMPEnableAircraftLabels();
|
XPMPEnableAircraftLabels();
|
||||||
@@ -954,6 +960,17 @@ namespace XSwiftBus
|
|||||||
traffic->emitSimFrame();
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ namespace XSwiftBus
|
|||||||
DeltaCameraPosition m_deltaCameraPosition;
|
DeltaCameraPosition m_deltaCameraPosition;
|
||||||
|
|
||||||
bool m_emitSimFrame = true;
|
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);
|
int getPlaneData(void *id, int dataType, void *io_data);
|
||||||
static int getPlaneData(void *id, int dataType, void *io_data, void *self)
|
static int getPlaneData(void *id, int dataType, void *io_data, void *self)
|
||||||
|
|||||||
Reference in New Issue
Block a user