Compare commits
7 Commits
RELEASE_0_
...
RELEASE_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb882a1239 | ||
|
|
6b2bf2fa8e | ||
|
|
2640b43355 | ||
|
|
d201e9b5c5 | ||
|
|
8f0f79506c | ||
|
|
121d2f92cb | ||
|
|
87e641aeda |
@@ -28,6 +28,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <Misc/fgpath.hxx>
|
||||
|
||||
#include "newbucket.hxx"
|
||||
|
||||
@@ -38,6 +38,13 @@
|
||||
# include <iostream.h>
|
||||
#endif
|
||||
|
||||
// I don't understand ... <math.h> or <cmath> should be included
|
||||
// already depending on how you defined FG_HAVE_STD_INCLUDES, but I
|
||||
// can go ahead and add this -- CLO
|
||||
#ifdef __MWERKS__
|
||||
# include <math.h> // needed fabs()
|
||||
#endif
|
||||
|
||||
#include STL_STRING
|
||||
|
||||
FG_USING_STD(string);
|
||||
@@ -282,18 +289,18 @@ inline double FGBucket::get_center_lon() const {
|
||||
}
|
||||
|
||||
|
||||
// return width of the tile
|
||||
inline double FGBucket::get_width() const {
|
||||
return bucket_span( get_center_lat() );
|
||||
}
|
||||
|
||||
|
||||
// return the center lat of a tile
|
||||
inline double FGBucket::get_center_lat() const {
|
||||
return lat + y / 8.0 + FG_HALF_BUCKET_SPAN;
|
||||
}
|
||||
|
||||
|
||||
// return width of the tile
|
||||
inline double FGBucket::get_width() const {
|
||||
return bucket_span( get_center_lat() );
|
||||
}
|
||||
|
||||
|
||||
// return height of the tile
|
||||
inline double FGBucket::get_height() const {
|
||||
return FG_BUCKET_SPAN;
|
||||
|
||||
@@ -48,6 +48,8 @@ FG_USING_STD(endl);
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
# define cerr std::cerr and
|
||||
# define endl std::endl
|
||||
FG_USING_STD(iostream);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#include <Debug/logstream.hxx>
|
||||
#include <Include/fg_constants.h>
|
||||
#include <Math/fg_geodesy.hxx>
|
||||
#include <Math/point3d.hxx>
|
||||
@@ -67,7 +68,7 @@ void fgGeocToGeod( double lat_geoc, double radius, double
|
||||
|
||||
// check for domain error
|
||||
if ( errno == EDOM ) {
|
||||
cout << "Domain ERROR in fgGeocToGeod!!!!\n";
|
||||
FG_LOG( FG_GENERAL, FG_ALERT, "Domain ERROR in fgGeocToGeod!!!!" );
|
||||
*alt = 0.0;
|
||||
}
|
||||
|
||||
@@ -83,7 +84,7 @@ void fgGeocToGeod( double lat_geoc, double radius, double
|
||||
|
||||
// check for domain error
|
||||
if ( errno == EDOM ) {
|
||||
cout << "Domain ERROR in fgGeocToGeod!!!!\n";
|
||||
FG_LOG( FG_GENERAL, FG_ALERT, "Domain ERROR in fgGeocToGeod!!!!" );
|
||||
*sea_level_r = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,13 @@
|
||||
# include <math.h>
|
||||
#endif
|
||||
|
||||
// I don't understand ... <math.h> or <cmath> should be included
|
||||
// already depending on how you defined FG_HAVE_STD_INCLUDES, but I
|
||||
// can go ahead and add this -- CLO
|
||||
#ifdef __MWERKS__
|
||||
# include <math.h> // needed fabs()
|
||||
#endif
|
||||
|
||||
#ifndef FG_HAVE_NATIVE_SGI_COMPILERS
|
||||
FG_USING_STD(ostream);
|
||||
FG_USING_STD(istream);
|
||||
@@ -106,6 +113,7 @@ public:
|
||||
double& operator [] ( int i); // indexing
|
||||
double operator[] (int i) const; // read-only indexing
|
||||
|
||||
inline const double *get_n() const { return n; };
|
||||
double x() const; // cartesian x
|
||||
double y() const; // cartesian y
|
||||
double z() const; // cartesian z
|
||||
@@ -295,9 +303,9 @@ inline Point3D operator / (const Point3D& a, const double d)
|
||||
inline bool operator == (const Point3D& a, const Point3D& b)
|
||||
{
|
||||
return
|
||||
(a.n[PX] - b.n[PX]) < fgPoint3_Epsilon &&
|
||||
(a.n[PY] - b.n[PY]) < fgPoint3_Epsilon &&
|
||||
(a.n[PZ] - b.n[PZ]) < fgPoint3_Epsilon;
|
||||
fabs(a.n[PX] - b.n[PX]) < fgPoint3_Epsilon &&
|
||||
fabs(a.n[PY] - b.n[PY]) < fgPoint3_Epsilon &&
|
||||
fabs(a.n[PZ] - b.n[PZ]) < fgPoint3_Epsilon;
|
||||
}
|
||||
|
||||
inline bool operator != (const Point3D& a, const Point3D& b)
|
||||
|
||||
@@ -28,12 +28,19 @@
|
||||
|
||||
// If Unix, replace all ":" with "/". If MacOS, replace all "/" with
|
||||
// ":" it should go without saying that neither of these characters
|
||||
// should be used in file or directory names.
|
||||
// should be used in file or directory names. In windoze, allow the
|
||||
// second character to be a ":" for things like c:\foo\bar
|
||||
|
||||
static string fix_path( const string path ) {
|
||||
string result = path;
|
||||
|
||||
for ( int i = 0; i < (int)path.size(); ++i ) {
|
||||
#if defined( WIN32 )
|
||||
// for windoze, don't replace the ":" for the second character
|
||||
if ( i == 1 ) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ( result[i] == FG_BAD_PATH_SEP ) {
|
||||
result[i] = FG_PATH_SEP;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
#define _FGPATH_HXX
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <Include/compiler.h>
|
||||
|
||||
#include STL_STRING
|
||||
|
||||
@@ -95,12 +95,19 @@ skipeol( istream& in )
|
||||
{
|
||||
char c = 0;
|
||||
// skip to end of line.
|
||||
while ( in.get(c) && (c != '\n' && c != '\r') )
|
||||
;
|
||||
while ( in.get(c) ) {
|
||||
if ( (c == '\n') || (c == '\r') ) {
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __MWERKS // -dw- need to strip line ending!
|
||||
in >> skipws;
|
||||
#endif
|
||||
#ifdef __MWERKS__
|
||||
// also break on '\0'
|
||||
if ( c == '\0' ) {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
||||
@@ -109,15 +116,31 @@ istream&
|
||||
skipws( istream& in ) {
|
||||
char c;
|
||||
while ( in.get(c) ) {
|
||||
#ifdef __MWERKS__ // -dw- for unix file compatibility
|
||||
if ( ! (isspace( c ) ) || c != '\0' || c!='\n' || c != '\r' ) {
|
||||
#else
|
||||
if ( ! isspace( c ) ) {
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
|
||||
// -dw- for unix file compatibility
|
||||
// -clo- this causes problems for unix
|
||||
if ( (c == '\n') || (c == '\r') || (c == '\0') ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ! isspace( c ) && c != '\n' ) {
|
||||
// put pack the non-space character
|
||||
in.putback(c);
|
||||
break;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
if ( ! isspace( c ) ) {
|
||||
// put pack the non-space character
|
||||
in.putback(c);
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
return in;
|
||||
}
|
||||
@@ -128,7 +151,11 @@ skipcomment( istream& in )
|
||||
while ( in )
|
||||
{
|
||||
// skip whitespace
|
||||
#ifdef __MWERKS__
|
||||
in >> ::skipws;
|
||||
#else
|
||||
in >> skipws;
|
||||
#endif
|
||||
|
||||
char c;
|
||||
if ( in.get( c ) && c != '#' )
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if !defined( __CYGWIN__ ) && !defined( __CYGWIN32__ )
|
||||
#if !defined( WIN32 )
|
||||
# if !defined( HAVE_STL_SGI_PORT ) && !defined( __MWERKS__ )
|
||||
// Avoid malloc with STLport and MSL
|
||||
# include <malloc.h>
|
||||
@@ -28,12 +28,7 @@
|
||||
|
||||
int xglTraceOn = TRUE ;
|
||||
|
||||
#ifndef WIN32
|
||||
FILE *xglTraceFd = stdout ;
|
||||
#else /* WIN32 */
|
||||
/* Bail for now, we just want it to compile I guess */
|
||||
FILE *xglTraceFd = NULL;
|
||||
#endif /* WIN32 */
|
||||
FILE *xglTraceFd = NULL;
|
||||
|
||||
struct GLenumLookup
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user