I have sent a patch to David about the incorrect path but have not heard
about it yet.

The proposed patch was :

I noticed that textures for scenery static objects are not loaded anymore
for a few weeks.
Static objects have absolute path while random objects and aircraft have
relative path
but fgLoad3DModel unconditionally prepend fg_root to the model path. This
patch test
the beginning of the model path to choose if fg_root has to be prepended to
the model
path.


D:\FlightGear\cvs\FlightGear\src\Model>cvs -z3 -q diff -u model.cxx
Index: model.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.7/FlightGear/src/Model/model.cxx,v
retrieving revision 1.20
diff -u -r1.20 model.cxx
--- model.cxx   6 Aug 2002 23:34:50 -0000       1.20
+++ model.cxx   7 Sep 2002 19:30:24 -0000
@@ -229,9 +229,15 @@
   SGPropertyNode props;

                                 // Load the 3D aircraft object itself
-  SGPath xmlpath = globals->get_fg_root();
+  SGPath xmlpath;
   SGPath modelpath = path;
-  xmlpath.append(modelpath.str());
+  if ( path[ 0 ] == '/' || path[ 0 ] == '\\' || ( isalpha( path[ 0 ] ) &&
path[ 1 ] == ':' ) ) {
+    xmlpath = modelpath;
+  }
+  else {
+    xmlpath = globals->get_fg_root();
+    xmlpath.append(modelpath.str());
+  }

                                 // Check for an XML wrapper
   if (xmlpath.str().substr(xmlpath.str().size() - 4, 4) == ".xml") {

Cheers,

-Fred


----- Original Message -----
From: "Bernie Bright" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 20, 2002 8:50 AM
Subject: [Flightgear-devel] Loading static object problems.


> I'm writing a plib loader for XPlane custom objects and have been testing
it within FlightGear and have noticed a couple of problems.
>
> Firstly, if the object is not found then fgLoad3DModel() throws an
uncaught exception.  Adding a try/catch block to FGTileMgr::update()
prevents FlightGear from exiting, see the attached diff.
>
> Secondly, the texture path is set twice.  Once in FGTileMgr::update() and
again in fgLoad3DModel().  The path set in fgLoad3DModel() is incorrect - it
contains two instances of $FG_ROOT.  For the moment I've commented out this
call to ssgTexturePath() but I'm not entirely sure if this correct in all
cases.
>
> Bernie
>
>


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to