]> git.mxchange.org Git - flightgear.git/commitdiff
Use long int for index instead of just int.
authorcurt <curt>
Fri, 19 Mar 1999 00:27:30 +0000 (00:27 +0000)
committercurt <curt>
Fri, 19 Mar 1999 00:27:30 +0000 (00:27 +0000)
GenAirports/main.cxx
Polygon/index.cxx
Polygon/index.hxx
ShapeFile/shape.cxx

index fbb937dafc3aab6239c46c623b073285aa679bd1..7ad07f6db0b57a750c5152438dd8c450b9dc7393 100644 (file)
@@ -49,7 +49,7 @@
 
 
 // write out airport data
-void write_airport( int p_index, list_container hull_list, FGBucket b, 
+void write_airport( long int p_index, list_container hull_list, FGBucket b, 
                    const string& root, const bool cut_and_keep ) {
     char tile_name[256], poly_index[256];
 
@@ -62,7 +62,7 @@ void write_airport( int p_index, list_container hull_list, FGBucket b,
     sprintf(tile_name, "%ld", b_index);
     string aptfile = path + "/" + tile_name;
 
-    sprintf( poly_index, "%d", p_index );
+    sprintf( poly_index, "%ld", p_index );
     aptfile += ".";
     aptfile += poly_index;
     cout << "apt file = " << aptfile << endl;
@@ -153,8 +153,8 @@ void process_airport( string airport, list < string > & runway_list,
        string rwy_width = rwy_str.substr(43, 4);
        sscanf( rwy_width.c_str(), "%d", &width);
        string rwy_sfc = rwy_str.substr(47, 4);
-       string rwy_end1 = rwy_str.substr(52, 6);
-       string rwy_end2 = rwy_str.substr(59, 6);
+       string rwy_end1 = rwy_str.substr(52, 8);
+       string rwy_end2 = rwy_str.substr(61, 8);
 
        /*
        cout << "  no    = " << rwy_no << endl;
@@ -167,7 +167,7 @@ void process_airport( string airport, list < string > & runway_list,
        cout << "  end1  = " << rwy_end1 << endl;
        cout << "  end2  = " << rwy_end2 << endl;
        */
-       
+
        rwy_list = gen_runway_area( lon, lat, hdg * DEG_TO_RAD, 
                                    (double)len * FEET_TO_METER,
                                    (double)width * FEET_TO_METER );
@@ -197,7 +197,7 @@ void process_airport( string airport, list < string > & runway_list,
     hull_list = convex_hull(apt_list);
 
     // get next polygon index
-    int index = poly_index_next();
+    long int index = poly_index_next();
 
     // find average center, min, and max point of convex hull
     point2d average, min, max;
@@ -241,7 +241,7 @@ void process_airport( string airport, list < string > & runway_list,
        cout << "airport spans tile boundaries" << endl;
        cout << "  dx = " << dx << "  dy = " << dy << endl;
 
-       if ( (dx > 1) || (dy > 1) ) {
+       if ( (dx > 2) || (dy > 2) ) {
            cout << "somethings really wrong!!!!" << endl;
            exit(-1);
        }
@@ -324,7 +324,7 @@ int main( int argc, char **argv ) {
        } else if ( line[0] == 'R' ) {
            // runway entry
            runway_list.push_back(line);
-       } else if ( line == "99" ) {
+       } else if ( line == "[End]" ) {
            // end of file
            break;
        } else {
@@ -344,6 +344,9 @@ int main( int argc, char **argv ) {
 
 
 // $Log$
+// Revision 1.11  1999/03/19 00:27:38  curt
+// Use long int for index instead of just int.
+//
 // Revision 1.10  1999/03/17 23:51:25  curt
 // Changed polygon index counter file.
 //
index a467c0ba6a9c9b6ed11c106b16231c7d5c4bc684..34352aacd187cf8e8fd3a389474895581f8b1175 100644 (file)
@@ -30,7 +30,7 @@
 #include "index.hxx"
 
 
-static int poly_index;
+static long int poly_index;
 static string poly_path;
 
 
@@ -46,14 +46,14 @@ bool poly_index_init( string path ) {
        return false;
     }
 
-    fscanf( fp, "%d", &poly_index );
+    fscanf( fp, "%ld", &poly_index );
 
     fclose( fp );
 }
 
 
 // increment the persistant counter and return the next poly_index
-int poly_index_next() {
+long int poly_index_next() {
     ++poly_index;
 
     FILE *fp = fopen( poly_path.c_str(), "w" );
@@ -62,7 +62,7 @@ int poly_index_next() {
        cout << "Error cannot open " << poly_path << " for writing" << endl;
     }
 
-    fprintf( fp, "%d\n", poly_index );
+    fprintf( fp, "%ld\n", poly_index );
 
     fclose( fp );
 
@@ -71,6 +71,9 @@ int poly_index_next() {
 
 
 // $Log$
+// Revision 1.2  1999/03/19 00:27:30  curt
+// Use long int for index instead of just int.
+//
 // Revision 1.1  1999/02/25 21:30:24  curt
 // Initial revision.
 //
index ddc8acb6f4f027b8ce3aed1f2d6a67fb82ba9cac..0ea6b5c06b3c03c06baed3e434b1576a3553b9bd 100644 (file)
@@ -35,7 +35,7 @@
 bool poly_index_init( string path );
 
 // increment the persistant counter and return the next poly_index
-int poly_index_next();
+long int poly_index_next();
 
 
 
@@ -43,6 +43,9 @@ int poly_index_next();
 
 
 // $Log$
+// Revision 1.2  1999/03/19 00:27:31  curt
+// Use long int for index instead of just int.
+//
 // Revision 1.1  1999/02/25 21:30:24  curt
 // Initial revision.
 //
index ae3e1432f04110ce387baff069e223849d6d0720..badef88238fc820edac252215a2b3890befc50a3 100644 (file)
@@ -44,7 +44,7 @@ public:
 };
 
 
-static void clip_and_write_poly( string root, int p_index, AreaType area, 
+static void clip_and_write_poly( string root, long int p_index, AreaType area, 
                                 FGBucket b, gpc_polygon *shape ) {
     point2d c, min, max;
     c.x = b.get_center_lon();
@@ -115,7 +115,7 @@ static void clip_and_write_poly( string root, int p_index, AreaType area,
        sprintf( tile_name, "%ld", t_index );
        string polyfile = path + "/" + tile_name;
 
-       sprintf( poly_index, "%d", p_index );
+       sprintf( poly_index, "%ld", p_index );
        polyfile += ".";
        polyfile += poly_index;
 
@@ -168,7 +168,7 @@ void add_to_shape(int count, double *coords, gpc_polygon *shape) {
 // process shape (write polygon to all intersecting tiles)
 void process_shape(string path, AreaType area, gpc_polygon *gpc_shape) {
     point2d min, max;
-    int index;
+    long int index;
     int i, j;
 
     min.x = min.y = 200.0;
@@ -244,6 +244,9 @@ void free_shape(gpc_polygon *shape) {
 
 
 // $Log$
+// Revision 1.3  1999/03/19 00:27:41  curt
+// Use long int for index instead of just int.
+//
 // Revision 1.2  1999/02/25 21:31:08  curt
 // First working version???
 //