#include <simgear/scene/material/Effect.hxx>
#include <simgear/scene/model/particles.hxx>
#include <simgear/scene/tsync/terrasync.hxx>
+#include <simgear/scene/tgdb/userdata.hxx>
#include <simgear/package/Root.hxx>
#include <simgear/package/Package.hxx>
fgSetBool("/sim/startup/stdout-to-terminal", isatty(1) != 0 );
fgSetBool("/sim/startup/stderr-to-terminal", isatty(2) != 0 );
+
+ sgUserDataInit( globals->get_props() );
+
return true;
}
}
// may exist already due to GUI startup
- if (!globals->get_subsystem("http")) {
- globals->add_subsystem( "http", new FGHTTPClient );
+ if (!globals->get_subsystem<FGHTTPClient>()) {
+ globals->add_new_subsystem<FGHTTPClient>();
}
////////////////////////////////////////////////////////////////////
render->getViewer()->getDatabasePager()->clear();
osgDB::Registry::instance()->clearObjectCache();
-
+ // Pager requests depend on this, so don't clear it until now
+ sgUserDataInit( NULL );
+
// preserve the event handler; re-creating it would entail fixing the
// idle handler
osg::ref_ptr<flightgear::FGEventHandler> eventHandler = render->getEventHandler();
render->init();
render->setViewer(viewer.get());
+ sgUserDataInit( globals->get_props() );
+
viewer->getDatabasePager()->setUpThreads(1, 1);
// must do this before splashinit for Rembrandt
if (globals->packageRoot()) {
return;
}
-
- SGPath packageAircraftDir = flightgear::defaultDownloadDir();
+
+ SGPath packageAircraftDir = flightgear::Options::sharedInstance()->valueForOption("download-dir");
+ if (packageAircraftDir.isNull()) {
+ packageAircraftDir = flightgear::defaultDownloadDir();
+ }
+
packageAircraftDir.append("Aircraft");
+ SG_LOG(SG_GENERAL, SG_INFO, "init package root at:" << packageAircraftDir.str());
+
+
SGSharedPtr<Root> pkgRoot(new Root(packageAircraftDir, FLIGHTGEAR_VERSION));
// set the http client later (too early in startup right now)
globals->setPackageRoot(pkgRoot);