mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Issue #17 Restore aircraft labels with math and logic cribbed from LiveTraffic's XPMP2
This commit is contained in:
@@ -28,15 +28,20 @@ namespace XSwiftBus
|
||||
//! Destructor.
|
||||
virtual ~CDrawable() { hide(); }
|
||||
|
||||
//! Is currently shown.
|
||||
bool isVisible() const { return m_visible; }
|
||||
|
||||
//! Register the draw callback.
|
||||
void show()
|
||||
{
|
||||
m_visible = true;
|
||||
XPLMRegisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
||||
}
|
||||
|
||||
//! Unregister the draw callback.
|
||||
void hide()
|
||||
{
|
||||
m_visible = false;
|
||||
XPLMUnregisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
||||
}
|
||||
|
||||
@@ -51,8 +56,9 @@ namespace XSwiftBus
|
||||
return 1;
|
||||
}
|
||||
|
||||
const XPLMDrawingPhase m_phase;
|
||||
const bool m_before;
|
||||
XPLMDrawingPhase m_phase;
|
||||
bool m_before = false;
|
||||
bool m_visible = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user