00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #ifndef ARMAGETRON_DEFS_H
00029 #define ARMAGETRON_DEFS_H
00030 
00031 #ifdef _MSC_VER
00032 
00033 #pragma warning ( disable : 4244 4305 4800 4250)
00034 
00035 #endif
00036 
00037 #include "aa_config.h"
00038 
00039 #ifdef WIN32
00040 #include <windows.h>
00041 #endif
00042 
00043 #include <math.h>
00044 #include <iosfwd>
00045 
00046 
00047 
00048 
00049 #include <string.h>
00050 #include <memory>
00051 #include <typeinfo>
00052 #include <cstdlib>
00053 
00054 
00055 
00056 #ifndef MAX_VIEWERS
00057 #define MAX_VIEWERS 4
00058 #endif
00059 
00060 #ifndef M_PI
00061 #define M_PI 3.14159f
00062 #endif
00063 
00064 typedef float REAL;
00065 const REAL EPS=REAL(1E-7);
00066 
00067 template<class T> void Swap(T &a,T &b){
00068     T c=a;
00069     a=b;
00070     b=c;
00071 }
00072 typedef void AA_VOIDFUNC();
00073 typedef void INTFUNC(int);
00074 typedef bool BOOLRETFUNC();
00075 
00076 typedef AA_VOIDFUNC *FUNCPTR;
00077 typedef INTFUNC *INTFUNCPTR;
00078 
00079 
00080 #ifndef HAVE_SINF
00081 inline REAL sinf( REAL angle ) throw() { return REAL(sin( angle )); }
00082 #endif
00083 
00084 #ifndef HAVE_COSF
00085 inline REAL cosf( REAL angle ) throw() { return REAL(cos( angle )); }
00086 #endif
00087 
00088 #ifndef HAVE_TANF
00089 inline REAL tanf( REAL angle ) throw() { return REAL(tan( angle )); }
00090 #endif
00091 
00092 #ifndef HAVE_ATAN2F
00093 inline REAL atan2f( REAL y, REAL x ) throw() { return REAL(atan2( y, x )); }
00094 #endif
00095 
00096 #ifndef HAVE_SQRTF
00097 inline REAL sqrtf( REAL x ) throw() { return REAL(sqrt( x )); }
00098 #endif
00099 
00100 #ifndef HAVE_LOGF
00101 inline REAL logf( REAL x ) throw() { return REAL(log( x )); }
00102 #endif
00103 
00104 #ifndef HAVE_EXPF
00105 inline REAL expf( REAL x ) throw() { return REAL(exp( x )); }
00106 #endif
00107 
00108 #ifndef HAVE_FABSF
00109 inline REAL fabsf( REAL x ) throw() { return REAL(fabs( x )); }
00110 #endif
00111 
00112 #ifndef HAVE_FLOORF
00113 inline REAL floorf( REAL x ) throw() { return REAL(floor( x )); }
00114 #endif
00115 
00116 #ifndef HAVE_ISBLANK
00117 
00118 inline bool isblank(int x){ return ((x == ' ') || (x == '\t')); }
00119 #endif
00120 
00121 #ifdef _MSC_VER
00122 
00123 #include <iostream>
00124 
00125 
00126 #else
00127 #include <iostream>
00128 
00129 #endif
00130 
00131 #ifndef HAVE_POW10
00132 inline double pow10(double y) throw() { return pow(10.0, y); }
00133 #endif
00134 
00135 #ifndef HAVE_POW10F
00136 inline float pow10f(float y) throw() { return powf(10.0, y); }
00137 #endif
00138 
00139 #endif