/* $Id: global.hpp,v 1.21 2005/06/28 13:55:19 chfreund Exp $ */ #ifndef _GLOBAL_HPP_ #define _GLOBAL_HPP_ #include #include #define DBG(level) if( level <= DBG_LEVEL ) #define LOG(level) if( level <= LOG_LEVEL ) // #define REAL_IS_FLOAT #ifdef REAL_IS_FLOAT typedef float real; #define FABS_REAL fabsf #define TAN_REAL tanf #define COS_REAL cosf #define SIN_REAL sinf #define ATAN2_REAL atan2f #define SQRT_REAL sqrtf #else typedef double real; #define FABS_REAL fabs #define TAN_REAL tan #define COS_REAL cos #define SIN_REAL sin #define ATAN2_REAL atan2 #define SQRT_REAL sqrt #endif enum Status { DEFAULT, SHUTDOWN, SYNC }; const int DESIRED_DIFF = 40; const real GRAVITATION = 0.3; void INFO( const char* format, ... ); bool CHECK( const bool test, const char* format, ... ); bool ASSERT( const bool test, const char* format, ... ); void FLUSH_LOG( void ); void REDIRECT_LOG( const char* filename = NULL ); void makePace(); inline int ROUND( const real x ) { return static_cast( round( x )); } // already defined somewhere else //template T min( const T a, const T b ) { return a < b ? a : b; } //template T max( const T a, const T b ) { return a > b ? a : b; } #endif // _GLOBAL_HPP_