CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csdef.h

00001 /*
00002     Copyright (C) 1998-2000 by Jorrit Tyberghein
00003   
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008   
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013   
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #if !defined(CSDEF_FRIEND)
00020 #error You are not allowed to include this file! Use cssysdef.h instead.
00021 #endif
00022 
00023 #ifndef __CS_CSDEF_H__
00024 #define __CS_CSDEF_H__
00025 
00026 #include "platform.h"
00027 #include "cstypes.h"
00028 
00029 #include <stdio.h>
00030 #include <stdlib.h>
00031 #include <math.h>
00032 #include <time.h>
00033 #include <signal.h>
00034 #include <errno.h>
00035 #include <string.h>
00036 #include <assert.h>
00037 
00038 #ifdef CS_USE_NEW_RENDERER
00039   #define CS_USE_SHADOW_VOLUMES
00040   #define iGraphics3D iGraphics3D
00041 #endif
00042 
00043 // DEPRECATED use "true" instead
00044 #ifndef TRUE
00045   #define TRUE 1
00046 #endif
00047 
00048 // DEPRECATED use "false" instead
00049 #ifndef FALSE
00050   #define FALSE 0
00051 #endif
00052 
00053 #ifndef MIN
00054   #define MIN(a,b) ((a)<(b)?(a):(b))
00055 #endif
00056 
00057 #ifndef MAX
00058   #define MAX(a,b) ((a)>(b)?(a):(b))
00059 #endif
00060 
00061 #ifndef ABS
00062  #define ABS(x) ((x)<0?-(x):(x))
00063 #endif
00064 
00065 #ifndef SIGN
00066   #define SIGN(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
00067 #endif
00068 
00069 #ifndef PI
00070  #define PI 3.1415926535897932385f
00071 #endif
00072 #ifndef HALF_PI
00073   #define HALF_PI (PI / 2.0f)
00074 #endif
00075 #ifndef TWO_PI
00076   #define TWO_PI (PI * 2.0f)
00077 #endif
00078 
00079 #undef EPSILON
00080   #define EPSILON 0.001f                        /* Small value */
00081 #undef SMALL_EPSILON
00082   #define SMALL_EPSILON 0.000001f               /* Very small value */
00083 #undef SMALL_EPSILON_D
00084   #define SMALL_EPSILON_D 0.000000000001f       /* Very, very small value */
00085 
00086 // Platforms with compilers which only understand old-style C++ casting syntax
00087 // should define CS_USE_OLD_STYLE_CASTS.
00088 #if defined(CS_USE_OLD_STYLE_CASTS)
00089   #define CS_CAST(C,T,V) ((T)(V))
00090 #else
00091   #define CS_CAST(C,T,V) (C<T>(V))
00092 #endif
00093 
00094 #define STATIC_CAST(T,V)      CS_CAST(static_cast,T,V)
00095 #define DYNAMIC_CAST(T,V)     CS_CAST(dynamic_cast,T,V)
00096 #define REINTERPRET_CAST(T,V) CS_CAST(reinterpret_cast,T,V)
00097 #define CONST_CAST(T,V)       CS_CAST(const_cast,T,V)
00098 
00099 // Platforms with compilers which do not understand the new C++ keyword
00100 // `explicit' should define CS_USE_FAKE_EXPLICIT_KEYWORD.
00101 #if defined(CS_USE_FAKE_EXPLICIT_KEYWORD)
00102   #define explicit /* nothing */
00103 #endif
00104 
00105 // The smallest Z at which 3D clipping occurs
00106 #define SMALL_Z 0.01f
00107 
00108 #endif // __CS_CSDEF_H__

Generated for Crystal Space by doxygen 1.2.14