// $Id$
+#include <simgear/sound/soundmgr_openal.hxx>
#include <simgear/structure/commands.hxx>
#include <simgear/misc/sg_path.hxx>
time_params( NULL ),
ephem( NULL ),
mag( NULL ),
- autopilot( NULL ),
- route( NULL ),
+ route_mgr( NULL ),
current_panel( NULL ),
soundmgr( NULL ),
airports( NULL ),
acmodel( NULL ),
model_mgr( NULL ),
channel_options_list( NULL ),
+ initial_waypoints(0),
scenery( NULL ),
tile_mgr( NULL ),
- io( new FGIO )
+ io( new FGIO ),
+ navlist( NULL ),
+ loclist( NULL ),
+ gslist( NULL ),
+ dmelist( NULL ),
+ mkrlist( NULL ),
+ fixlist( NULL )
{
}
// Destructor
FGGlobals::~FGGlobals()
{
- delete subsystem_mgr;
- delete event_mgr;
- delete initial_state;
- delete props;
- delete commands;
- delete io;
+ delete soundmgr;
+ delete subsystem_mgr;
+ delete event_mgr;
+ delete initial_state;
+ delete props;
+ delete commands;
+ delete io;
+
+ // make sure only to delete the initial waypoints list if it acually
+ // still exists.
+ if (initial_waypoints)
+ delete initial_waypoints;
}
}
}
+void FGGlobals::set_fg_scenery (const string &scenery) {
+
+ if (scenery.empty())
+ return;
+
+ SGPath pt( scenery ), po( scenery );
+ pt.append("Terrain");
+ po.append("Objects");
+
+cout << "pt: " << pt.str() << endl;
+cout << "po: " << po.str() << endl;
+ ulDir *td = ulOpenDir(pt.c_str());
+ ulDir *od = ulOpenDir(po.c_str());
+
+ if (td == NULL) {
+ if (od == NULL) {
+ fg_scenery = scenery;
+ } else {
+ fg_scenery = po.str();
+ ulCloseDir(od);
+ }
+ } else {
+ if (od != NULL) {
+ pt.add(po.str());
+ ulCloseDir(od);
+ }
+ fg_scenery = pt.str();
+ ulCloseDir(td);
+ }
+cout << "fg_scenery: " << fg_scenery << endl;
+}
+
SGSubsystemMgr *
FGGlobals::get_subsystem_mgr () const