]> git.mxchange.org Git - simgear.git/commitdiff
Runway signs: avoid adding empty group without signs.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Mon, 21 May 2012 05:18:55 +0000 (07:18 +0200)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Mon, 21 May 2012 05:25:14 +0000 (07:25 +0200)
simgear/scene/tgdb/ReaderWriterSTG.cxx
simgear/scene/tgdb/apt_signs.cxx

index 9e317a5ed8e522a4a51856c5d0c8446744994599..44a2296ff4b694b1e0da305a238abc78291e8d72 100644 (file)
@@ -269,8 +269,7 @@ ReaderWriterSTG::readStgFile(const std::string& absoluteFileName,
                 }
                 
             } else if ( token == "OBJECT_SIGN" ) {
-                //node = SGMakeSign(staticOptions->getMaterialLib(), name);
-              signBuilder.addSign(SGGeod::fromDegM(lon, lat, elev), hdg, name);
+                signBuilder.addSign(SGGeod::fromDegM(lon, lat, elev), hdg, name);
             } else {
                 SG_LOG( SG_TERRAIN, SG_ALERT, absoluteFileName
                         << ": Unknown token '" << token << "'" );
@@ -311,7 +310,8 @@ ReaderWriterSTG::readStgFile(const std::string& absoluteFileName,
         in >> ::skipeol;
     }
   
-    group.addChild(signBuilder.getSignsGroup());
+    if (signBuilder.getSignsGroup())
+        group.addChild(signBuilder.getSignsGroup());
 
     return has_base;
 }
index cfcd1aeb1e889820d3ed844c880094aad5b7f83f..8dc4a7371cab52530eb383a8b6b8e782afc07ab7 100644 (file)
@@ -261,6 +261,8 @@ AirportSignBuilder::AirportSignBuilder(SGMaterialLib* mats, const SGGeod& center
 
 osg::Node* AirportSignBuilder::getSignsGroup()
 {
+    if (0 == d->signsGroup->getNumChildren())
+        return 0;
     return d->signsGroup;
 }