]> git.mxchange.org Git - flightgear.git/commitdiff
Update fix management code to read Robin's native fix.dat format.
authorcurt <curt>
Wed, 26 May 2004 16:40:27 +0000 (16:40 +0000)
committercurt <curt>
Wed, 26 May 2004 16:40:27 +0000 (16:40 +0000)
src/Main/fg_init.cxx
src/Navaids/fix.hxx
src/Navaids/fixlist.cxx

index 2cbb434d8a202e178d7dc7bf080017d2ae3317cf..33a85f244664bbbccd2b8ecc095c48ce8dca144d 100644 (file)
@@ -1065,7 +1065,7 @@ fgInitNav ()
     SG_LOG(SG_GENERAL, SG_INFO, "  Fixes");
     current_fixlist = new FGFixList;
     SGPath p_fix( globals->get_fg_root() );
-    p_fix.append( "Navaids/default.fix" );
+    p_fix.append( "Navaids/fix.dat" );
     current_fixlist->init( p_fix );
 
     return true;
index f21dc144307931be430f03d9b038fb8aad8b254c..e50bc2761fecfeafa826bc6d5d5a61168085f12c 100644 (file)
@@ -45,6 +45,9 @@ SG_USING_STD(istream);
 #include STL_STRING
 SG_USING_STD(string);
 
+// SG_USING_STD(cout);
+// SG_USING_STD(endl);
+
 
 class FGFix {
 
@@ -76,12 +79,12 @@ FGFix::FGFix()
 inline istream&
 operator >> ( istream& in, FGFix& f )
 {
-    in >> f.ident;
+    in >> f.lat;
 
-    if ( f.ident[0] == '[' )
+    if ( f.lat > 95.0 ) {
         return in >> skipeol;
-
-    in >> f.lat >> f.lon;
+    }
+    in >> f.lon >> f.ident;
 
     // cout << "id = " << f.ident << endl;
 
index 31537e1d2b3dd898cd916a14fa64f5fb93a3255c..b4548a66d74cd27cd0aa1954c3c567046fe7940b 100644 (file)
@@ -56,10 +56,11 @@ bool FGFixList::init( SGPath path ) {
         exit(-1);
     }
 
-    // read in each line of the file
-
+    // toss the first two lines of the file
+    in >> skipeol;
     in >> skipeol;
-    in >> skipcomment;
+
+    // read in each remaining line of the file
 
 #ifdef __MWERKS__
     char c = 0;
@@ -71,7 +72,7 @@ bool FGFixList::init( SGPath path ) {
 
         FGFix fix;
         in >> fix;
-        if ( fix.get_ident() == "[End]" ) {
+        if ( fix.get_lat() > 95.0 ) {
             break;
         }