Patch from Frederic Bouvier:
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.
This commit is contained in:
parent
76cda01641
commit
b66a6c75b3
1 changed files with 8 additions and 2 deletions
|
@ -229,9 +229,15 @@ fgLoad3DModel (const string &path)
|
||||||
SGPropertyNode props;
|
SGPropertyNode props;
|
||||||
|
|
||||||
// Load the 3D aircraft object itself
|
// Load the 3D aircraft object itself
|
||||||
SGPath xmlpath = globals->get_fg_root();
|
SGPath xmlpath;
|
||||||
SGPath modelpath = path;
|
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
|
// Check for an XML wrapper
|
||||||
if (xmlpath.str().substr(xmlpath.str().size() - 4, 4) == ".xml") {
|
if (xmlpath.str().substr(xmlpath.str().size() - 4, 4) == ".xml") {
|
||||||
|
|
Loading…
Add table
Reference in a new issue