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/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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue