1
0
Fork 0

Globals: Initial support for a runtime headless mode.

This commit is contained in:
Edward d'Auvergne 2018-06-11 08:50:07 +02:00
parent 99a50508a7
commit 4699939275
2 changed files with 21 additions and 1 deletions

View file

@ -161,7 +161,8 @@ FGGlobals::FGGlobals() :
channel_options_list( NULL ), channel_options_list( NULL ),
initial_waypoints( NULL ), initial_waypoints( NULL ),
channellist( NULL ), channellist( NULL ),
haveUserSettings(false) haveUserSettings(false),
_headless(false)
{ {
SGPropertyNode* root = new SGPropertyNode; SGPropertyNode* root = new SGPropertyNode;
props = SGPropertyNode_ptr(root); props = SGPropertyNode_ptr(root);
@ -923,4 +924,14 @@ void FGGlobals::setPackageRoot(const SGSharedPtr<simgear::pkg::Root>& p)
_packageRoot = p; _packageRoot = p;
} }
bool FGGlobals::is_headless()
{
return _headless;
}
void FGGlobals::set_headless(bool mode)
{
_headless = mode;
}
// end of globals.cxx // end of globals.cxx

View file

@ -156,6 +156,9 @@ private:
SGPropertyChangeListenerVec _listeners_to_cleanup; SGPropertyChangeListenerVec _listeners_to_cleanup;
SGSharedPtr<simgear::pkg::Root> _packageRoot; SGSharedPtr<simgear::pkg::Root> _packageRoot;
bool _headless;
public: public:
FGGlobals(); FGGlobals();
@ -404,6 +407,12 @@ public:
simgear::pkg::Root* packageRoot(); simgear::pkg::Root* packageRoot();
void setPackageRoot(const SGSharedPtr<simgear::pkg::Root>& p); void setPackageRoot(const SGSharedPtr<simgear::pkg::Root>& p);
/**
* A runtime headless mode for running without a GUI.
*/
bool is_headless();
void set_headless(bool mode);
}; };