1
0
Fork 0

Make FGControls behave like a standard subsystem.

This commit is contained in:
James Turner 2012-09-25 00:48:48 +01:00
parent b1ff365a8f
commit 2f6172687e
4 changed files with 5 additions and 16 deletions

View file

@ -100,6 +100,7 @@ FGControls::FGControls() :
vertical_mode( 0 ), vertical_mode( 0 ),
lateral_mode( 0 ) lateral_mode( 0 )
{ {
globals->set_controls( this );
} }
@ -231,6 +232,7 @@ static inline void _SetRoot( simgear::TiedPropertyList & tiedProperties, const c
void void
FGControls::bind () FGControls::bind ()
{ {
init(); // unfortunately, tie-ing requires init() to have occurred
int index, i; int index, i;
// flight controls // flight controls
@ -648,9 +650,8 @@ void FGControls::unbind ()
void void
FGControls::update (double dt) FGControls::update (double dt)
{ {
SG_UNUSED(dt);
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Setters and adjusters. // Setters and adjusters.

View file

@ -677,10 +677,8 @@ void fgCreateSubsystems() {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Initialize the controls subsystem. // Initialize the controls subsystem.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
globals->get_controls()->init(); globals->add_subsystem("controls", new FGControls);
globals->get_controls()->bind();
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Initialize the input subsystem. // Initialize the input subsystem.

View file

@ -185,12 +185,6 @@ FGGlobals::~FGGlobals()
delete ATIS_mgr; delete ATIS_mgr;
if (controls)
{
controls->unbind();
delete controls;
}
delete channel_options_list; delete channel_options_list;
delete initial_waypoints; delete initial_waypoints;
delete scenery; delete scenery;

View file

@ -49,7 +49,6 @@
#include <simgear/math/SGMath.hxx> #include <simgear/math/SGMath.hxx>
#include <simgear/math/sg_random.h> #include <simgear/math/sg_random.h>
#include <Aircraft/controls.hxx>
#include <Model/panelnode.hxx> #include <Model/panelnode.hxx>
#include <Scenery/scenery.hxx> #include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx> #include <Scenery/tilemgr.hxx>
@ -364,9 +363,6 @@ int fgMainInit( int argc, char **argv ) {
// seed the random number generator // seed the random number generator
sg_srandom_time(); sg_srandom_time();
FGControls *controls = new FGControls;
globals->set_controls( controls );
string_list *col = new string_list; string_list *col = new string_list;
globals->set_channel_options_list( col ); globals->set_channel_options_list( col );