- move fg_init/parseWaypoints() to route_mgr/postinit()
- don't delete initial string list to keep it available for subsystem reinit
#include <FDM/flight.hxx>
#include <Main/fg_props.hxx>
#include <FDM/flight.hxx>
#include <Main/fg_props.hxx>
+#include "auto_gui.hxx" // FIXME temporary dependency (NewWaypoint)
+void FGRouteMgr::postinit() {
+ string_list *waypoints = globals->get_initial_waypoints();
+ if (!waypoints)
+ return;
+
+ vector<string>::iterator it;
+ for (it = waypoints->begin(); it != waypoints->end(); ++it)
+ NewWaypoint(*it);
+}
+
+
void FGRouteMgr::bind() { }
void FGRouteMgr::unbind() { }
void FGRouteMgr::bind() { }
void FGRouteMgr::unbind() { }
~FGRouteMgr();
void init ();
~FGRouteMgr();
void init ();
void bind ();
void unbind ();
void update (double dt);
void bind ();
void unbind ();
void update (double dt);
-
-static void parseWaypoints() {
- string_list *waypoints = globals->get_initial_waypoints();
- if (waypoints) {
- vector<string>::iterator i;
- for (i = waypoints->begin();
- i != waypoints->end();
- i++)
- {
- NewWaypoint(*i);
- }
- // Now were done using the way points we can deallocate the
- // memory they used
- while (waypoints->begin() != waypoints->end()) {
- waypoints->pop_back();
- }
- delete waypoints;
- globals->set_initial_waypoints(0);
- }
-}
-
-
-
globals->add_subsystem("nasal", nasal);
nasal->init();
globals->add_subsystem("nasal", nasal);
nasal->init();
- ////////////////////////////////////////////////////////////////////
- // At this point we could try and parse the waypoint options
- ///////////////////////////////////////////////////////////////////
- parseWaypoints();
-
// initialize methods that depend on other subsystems.
globals->get_subsystem_mgr()->postinit();
// initialize methods that depend on other subsystems.
globals->get_subsystem_mgr()->postinit();