{
osg::Texture2D* texture = _textureMap[relativePath].get();
if (texture == 0) {
- SG_LOG( SG_COCKPIT, SG_DEBUG,
- "Texture " << relativePath << " does not yet exist" );
- SGPath tpath(globals->get_fg_root());
- tpath.append(relativePath);
-
+ SGPath tpath = globals->resolve_aircraft_path(relativePath);
texture = SGLoadTexture2D(staticTexture, tpath);
_textureMap[relativePath] = texture;
// implementation is an AI model and depends on that
globals->get_multiplayer_mgr()->Update();
-#if ENABLE_ATCDCL
+#if ENABLE_ATCDCL
// Run ATC subsystem
if (fgGetBool("/sim/atc/enabled"))
globals->get_ATC_mgr()->update(delta_time_sec);
SG_LOG ( SG_GENERAL, SG_INFO, "Depth buffer bits = " << tmp );
}
};
+
+
+osg::Node* load_panel(SGPropertyNode *n)
+{
+ osg::Geode* geode = new osg::Geode;
+ geode->addDrawable(new FGPanelNode(n));
+ return geode;
+}
+
+SGPath resolve_path(const std::string& s)
+{
+ return globals->resolve_maybe_aircraft_path(s);
+}
+
}
// This is the top level master main function that is registered as
////////////////////////////////////////////////////////////////////
globals->set_matlib( new SGMaterialLib );
simgear::SGModelLib::init(globals->get_fg_root());
-
-
+ simgear::SGModelLib::setPropRoot(globals->get_props());
+ simgear::SGModelLib::setResolveFunc(resolve_path);
+ simgear::SGModelLib::setPanelFunc(load_panel);
+
////////////////////////////////////////////////////////////////////
// Initialize the TG scenery subsystem.
////////////////////////////////////////////////////////////////////
using std::vector;
using namespace simgear;
-
-static
-osg::Node* load_panel(SGPropertyNode *n)
-{
- osg::Geode* geode = new osg::Geode;
- geode->addDrawable(new FGPanelNode(n));
- return geode;
-}
-
\f
////////////////////////////////////////////////////////////////////////
// Global functions.
osg::Node *
fgLoad3DModelPanel(const string &path, SGPropertyNode *prop_root)
{
- osg::Node* node = SGModelLib::loadModel(path, prop_root, load_panel);
+ osg::Node* node = SGModelLib::loadModel(path, prop_root);
if (node)
node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
return node;