]> git.mxchange.org Git - simgear.git/commitdiff
Allow "texture-path" XML entries to be present but empty.
authorThorstenB <brehmt@gmail.com>
Mon, 30 Apr 2012 16:29:44 +0000 (18:29 +0200)
committerThorstenB <brehmt@gmail.com>
Mon, 30 Apr 2012 16:29:44 +0000 (18:29 +0200)
This had worked with previous FG versions and is used by many models -
so it shouldn't be treated as an error now.

simgear/scene/model/SGReaderWriterXML.cxx

index 50943dcd9e48b00a1a0f9f66e778ae4be6bbc188..5a4356bb05c539eef0b0017eca37453d2b95bd89 100644 (file)
@@ -247,10 +247,13 @@ sgLoad3DModel_internal(const SGPath& path,
 
             if (props->hasValue("/texture-path")) {
                 string texturePathStr = props->getStringValue("/texture-path");
-                texturepath = SGModelLib::findDataFile(texturePathStr, NULL, modelDir);
-                if (texturepath.isNull())
-                    throw sg_io_exception("Texture file not found: '" + texturePathStr + "'",
-                            path.str());
+                if (!texturePathStr.empty())
+                {
+                    texturepath = SGModelLib::findDataFile(texturePathStr, NULL, modelDir);
+                    if (texturepath.isNull())
+                        throw sg_io_exception("Texture file not found: '" + texturePathStr + "'",
+                                path.str());
+                }
             }
         } else {
             model = new osg::Node;