From: david Date: Wed, 31 Jul 2002 18:44:30 +0000 (+0000) Subject: Patch from Dave Luff: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4cb99e05ad8e0d8551e8e9adbe23f061c71fef39;p=flightgear.git Patch from Dave Luff: 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! --- diff --git a/src/Objects/newmat.cxx b/src/Objects/newmat.cxx index 1966b9ecf..270099830 100644 --- a/src/Objects/newmat.cxx +++ b/src/Objects/newmat.cxx @@ -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};