]> git.mxchange.org Git - flightgear.git/commitdiff
Patch from Dave Luff:
authordavid <david>
Wed, 31 Jul 2002 18:44:30 +0000 (18:44 +0000)
committerdavid <david>
Wed, 31 Jul 2002 18:44:30 +0000 (18:44 +0000)
Your 3D models cause a stackdump when the base is separate from the
root.  I've attached a patched newmat.cxx - you may want to test it
before committing!

src/Objects/newmat.cxx

index 1966b9ecf7e0e4a429953a71450a145b3dfff194..2700998303d460775b98d8bed5ead91417b01b8e 100644 (file)
@@ -153,11 +153,20 @@ FGNewMat::Object::load_models () const
 {
                                // Load model only on demand
   if (!_models_loaded) {
-    for (unsigned int i = 0; i < _paths.size(); i++) {
+    for (int i = 0; i < _paths.size(); i++) {
+
+// Original
+//      SGPath path = globals->get_fg_root();
+//      path.append(_paths[i]);
+//      ssgTexturePath((char *)path.dir().c_str());
+//      ssgEntity * entity = load_object((char *)path.c_str());
+
+// DCL
       SGPath path = globals->get_fg_root();
+      SGPath modelPath = _paths[i];
       path.append(_paths[i]);
       ssgTexturePath((char *)path.dir().c_str());
-      ssgEntity * entity = load_object((char *)path.c_str());
+      ssgEntity * entity = load_object((char *)modelPath.c_str());
       if (entity != 0) {
         // entity->ref();
        float ranges[] = {0, _range_m};