]> git.mxchange.org Git - flightgear.git/commitdiff
Frederic Bouvier:
authorehofman <ehofman>
Sat, 13 Sep 2003 11:47:30 +0000 (11:47 +0000)
committerehofman <ehofman>
Sat, 13 Sep 2003 11:47:30 +0000 (11:47 +0000)
This patch is there to correct a problem that prevent to load static objects when specifying a relative fg-root or a different, relative, fg-scenery. It appears that there is a mix between fg-root, fg-scenery and PLIB's model-dir.
It has been reported on the list that users are not able to see the buildings, especially those running the win32 builds because they run 'runfgfs.bat' that set FG_ROOT=./DATA.

I decided not to use model-dir because it just add confusion and to build a valid path earlier.

src/Main/main.cxx
src/Model/model_panel.cxx
src/Scenery/tileentry.cxx
src/Scenery/tilemgr.cxx

index 947f495a02855e300ccad9267d8d0058660a469c..4f2947fbd654495e075b629d21bd620c6165de80 100644 (file)
@@ -1676,9 +1676,6 @@ bool fgMainInit( int argc, char **argv ) {
         exit(-1);
     }
 
-    SGPath modelpath( globals->get_fg_root() );
-    ssgModelPath( (char *)modelpath.c_str() );
-
     ////////////////////////////////////////////////////////////////////
     // Initialize the property-based built-in commands
     ////////////////////////////////////////////////////////////////////
index 3c197f661018faed7e1e359600088ca9352002cc..492b39d29b1249541bdd9e223697cd7040ac7bbd 100644 (file)
@@ -49,19 +49,16 @@ fgLoad3DModelPanel( const string &fg_root, const string &path,
   SGPropertyNode props;
 
                                 // Load the 3D aircraft object itself
-  SGPath xmlpath;
   SGPath modelpath = path;
-  if ( ulIsAbsolutePathName( path.c_str() ) ) {
-    xmlpath = modelpath;
-  }
-  else {
-    xmlpath = fg_root;
-    xmlpath.append(modelpath.str());
+  if ( !ulIsAbsolutePathName( path.c_str() ) ) {
+    SGPath tmp = fg_root;
+    tmp.append(modelpath.str());
+    modelpath = tmp;
   }
 
                                 // Check for an XML wrapper
-  if (xmlpath.str().substr(xmlpath.str().size() - 4, 4) == ".xml") {
-    readProperties(xmlpath.str(), &props);
+  if (modelpath.str().substr(modelpath.str().size() - 4, 4) == ".xml") {
+    readProperties(modelpath.str(), &props);
     if (props.hasValue("/path")) {
       modelpath = modelpath.dir();
       modelpath.append(props.getStringValue("/path"));
@@ -74,7 +71,7 @@ fgLoad3DModelPanel( const string &fg_root, const string &path,
                                 // Assume that textures are in
                                 // the same location as the XML file.
   if (model == 0) {
-    ssgTexturePath((char *)xmlpath.dir().c_str());
+    ssgTexturePath((char *)modelpath.dir().c_str());
     model = (ssgBranch *)ssgLoad((char *)modelpath.c_str());
     if (model == 0)
       throw sg_exception("Failed to load 3D model");
index a22102219b8ba4da4e38110cfb3dc4c39bdb64cf..c9371972e91ba0f484f3d989b9cc940a5cce8c06 100644 (file)
@@ -676,6 +676,8 @@ FGTileEntry::load( const string &base_path, bool is_base )
                     SGPath custom_path;
                     if ( token == "OBJECT_STATIC" ) {
                         custom_path= tile_path;
+                    } else {
+                        custom_path = globals->get_fg_root();
                     }
                     custom_path.append( name );
 
index f6306678eb4cded62e953c21e4b154d7d06cdffb..f1046c5524494a40d80c43110fbbabacb947b7b7 100644 (file)
@@ -280,7 +280,7 @@ void FGTileMgr::update_queues()
         try
         {
             ssgEntity *obj_model =
-                globals->get_model_lib()->load_model( globals->get_fg_root(),
+                globals->get_model_lib()->load_model( ".",
                                                       dm->get_model_path(),
                                                       globals->get_props(),
                                                       globals->get_sim_time_sec() );