From 60f7d0f16cb5588ebc609311ec8dfa5b30a54735 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Sun, 15 Aug 2010 20:33:29 +0200 Subject: [PATCH] Downgrade the ridgelift to a subsystem of environment --- src/Environment/environment_mgr.cxx | 9 +++++++++ src/Main/fg_init.cxx | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 4a3fc9606..775e4a32a 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -41,6 +41,7 @@ #include "environment_ctrl.hxx" #include "fgclouds.hxx" #include "precipitation_mgr.hxx" +#include "ridge_lift.hxx" class SGSky; extern SGSky *thesky; @@ -65,10 +66,18 @@ FGEnvironmentMgr::FGEnvironmentMgr () _precipitationManager = new FGPrecipitationMgr; set_subsystem("precipitation", _precipitationManager); + + set_subsystem("ridgelift", new FGRidgeLift); } FGEnvironmentMgr::~FGEnvironmentMgr () { + SGSubsystem * subsys; + + subsys = get_subsystem( "ridgelift" ); + remove_subsystem( "ridgelift" ); + delete subsys; + remove_subsystem("precipitation"); delete _precipitationManager; diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 2db7f32e2..b98d8dbbb 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -109,7 +109,6 @@ #include #include -#include #include "fg_init.hxx" #include "fg_io.hxx" @@ -1349,13 +1348,6 @@ bool fgInitSubsystems() { // Initialize the weather modeling subsystem globals->add_subsystem("environment", new FGEnvironmentMgr); - //////////////////////////////////////////////////////////////////// - // Initialize the ridge lift simulation. - //////////////////////////////////////////////////////////////////// - - // Initialize the ridgelift subsystem - globals->add_subsystem("ridgelift", new FGRidgeLift); - //////////////////////////////////////////////////////////////////// // Initialize the aircraft systems and instrumentation (before the // autopilot.)