]> git.mxchange.org Git - flightgear.git/commitdiff
Melchior FRANZ:
authorehofman <ehofman>
Wed, 8 Dec 2004 14:45:47 +0000 (14:45 +0000)
committerehofman <ehofman>
Wed, 8 Dec 2004 14:45:47 +0000 (14:45 +0000)
The attached patch allows to put comments in *.stg files[1]. Lines with
# in the first column (and only there!) are skipped. This has no effect
on overall performance, but has two advantages:

A) possibility to temporarily comment out objects during scenery design,
   (or to put other remarks there);

B) possibility to put marks like "# BEGIN" and "# END" there that allow
   automated merging of local landmarks etc.

--

[1] actually, comments are possible now, too. But they aren't explicitly
    handled and fgfs tries to parse words in "comments" piece by piece. Ugly!

[2] Idea by Chris METZLER, that I make already use of. I have a local
    scenery dir for some tiles with extra objects, such as VOR/DME for
    all of Austria. These are surrounded by "# BEGIN LOCAL" and "# END LOCAL",
    and today I was able to merge the new 0.9.7 scenery with my locally
    changed files.   :-)

src/Scenery/tileentry.cxx

index 310e8fb07e58346fa88decf1d3f76f4c4c1eb233..e294e9f015730aa1255e7a65389d6a872804009c 100644 (file)
@@ -702,6 +702,10 @@ FGTileEntry::load( const string_list &path_list, bool is_base )
             while ( ! in.eof() ) {
                 in >> token;
 
+                if ( token[0] == '#' ) {
+                   in >> ::skipeol;
+                   continue;
+                }
                                 // Load only once (first found)
                 if ( token == "OBJECT_BASE" ) {
                     in >> name >> ::skipws;