]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/tgdb/apt_signs.cxx
Logging: quiet down STG parsing.
[simgear.git] / simgear / scene / tgdb / apt_signs.cxx
index 34d61c1213522547d28de0a8917fa6828b5892a1..83529475731634bd116ba849b18ed231357b683e 100644 (file)
@@ -106,10 +106,6 @@ SGMakeSign(SGMaterialLib *matlib, const string& path, const string& content)
     osg::Group* object = new osg::Group;
     object->setName(content);
 
-    SGMaterial *material;
-    Effect *lighted_state;
-    Effect *unlighted_state;
-
     // Part I: parse & measure
     for (const char *s = content.data(); *s; s++) {
         string name;
@@ -219,26 +215,30 @@ SGMakeSign(SGMaterialLib *matlib, const string& path, const string& content)
             }
         }
 
-        if (newmat.size()) {
-            material = matlib->find(newmat);
-            if (!material) {
-                SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "ignoring unknown material `" << newmat << '\'');
-                continue;
-            }
 
-            // set material states (lighted & unlighted)
-            lighted_state = material->get_effect();
-            string u = newmat + ".unlighted";
+        if (newmat.size() == 0 )
+          continue;
 
-            SGMaterial *m = matlib->find(u);
-            if (m) {
-                unlighted_state = m->get_effect();
-            } else {
-                SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "ignoring unknown material `" << u << '\'');
-                unlighted_state = lighted_state;
-            }
-            newmat = "";
+        SGMaterial *material = matlib->find(newmat);
+        if (!material) {
+            SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "ignoring unknown material `" << newmat << '\'');
+            continue;
+        }
+
+
+        // set material states (lighted & unlighted)
+        Effect *lighted_state = material->get_effect();
+        Effect *unlighted_state;
+        string u = newmat + ".unlighted";
+
+        SGMaterial *m = matlib->find(u);
+        if (m) {
+            unlighted_state = m->get_effect();
+        } else {
+            SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "ignoring unknown material `" << u << '\'');
+            unlighted_state = lighted_state;
         }
+        newmat = "";
 
         SGMaterialGlyph *glyph = material->get_glyph(name);
         if (!glyph) {