]> git.mxchange.org Git - flightgear.git/blobdiff - Airports/genapt.cxx
Tweaks for building with native SGI compilers.
[flightgear.git] / Airports / genapt.cxx
index 4ef94cf70dbe394c57914fcfe54681ad4e3d20a0..b8400997466ae7e4a529e7d8bd085aef26980210 100644 (file)
@@ -1,5 +1,5 @@
 //
-// getapt.cxx -- generate airport scenery from the given definition file
+// genapt.cxx -- generate airport scenery from the given definition file
 //
 // Written by Curtis Olson, started September 1998.
 //
 // (Log is kept at end of this file)
 
 
-#include <string>        // Standard C++ string library
+#include <Include/compiler.h>
+
+#include STL_STRING
 #include <vector>
-#include "Include/fg_stl_config.h"
 
-#ifdef NEEDNAMESPACESTD
-using namespace std;
+#ifdef __BORLANDC__
+#  define exception c_exception
+#endif
+#include <math.h>
+
+#ifdef FG_HAVE_NATIVE_SGI_COMPILERS
+#  include <strings.h>
 #endif
 
 #include <Debug/logstream.hxx>
@@ -44,6 +50,9 @@ using namespace std;
 
 #include "genapt.hxx"
 
+FG_USING_STD(string);
+FG_USING_STD(vector);
+
 
 typedef vector < Point3D > container;
 typedef container::iterator iterator;
@@ -144,7 +153,7 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
 
     i = 1;
     tex = calc_tex_coords( t->nodes[i], t->center );
-    dist = cart.distance3D(average);
+    dist = cart.distance3Dsquared(average);
     if ( dist > max_dist ) {
        max_dist = dist;
     }
@@ -164,7 +173,7 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
        fragment.add_face(center_num, i - 1, i);
 
        tex = calc_tex_coords( t->nodes[i], t->center );
-       dist = cart.distance3D(average);
+       dist = cart.distance3Dsquared(average);
        if ( dist > max_dist ) {
            max_dist = dist;
        }
@@ -186,7 +195,7 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
     xglEnd();
     xglEndList();
 
-    fragment.bounding_radius = max_dist;
+    fragment.bounding_radius = sqrt(max_dist);
     fragment.display_list = display_list;
 
     t->fragment_list.push_back(fragment);
@@ -230,7 +239,7 @@ fgAptGenerate(const string& path, fgTILE *tile)
        if ( token == "a" ) {
            // airport info record (start of airport)
 
-           if ( apt_id != "" ) {
+           if ( apt_id.length() > 0 ) {
                // we have just finished reading and airport record.
                // process the info
                gen_base(average, perimeter, tile);
@@ -269,7 +278,7 @@ fgAptGenerate(const string& path, fgTILE *tile)
        in >> skipcomment;
     }
 
-    if ( apt_id != "" ) {
+    if ( apt_id.length() > 0 ) {
        // we have just finished reading and airport record.
        // process the info
        size = perimeter.size();
@@ -285,6 +294,18 @@ fgAptGenerate(const string& path, fgTILE *tile)
 
 
 // $Log$
+// Revision 1.14  1999/03/02 01:02:31  curt
+// Tweaks for building with native SGI compilers.
+//
+// Revision 1.13  1999/02/26 22:08:34  curt
+// Added initial support for native SGI compilers.
+//
+// Revision 1.12  1999/02/01 21:08:33  curt
+// Optimizations from Norman Vine.
+//
+// Revision 1.11  1998/11/23 21:48:09  curt
+// Borland portability tweaks.
+//
 // Revision 1.10  1998/11/07 19:07:06  curt
 // Enable release builds using the --without-logging option to the configure
 // script.  Also a couple log message cleanups, plus some C to C++ comment
@@ -322,5 +343,3 @@ fgAptGenerate(const string& path, fgTILE *tile)
 // Revision 1.1  1998/09/14 02:14:01  curt
 // Initial revision of genapt.[ch]xx for generating airport scenery.
 //
-//
-