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

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 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 | ) |
| #define VERTWT | ( | vertwt, | |||
| body | ) | VERTW(vertwt, { float v = cosf(angle); float duv = 0.2f*v; body; }) |
| 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 | ) |
| float wsx1 |
| float wsx2 |
| float wsy1 |
| float wsy2 |
| int wx1 |
| int wx2 |
| int wy1 |
| int wy2 |
1.5.7.1