From ac27ead4a65b5c4059454d6d7b96ae1b0388abf8 Mon Sep 17 00:00:00 2001 From: ehofman Date: Wed, 8 Dec 2004 14:45:47 +0000 Subject: [PATCH] Melchior FRANZ: 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index 310e8fb07..e294e9f01 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -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; -- 2.39.5