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:
parent
8c82fca416
commit
717fdfec39
1 changed files with 5 additions and 2 deletions
|
@ -45,6 +45,7 @@
|
||||||
#include <simgear/scene/model/modellib.hxx>
|
#include <simgear/scene/model/modellib.hxx>
|
||||||
#include <simgear/package/Root.hxx>
|
#include <simgear/package/Root.hxx>
|
||||||
|
|
||||||
|
#include <Add-ons/AddonResourceProvider.hxx>
|
||||||
#include <Aircraft/controls.hxx>
|
#include <Aircraft/controls.hxx>
|
||||||
#include <Airports/runways.hxx>
|
#include <Airports/runways.hxx>
|
||||||
#include <Autopilot/route_mgr.hxx>
|
#include <Autopilot/route_mgr.hxx>
|
||||||
|
@ -166,8 +167,10 @@ FGGlobals::FGGlobals() :
|
||||||
props = SGPropertyNode_ptr(root);
|
props = SGPropertyNode_ptr(root);
|
||||||
locale = new FGLocale(props);
|
locale = new FGLocale(props);
|
||||||
|
|
||||||
simgear::ResourceManager::instance()->addProvider(new AircraftResourceProvider);
|
auto resMgr = simgear::ResourceManager::instance();
|
||||||
simgear::ResourceManager::instance()->addProvider(new CurrentAircraftDirProvider);
|
resMgr->addProvider(new AircraftResourceProvider());
|
||||||
|
resMgr->addProvider(new CurrentAircraftDirProvider());
|
||||||
|
resMgr->addProvider(new flightgear::addons::ResourceProvider());
|
||||||
initProperties();
|
initProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue