Make FGControls behave like a standard subsystem.
This commit is contained in:
parent
b1ff365a8f
commit
2f6172687e
4 changed files with 5 additions and 16 deletions
|
@ -100,6 +100,7 @@ FGControls::FGControls() :
|
|||
vertical_mode( 0 ),
|
||||
lateral_mode( 0 )
|
||||
{
|
||||
globals->set_controls( this );
|
||||
}
|
||||
|
||||
|
||||
|
@ -231,6 +232,7 @@ static inline void _SetRoot( simgear::TiedPropertyList & tiedProperties, const c
|
|||
void
|
||||
FGControls::bind ()
|
||||
{
|
||||
init(); // unfortunately, tie-ing requires init() to have occurred
|
||||
int index, i;
|
||||
|
||||
// flight controls
|
||||
|
@ -648,9 +650,8 @@ void FGControls::unbind ()
|
|||
void
|
||||
FGControls::update (double dt)
|
||||
{
|
||||
SG_UNUSED(dt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Setters and adjusters.
|
||||
|
|
|
@ -677,10 +677,8 @@ void fgCreateSubsystems() {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
// Initialize the controls subsystem.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
globals->get_controls()->init();
|
||||
globals->get_controls()->bind();
|
||||
|
||||
|
||||
globals->add_subsystem("controls", new FGControls);
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Initialize the input subsystem.
|
||||
|
|
|
@ -185,12 +185,6 @@ FGGlobals::~FGGlobals()
|
|||
|
||||
delete ATIS_mgr;
|
||||
|
||||
if (controls)
|
||||
{
|
||||
controls->unbind();
|
||||
delete controls;
|
||||
}
|
||||
|
||||
delete channel_options_list;
|
||||
delete initial_waypoints;
|
||||
delete scenery;
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include <simgear/math/SGMath.hxx>
|
||||
#include <simgear/math/sg_random.h>
|
||||
|
||||
#include <Aircraft/controls.hxx>
|
||||
#include <Model/panelnode.hxx>
|
||||
#include <Scenery/scenery.hxx>
|
||||
#include <Scenery/tilemgr.hxx>
|
||||
|
@ -364,9 +363,6 @@ int fgMainInit( int argc, char **argv ) {
|
|||
// seed the random number generator
|
||||
sg_srandom_time();
|
||||
|
||||
FGControls *controls = new FGControls;
|
||||
globals->set_controls( controls );
|
||||
|
||||
string_list *col = new string_list;
|
||||
globals->set_channel_options_list( col );
|
||||
|
||||
|
|
Loading…
Reference in a new issue