R:/projects/actioncube/_svn/trunk/ac/source/src/water.cpp File Reference

#include "pch.h"
#include "cube.h"

Include dependency graph for water.cpp:


Defines

#define VERTW(vertw, body)
#define VERTWT(vertwt, body)   VERTW(vertwt, { float v = cosf(angle); float duv = 0.2f*v; body; })
#define renderwaterstrips(vertw, hf, t)

Functions

 VARP (watersubdiv, 1, 4, 64)
 VARF (waterlevel,-128,-128, 127, if(!noteditmode()) hdr.waterlevel=waterlevel)
void setwatercolor (const char *r, const char *g, const char *b, const char *a)
 COMMANDN (watercolour, setwatercolor, ARG_4STR)
 VERTW (vertwc,{float v=cosf(angle);glColor4ub(hdr.watercolor[0], hdr.watercolor[1], hdr.watercolor[2],(uchar)(hdr.watercolor[3]+(max(v, 0.0f)-0.5f)*51.0f));}) VERTWT(vertwt
void setprojtexmatrix ()
void setupmultitexrefract (GLuint reflecttex, GLuint refracttex)
void setupmultitexreflect (GLuint reflecttex)
void cleanupmultitex (GLuint reflecttex, GLuint refracttex)
 VARP (mtwater, 0, 1, 1)
int renderwater (float hf, GLuint reflecttex, GLuint refracttex)
void addwaterquad (int x, int y, int size)
void calcwaterscissor ()
void resetwater ()

Variables

int wx1
int wy1
int wx2
int wy2
float wsx1
float wsy1
float wsx2
float wsy2

Define Documentation

#define renderwaterstrips ( vertw,
hf,
t   ) 

Value:

for(int x = wx1; x<wx2; x += watersubdiv) \
    { \
        glBegin(GL_TRIANGLE_STRIP); \
        vertw(x,             wy1, hf, t); \
        vertw(x+watersubdiv, wy1, hf, t); \
        for(int y = wy1; y<wy2; y += watersubdiv) \
        { \
            vertw(x,             y+watersubdiv, hf, t); \
            vertw(x+watersubdiv, y+watersubdiv, hf, t); \
        } \
        glEnd(); \
        nquads += (wy2-wy1-1)/watersubdiv; \
    }

#define VERTW ( vertw,
body   ) 

Value:

inline void vertw(float v1, float v2, float v3, float t) \
    { \
        float angle = v1*v2*0.1f + t; \
        float h = 0.3f*sinf(angle); \
        body; \
        glVertex3f(v1, v2, v3+h); \
    }

#define VERTWT ( vertwt,
body   )     VERTW(vertwt, { float v = cosf(angle); float duv = 0.2f*v; body; })


Function Documentation

void addwaterquad ( int  x,
int  y,
int  size 
)

void calcwaterscissor (  ) 

void cleanupmultitex ( GLuint  reflecttex,
GLuint  refracttex 
)

COMMANDN ( watercolour  ,
setwatercolor  ,
ARG_4STR   
)

int renderwater ( float  hf,
GLuint  reflecttex,
GLuint  refracttex 
)

void resetwater (  ) 

void setprojtexmatrix (  ) 

void setupmultitexreflect ( GLuint  reflecttex  ) 

void setupmultitexrefract ( GLuint  reflecttex,
GLuint  refracttex 
)

void setwatercolor ( const char *  r,
const char *  g,
const char *  b,
const char *  a 
)

VARF ( waterlevel  ,
-  128,
-  128,
127  ,
if(!noteditmode()) hdr.  waterlevel = waterlevel 
)

VARP ( mtwater  ,
0  ,
1  ,
1   
)

VARP ( watersubdiv  ,
1  ,
4  ,
64   
)

VERTW ( vertwc   ) 


Variable Documentation

float wsx1

float wsx2

float wsy1

float wsy2

int wx1

int wx2

int wy1

int wy2


Generated on Mon Dec 8 21:41:33 2008 for AssaultCube by  doxygen 1.5.7.1