Compare commits

..

7 Commits

Author SHA1 Message Date
curt
bb882a1239 Borland C++ tweaks.
MacOS/Metrowerks tweaks.
Fix for fgText default constructor.
1999-06-20 01:52:31 +00:00
curt
6b2bf2fa8e Fixed a bug in handling windoze driver letter ":" notation. 1999-06-15 19:55:10 +00:00
curt
2640b43355 Add a method to return pointer to data array. 1999-06-12 21:09:41 +00:00
curt
d201e9b5c5 The next round of MacOS changes contributed by Darrell Walisser.
Starting work on fixing tringle slivers in scenery generation tools.
1999-06-05 12:45:40 +00:00
curt
8f0f79506c Mac portability changes contributed by "Darrell Walisser" <dwaliss1@purdue.edu> 1999-06-02 22:22:47 +00:00
curt
121d2f92cb Fixed an IRIX warning message where an inline function is referenced
before it is defined.
1999-06-01 21:16:33 +00:00
curt
87e641aeda Update README.plib with clearer wording.
Fixed the == compare in point3d.hxx.
1999-06-01 21:01:03 +00:00
9 changed files with 82 additions and 29 deletions

View File

@@ -28,6 +28,8 @@
#endif
#include <math.h>
#include <Misc/fgpath.hxx>
#include "newbucket.hxx"

View File

@@ -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;

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -27,6 +27,10 @@
#define _FGPATH_HXX
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Include/compiler.h>
#include STL_STRING

View File

@@ -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 != '#' )

View File

@@ -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
{