1
0
Fork 0

Add-ons: register the add-on ResourceProvider with the simgear::ResourceManager

This makes it possible to look up files from add-on directories using
for instance FGGlobals::resolve_resource_path(), passing a string such
as "[addon=ADDON_ID]relative/path" as explained in the previous commit.
This commit is contained in:
Florent Rougon 2018-01-10 00:27:53 +01:00
parent 8c82fca416
commit 717fdfec39

View file

@ -45,6 +45,7 @@
#include <simgear/scene/model/modellib.hxx>
#include <simgear/package/Root.hxx>
#include <Add-ons/AddonResourceProvider.hxx>
#include <Aircraft/controls.hxx>
#include <Airports/runways.hxx>
#include <Autopilot/route_mgr.hxx>
@ -166,8 +167,10 @@ FGGlobals::FGGlobals() :
props = SGPropertyNode_ptr(root);
locale = new FGLocale(props);
simgear::ResourceManager::instance()->addProvider(new AircraftResourceProvider);
simgear::ResourceManager::instance()->addProvider(new CurrentAircraftDirProvider);
auto resMgr = simgear::ResourceManager::instance();
resMgr->addProvider(new AircraftResourceProvider());
resMgr->addProvider(new CurrentAircraftDirProvider());
resMgr->addProvider(new flightgear::addons::ResourceProvider());
initProperties();
}