qafDef.h

00001 /* 
00002 ** Qaf Framework 1.2
00003 ** June 2006
00004 ** 
00005 ** Pedro Luchini de Moraes, Public Domain - Free Lunch Code
00006 */
00007 
00008 #include <math.h>
00009 
00015 #ifndef QAF_DEF_H
00016 #define QAF_DEF_H
00017 
00018 
00022 #define QAF_VERSION 1.2f
00023 
00024 
00028 #define QAF_EPSILON 1e-3f
00029 
00030 
00035 #define QAF_WATER_TEXTURE "qafWater.png"
00036 
00037 
00039 
00042 #define QAF_WATER_COLOR_R 0
00043 #define QAF_WATER_COLOR_G 150
00044 #define QAF_WATER_COLOR_B 255
00045 #define QAF_WATER_COLOR_A 30
00047 
00048 
00050 
00053 #define QAF_WAVE_FREQUENCY   0.6f
00054 #define QAF_WAVE_AMPLITUDE_X 0.003f
00055 #define QAF_WAVE_AMPLITUDE_Y 0.04f
00056 #define QAF_WAVE_CURRENT_X   0.015f
00057 #define QAF_WAVE_CURRENT_Y   0
00059 
00060 
00062 
00065 #define QAF_REFRACTION_AMPLITUDE 1.0f
00066 #define QAF_REFRACTION_FREQUENCY  3
00067 #define QAF_REFRACTION_MESH_ROWS 40
00068 #define QAF_REFRACTION_MESH_COLS 15
00070 
00071 
00075 #define QAF_DEFAULT_TEX_CACHE_SIZE 7
00076 
00077 
00079 
00082 template<typename T>
00083 inline T MIN ( const T & x, const T & y ) {
00084      if ( x < y )
00085         return x;
00086     else
00087         return y;
00088 }
00089 
00090 template<typename T>
00091 inline T MAX ( const T & x, const T & y ) {
00092      if ( x > y )
00093         return x;
00094     else
00095         return y;
00096 }
00097 
00098 template<typename T>
00099 inline T ABS ( const T & x )  {
00100     if ( x > 0 )
00101         return x;
00102     else
00103         return -(x);
00104 }
00105 
00106 inline float round ( float x ) {
00107     if ( fmodf(x, 1.0f) < 0.5f )
00108         return floorf( x );
00109     else
00110         return ceilf( x );
00111 }
00113 
00114 #endif

Generated on Sun Mar 25 12:32:12 2007 for Qaf Framework by  doxygen 1.5.1-p1