MacOS portability improvements.

This commit is contained in:
curt
1999-04-27 15:54:39 +00:00
parent 489b562232
commit f8dde93e05
7 changed files with 51 additions and 25 deletions
+5 -1
View File
@@ -25,6 +25,10 @@
#include <Include/compiler.h>
#ifdef __MWERKS__
#include <stdlib.h> // for exit()
#endif
#include STL_STRING
#include <Debug/logstream.hxx>
@@ -47,7 +51,7 @@ fgINTERPTABLE::fgINTERPTABLE( const string& file ) {
size = 0;
in >> skipcomment;
while ( ! in.eof() ){
while ( in ) {
if ( size < MAX_TABLE_SIZE ) {
in >> table[size][0] >> table[size][1];
size++;
+10 -11
View File
@@ -37,16 +37,6 @@ extern "C" {
#define USE_XTRA_MAT3_INLINES
/* ------------------------------ Types --------------------------------- */
typedef double MAT3mat[4][4]; /* 4x4 matrix */
typedef double MAT3vec[3]; /* Vector */
typedef double MAT3hvec[4]; /* Vector with homogeneous coord */
/* ------------------------------ Macros -------------------------------- */
extern MAT3mat identityMatrix;
#if defined(i386)
#define USE_X86_ASM
#endif
@@ -69,9 +59,18 @@ static __inline int FloatToInt(float f)
return r;
}
#else
#define FloatToInt(F) ((int) (F))
#define FloatToInt(F) ((int) ((F) < 0.0f ? (F)-0.5f : (F)+0.5f))
#endif
/* ------------------------------ Types --------------------------------- */
typedef double MAT3mat[4][4]; /* 4x4 matrix */
typedef double MAT3vec[3]; /* Vector */
typedef double MAT3hvec[4]; /* Vector with homogeneous coord */
/* ------------------------------ Macros -------------------------------- */
extern MAT3mat identityMatrix;
/* Tests if a number is within EPSILON of zero */
#define MAT3_IS_ZERO(N) ((N) < MAT3_EPSILON && (N) > -MAT3_EPSILON)
+4 -3
View File
@@ -29,7 +29,7 @@
# error This library requires C++
#endif
#include "Include/compiler.h"
#include <Include/compiler.h>
#ifdef FG_MATH_EXCEPTION_CLASH
# define exception c_exception
@@ -50,11 +50,12 @@ FG_USING_STD(ostream);
FG_USING_STD(istream);
#endif
// -rp- assert.h is buggy under MWCWP3, as multiple #include undef assert !
// -dw- someone seems to have forgotten this...
#ifdef __MWERKS__
# define assert(x)
FG_USING_STD(std);
#endif
const double fgPoint3_Epsilon = 0.0000001;
enum {PX, PY, PZ}; // axes